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

  How to expand class linkedlisttype

Expand class linkedListType. Write down a function that returns the info of the kth element of the linked list. If no such factor exists, output an appropriate message.

  The most common process to ensure client security

How can worms and viruses be introduced to a Web site. What is the most common process to ensure client security.

  Write down a program that includes a function picnic()

The passed floating-point number represents TOTAL amount of money to be spent on food. The function is to determine the quantity of HOTDOGS, HAMBURGERS,SALAD,PICKLES that can be purchaced, writing these values directly into the respective variable..

  What sorts of measures would you recommend

What sorts of measures would you recommend for minimizing changes to project schedules caused by non-availability of required human resources, or conflicts with the personal plans of project workers (e.g. vacations).

  Access time and cache miss

Explain the access time when there is a cache miss? Suppose that the cache waits till the line has been fetched from the main memory and then re-executes for a hit.

  Reviewing and reporting microsoft security procedures

For every operating system, review the securities procedure involving, password protection, user account setting, files and folders privacy, and the network protection (this may not be a part of the operating system)

  Related to the polygon

Assume n=3 and P has positive area. Explain how to determine efficiently whether exactly one of the point’s q and r falls inside of P. Analyze how much time is utilized.

  Why a website would need to be redesigned

Why do you think it is important to always be planning the next site redesign for a company.

  How to use ms access and create a database

How to use MS Access and create a database

  Find the number of errors that (e,d) will correct

find the number of errors that (e,d) will correct.

  Transmitting message and tentative checkpoint

Is node P allowed to transmit the messages related to application (as opposed to message which is part of checkpoint algorithm itself) immediately after having taken a tentative checkpoint?

  Launching the radical innovation

Assume you wish to launch the radical innovation. You have the working prototype and have begun to test the early adopter market.

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