Write an application that includes final constants named START and STOP that are set to 5 and 500, respectively. The application counts by five from 5 through 500 inclusive, and it starts a new line after every multiple of 50 (50, 100, 150, and so on). Save the file as CountByFives.java.
Modify the CountByFives application so that the user enters the value to count by. Start each new line after 10 values have been displayed. Save the file as CountByAnything.java.
Write an application that asks a user to enter three integers. Display them in ascending and descending order. Save the file as AscendingAndDescending.java.
Write a program for Horizon Phones, a provider of cellular phone service. Prompt a user for maximum monthly values for talk minutes needed, text messages needed, and gigabytes of data needed, and then display a recommendation for the best plan for the customer’s needs. A customer who needs fewer than 500 minutes of talk and no text or data should buy Plan A at $49 per month. A customer who needs fewer than 500 minutes of talk and any text messages should buy Plan B at $55 per month. A customer who needs 500 or more minutes of talk and no data should buy either Plan C for up to 100 text messages at $61 per month or Plan D for 100 text messages or more at $70 per month. A customer who needs any data should buy Plan E for up to 3 gigabytes at $79 per month or Plan F for 3 gigabytes or more at $87 per month. Save the file as CellPhoneService.java.
Acme Parts runs a small factory and employs workers who are paid one of three hourly rates depending on their shift: first shift, $17 per hour; second shift, $18.50 per hour; third shift, $22 per hour. Each factory worker might work any number of hours per week; any hours greater than 40 are paid at one and one-half times the usual rate. In addition, second- and third-shift workers can elect to participate in the retirement plan, for which 3 percent of the worker’s gross pay is deducted from the paychecks. Write a program that prompts the user for hours worked and the shift number; if the shift number is 2 or 3, prompt the user to enter the worker’s choice to participate in the retirement plan. Display
the hours worked,
the shift,
the hourly pay rate,
the regular pay,
overtime pay,
the total of regular and overtime pay,
the retirement deduction, if any, and
the net pay.
Save the file as AcmePay.java.