How to modify the payroll program application

Assignment Help Computer Engineering
Reference no: EM1330561

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.

The teacher posted that this is what the program should have looked like:
import java.util.Scanner;

public class Payroll
{
public static void main (String args[])
{

String name;
double payRate;
double hours;
double weeklyPay;

Scanner input = new Scanner(System.in);

System.out.print("Enter name: ");
name = input.next();

System.out.print("Enter payrate: "); // prompt
payRate = input.nextDouble();

System.out.print("Enter hours: "); // prompt
hours = input.nextDouble();

weeklyPay = payRate * hours;

System.out.print(name + " earned ");
System.out.printf("$ %.2fn", weeklyPay);

} //end of main method

} // end of Payroll class

Can you do the modifications and post the solution in the correct format, or tell me how I get it to the .java file extension?

Reference no: EM1330561

Questions Cloud

Process flowcharts - graphical and fishbone flowcharts : Process Flowcharts: Graphical and Fishbone Flowcharts - increasing brand management by training employees
Explain how is the value of a company judged : How is the value of a company judged? What criteria is used to determine if the use of technology is successful? Include personal opinions as well.
Decision based on ethical vs moral reasoning : Make a distinction between judgments based upon ethics and moral reasoning and the regulatory system. Explain the difference between intentional torts and negligence.
Task-centered leadership and employee-centered leadership : Is task-centered leadership more effective than employee-centered leadership? Why or why not?
How to modify the payroll program application : Modify the Payroll Program application and it continues to request employee information until the user enters stop as the employee name.
Analysis of human resource challenges : Analysis of Human Resource Challenges - Please read and describe the following journal articles and HRM challenges. Based on information in the articles
Show the competitive position more different firms : Show the competitive position of 5 or more different firms within this industry
Explain academic approach to e-business : What makes an online business a successful e-business? There are many factors. Mention four factors and explain why they are important - support your answer with examples
Walmarts product line classification : What is walmarts product line classification?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write down the code to declare a 2d integer array

Write down the code to initialize myary1 beginning with myary1[0][0] = 1 and adding one for each subsequent array location.

  Program to compute the area and circumference of circle

Algorithm which will prompt for and receive the measurement of the diameter of a circle and compute and show the area and circumference of the circle.

  Write a recursive process called productarray

Write a recursive method called productArray that takes an array of integers, a start index and an end index and returns the product of elements of the array.

  Define the way for creating work breakdown structure

Define the way for creating work breakdown structure Use a hypothetical project to illustrate your understanding of the WBS.

  What changes have to be made to accept $ and cents

What changes have to be made to accept $ and cents

  Modify compound interest program

Modify compound interest program

  Hexadecimal values of dx and ax

Specify the hexadecimal values of DX and AX after the following given instructions have been executed.

  Troubleshooting the infected system

AV software has eliminated the malware from a highly infected system. After first reboot, an error message is displayed which consists of a reference to the strange DLL file which is missing.

  The purchase of hardware for the organization

What are important considerations for an organization to make while disposing of old computer equipment.

  Define purpose and role of an is steering committee

What is the purpose and role of an IS steering committee, or advisory board.

  How to create an encryption absolutely unbreakable

How to create an encryption absolutely unbreakable

  Define computer hardware - financial planning

In this recommendation, selecting only two kinds of computers (desktop, laptop, notebook or handheld computers) and other hardware components.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd