Purchase Solution

A java program to read values and calculate payroll

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.

Attachments
Purchase this Solution

Solution Summary

This solution demonstrates how to read in integers and check that they have a valid value. It also show how to do some arithmetic operations on the numbers read in. This solution is in Java.

Solution Preview

The original file had several small bugs that needed to be fixed. These were mostly due to mistyped words (System.outprint instead of System.out.print, for example). Once those were fixed then the program mostly worked for reading in the information for one employee. The trick to getting the program to read for multiple employees is to use a loop that continues until a certain condition is met. In this case we want to use a while loop that will continue while the employee name is not "stop".

Also, notice that we are trying to read in a positive integer in two different locations. When that happens it is best to make ...

Purchase this Solution


Free BrainMass Quizzes
Javscript Basics

Quiz on basics of javascript programming language.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

C++ Operators

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

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.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.