Question: Write a Java program for these two questions s ucint to use 11. Write a Java program using while loop that determine whether inon prompt

Write a Java program for these two questions
 Write a Java program for these two questions s ucint to

s ucint to use 11. Write a Java program using while loop that determine whether inon prompt the user to input an even number. If it is number "Good bye!" messages, otherwise, print "Wrong input data is an even number. Your program wil an even number, your program will terminate with "Correcti" and , then ask user to type a number again canner Sample log of execution: Type an even number: 3 Wrong! Type an even number: 4 Correct! Good bye! veturn 12. Write a Java program that calculates sales price. Your program will prompt the user for information about two parameters: real number of price (data type: double) and four digits of membership ID(data type: String). One method should receive the parameters and return how much money to pay to buy the good. The customer should receive discount of 10% from the original price if membership ID starts with A and receive discount of 5% f starts with 'B'. For example, the call pay(100.0, "A301") should return 90.0. (eg: 100 (100 0.1)-90.0). If ID starts with neither Anora 0% discount rate s applied. Assume every input data is valid price is double, ID s 4-digit string and this program does not run repeatedly (NO while loop is required). membership ID String the Sample log of execution: Price? 1000 ID? A301 You pay:90.0 Price? 100.0 ID? C500 You pay: 100.0

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!