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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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