Need help with a Java program.

Need help with a Java program.

Write a computational class to model a toaster. It should have two private instance fields; one to store the number of slots in the toaster and the other to store the desired toast setting (“light”, “medium”, or “dark”). Include a constructor that accepts an integer value between 1 and 6 to set the number of slots. Write public methods to set and get each instance value. The toasting times for “light”, ”medium”, or “dark” are 2, 4, 6 minutes respectively. Write a public method, estimatedTime(), that checks the toast setting and returns the time required.

Write an interface class using the constructor, initialize the toaster object to 2 slots. The interface should prompt the user to indicate toasting setting using by entering 1, 2, or 3 for “light”, “medium”, or “dark”. Using the estimatedTime method the interface should then report to the user, “Your toast will be done in ~~~ minutes”, replacing the ~~~ with the appropriate toasting time.

Please help.

"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.


Discount Code: CIPD30



Click ORDER NOW..

order custom paper