Purchase Solution

Modify a program to read data till the users says stop

Not what you're looking for?

Ask Custom Question

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.

Attachments
Purchase this Solution

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.

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 "." ...

Purchase this Solution


Free BrainMass Quizzes
Basic Networking Questions

This quiz consists of some basic networking questions.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

C++ Operators

This quiz tests a student's knowledge about C++ operators.