This is a simple Java program that simulates a microwave control panel with the following functionalities:
- Increase time by 30 seconds
- Switch between power levels 1 and 2
- Start the microwave
- Reset the microwave
- Turn off the microwave
Features
The program allows the user to interact with the microwave using console input. It provides a menu of options for the user to choose from, and executes the corresponding actions:
Increase time by 30 seconds
Switch power level between 1 and 2
Start the microwave
Reset the microwave
Turn off the microwave
How to Use
To use the program, follow these steps:
Clone the repository to your local machine.
Compile the <code>Main.java</code> file using a Java compiler.
Run the compiled <code>Main</code> class.
Follow the on-screen instructions to interact with the microwave control panel.
Example
Here's an example of how the interaction might look like:
Microwave control panel:
-
Increase time by 30 seconds
-
Switch power level between 1 and 2
-
Start the microwave
-
Reset the microwave
-
Turn off the microwave Choose an option (1-5): 1 Added 30 seconds. Current time: 30 seconds. Choose an option (1-5): 2 Power level set to: 2 Choose an option (1-5): 3 Cooking for 30 seconds at power level 2. Choose an option (1-5): 4 Microwave reset. Time is now 0 seconds and power level is 1. Choose an option (1-5): 5 Turning off the microwave. Goodbye!
Contributions are welcome! If you have any suggestions or improvements, feel free to create a pull request or open an issue.