Create a non-gui based java application

Assignment Help Programming Languages
Reference no: EM13952869

Create a non-GUI based Java application that calculates weekly pay for an employee. The application should display text that requests the user input the name of the employee, the hourly rate, and the number of hours worked for that week. The application should then print out the name of the employee and the weekly pay amount. In the print out, display the dollar symbol ($) to the left fo the weekly pay amount and formate the weekly pay amount to display currency. Also have the application to continue to request employee information until the user enters "stop" as the employee name. Have the program to check 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, teh application should prompt the user to enter a positive amount. The program should use a class to store or retrieve the employee's name, the hourly rate, and the number of hours worked. Use a constructor to initialize the employee information, and a method withing that class to calculate the weekly pay. Once stop is entered as the employee name, the application should terminate.

Please keep this as simple as possible, no fancy stuff. No boolean, keep as one program by renaming the class within the class, no private static void. Very very very basic program with printf. Please! No buffered reader either. I cannot express simply simply simply and basic to much here! I'm a beginner programmer and need to see the basic before jumping into deep. A scanner is fine! I have included an attachment so you get the idea of how basic.

No, the new class will not be contained within the main method and you do not have to put it in a file of its own.

Yes, you are to create a main method that will create an instance of the class. The class should contain a constructor and a method that performs all of the functionality of the previous program.

Here is a brief example:

public class WeeklyPayroll
{
public static void main (String args[ ])
{
PayrollClass myPayroll = new PayrollClass ( );
} // end of main method

class PayrollClass ( )
{
declare variables

create constructor

}// end of Payroll class

}// end of WeeklyPayroll

Step 1: create a class declaration. If you create a class in the same program as the main the declaration might look something like this:

class NewClass
{
You will need to move all of the variables declared in the main to here.

Step 2: after the class and variable declaration you will create a constructor. Remember that a constructor is executed when you create a new object from a class. Constructors are declared just like other methods except that they have exactly the same name as the class. The constructor will come right after the declaration of the variables.

class NewClass
{
You will need to move all of the variables declared in the main to here.

public NewClass( )
{
You do not have to put anything in this constructor unless you are passing values to your variables. In this case, we are not.

}// end of constructor
} // end of NewClass

Step 3: now that you have your class created, we have to create a method that will calculate the weekly pay. We will declare this method void because this method will before a task but will not return any information when it completes the task. We will want to move everything contained in the outer while loop to this method that will immediately follow the constructor.

Step 4: the main method now has no statements. We will add only two statements. The first will be the statement that creates a new object and the second statement will call the method to calculate the weekly pay.

I'm not asking anyone to do the work I have attached what I have in payroll4.java I cannot get to compile. Please help!

Scanner should be fine.

Attachment:- payroll2.zip

Reference no: EM13952869

Questions Cloud

Calculate the estimated median : A sample of data was selected from a population: {195, 179, 205, 213, 179, 216, 185, 211}. Use the deviation score method and the calculation formula to calculate variance and standard deviations.
What should the audience patron : What should the audience patron, who is seeing this kind of theatre supposed to thinkwhen they leave the theatre? (what is it about? war, humanity, religion?)
How are the factors that are not controlled dealt with : At the end of the year, an achievement test is administered and the two groups are compared- Is this an experiment or an observation and If it's an experiment, what is the response variable? If it's an observation, what are they observing?
Integrative studies in human resources development : Gulfport Transit is the main public transportation authority in the Tampa, Florida Metroplex. It operates buses within Tampa, Sarasota, Clearwater, and Bradenton, Florida, and provides regular service to Sarasota Bradenton International Airport, S..
Create a non-gui based java application : Yes, you are to create a main method that will create an instance of the class. The class should contain a constructor and a method that performs all of the functionality of the previous program.
How are the mean, median, and mode interrelated : How are the mean, median, and mode interrelated? What considerations lead to the choice of one of these measures of location over another?
What is meant by a measure of location : What is meant by a measure of location? State in your own words the defini- tions of the following measures of location:- Arithmetic mean, Median and Mode
Prepare a list of the different kinds of costs : Prepare a list of the different kinds of costs that a company might incur as part of its "total package" salary cost.
Find the seasonal median number of home runs for each player : For each player, determine the minimum, the first quartile, the median, the third quartile and the maximum of their home run totals. Use these results to construct comparative box-and-whisker plots.

Reviews

Write a Review

Programming Languages Questions & Answers

  Create application which permits user to input a price

Create an application which allows a user to input a price until suiatble sentinel value is entered. Output is a price of each item on each day,one through seven.

  Perform some analysis of the age and weight relationships

In this project you will combine the use of arrays and objects to perform some analysis of the age and weight relationships among a group of people. You have been contracted to write a program into which data about people, including their ages and..

  Design program to asks for number of fat grams

Design a program that asks for the number of fat grams and calories in a food item. Validate the input as follows: Make sure the number of fat grams and calories are not less than 0.

  How to write a constructor

I'm trying to draw a diagram for the following problem statement. I need to create the function in JavaScript and call it in an HTML file.

  Divide the input space for the into three equivalence class

Furthermore, you may further divide the third classes into more classes: inputs whose length is long than 60 but less than 120, inputs whose length is long than 120 but less than 180, etc...

  Implementing class called card for standard playing card

Design and implement a aclass called Card that represents a standard playing card. each card has a suit and a face value.

  Use the concepts of file reading

This program requires you to use the concepts of file reading, parallel arrays and sorting. Your program should read the string content into a string array and the integer content into an integer array

  Create sql database "chart of accounts" report

A grand total of the balance field will be provided at the end of the report.

  Explain the functions which are useful

Explain some of the functions which you have found useful, where you found them, and how you use them. Describe good programming practices.

  Write program to evaluate young worker-s earning

Write down a program to evaluate how much young worker will make before retiring at age 65. Request worker's name, age, and starting salary as input.

  Create new method for random turning

Create new method named randomTurn (this method has no parameters and returns nothing). Select the code that does the random turning.

  Program to calculate state and county sales tax

Write a program that will ask the user to enter the amount of a purchase. The program should then calculate the state and county sales tax.

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