Question: Problem 1 A microwave control panel has five buttons: one for increasing the time by 10 seconds, one for switching between power levels Low, Modium,

 Problem 1 A microwave control panel has five buttons: one for

Problem 1 A microwave control panel has five buttons: one for increasing the time by 10 seconds, one for switching between power levels Low, Modium, and High, a stop button, a reset button, and a start button Implement a class that simulates the microwave, with a method for each button. The method for start button hould print a message "Cooking for... scoonds at level.. and changes the current status of the microwave. The method for stop button should print a message "Cooking stopped." and changes the current slalus of the microwave. Write a tester program to lest your micnowave class wih diferent values. Note: There is no graphical task in this problem Problem 2 Complete the two Java programs below. The first one, PrineGenerator, generates prime numbers, and the second one, prompts the user for an integer, and then pris out all prime numbers up to that inleger. For example, when the user enters 10, the program should print private ist current ck calculate= the nert Prime ransar. Gretors tho next prino ner lic int nextPrinel conplete this part Check if nis a prie ber oparan t check whether it i crime or not Oretora tre if is prie pablic static boolean srinelint n Cenplete this part import ovo . atilScanner; Tois closs prints prise numbers public class PrimeP inter public stetic void .n (String! args) yon.aut.printl Entor upper linit " Conplete this port Problem 3. Credit Card Number Validation: In this problem, your job is to validaze a credit card number given by lbe user s a String. Firs, w ll th spas or dushes belween lhe numhT. (Rmember that the number is given as a string) 'Then, do the following steps to validate the number: FuTIm Ihe sum of all the digils ol the cil cad number e Add to thatevery second digit, slarting with the second digit rom the right. . Add the number of digits in the second step that are greater than 4 .The rcsul should be divisible by 10 For example, consider the number 4012 HH88 8888 1881 Te sum of all digits is 89. The sum of the colored digits is 46. There are five colored digits larger than 4, so he result is 89+40+3-140. This final number, 140 is divisible by 10,s the card nurmber is valid. Write a Java progran, to creale a class lor this problem, including a method to check the validity of a given number. Then, wte a ester program to test some 16-digits numbers for their validity to be credit card Problem 4 Enhancc thc BankAccount cluss and sce how abstraction and cncopsulalion cnabk cvolutionary changes to software: .Begin with a simple enhancement: charging a fee for every deposit and withdrawal. Supply a mechanism for setting the fee and molify the deposit and withdraw methods so that the fee is levied. The initial transaction fee is 50 cents, and this can be changed later on. Test your class and check that the fee is computed correctly Now make a more complex change. The bank wll allow a fixed number of free transactions (depasits and withdrawals) every month, and charge for transactions exceeding the free allotment. The charge is not levied immediately but at he end of the month. The iniial value for the nurmber of free transactions is 10. Supply a new method deductMonthlyCharge to the BankAcoount class thal deducts the monthly charge and esets the transaction count Hint: Use Math max(actual transaction count, free transaction count) in your computation.) Produce a test progrum that verifics that the foes are colculated correctly over sevcral months. Problem 5. Implement a lava program that directs a cashier how to give change. The program has two inputs: the amount due and the amxount received from the customer. Display the dollas, quarters, dimes, nickels, and pennies that the customer should receive in return. In order to avoid round-off errors, the program user should supply both input amnts in pennies, for example 274 inslead of S2.74. Test your program with at least three different cases using a tester program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!