Explore BrainMass

Modify a program to read data till the users says stop

Modify the Payroll Program application so it continues to request employee information
until the user enters stop as the employee name. In addition, program the application to
check that the hourly rate and number of hours worked are positive numbers. If either the
hourly rate or the number of hours worked is not a positive value, the application should
prompt the user to enter a positive amount.

I would like to stick to as basic of program as possible. I am not sure if I used the while and if statements correct.

© BrainMass Inc. brainmass.com June 19, 2018, 10:16 pm ad1c9bdddf


Solution Preview

There are two issues here. First, the compilation problem is due to a simple typo. If you look around line 34 in the program you will see "System.outprint". Notice that the "." between "out" and "print" is missing if you add that "." ...

Solution Summary

In this solution I show how to use a while loop to continue to query the user for input until the user enters "stop". This is an addition to a Java payroll program that asks the user to enter employee names, pay rates, and hours. The program calculates the weekly pay for the given employee.