Question:
Does anyone know how to create a non-GUI based Java application that calculates weekly pay for an employee.?
kahmellion
2007-07-28 05:09:21 UTC
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 printout, display the dollar symbol ($) to the left of the weekly pay amount and format the weekly pay amount to display currency.
Six answers:
angel04
2007-07-28 07:54:22 UTC
public class MyConsoleIO

{

// Create a single shared BufferedReader for keyboard input

private static BufferedReader stdin =

new BufferedReader( new InputStreamReader( System.in ) );



// Program execution starts here

public static void main ( String [] args ) throws IOException

{

// Prompt the user

System.out.print( "Type some data for the program: " );





// Read a line of text from the user.

String input = stdin.readLine();



// Display the input back to the user.

System.out.println( "input = " + input );



} // end main method



} // end MyConsoleIO class





******************************...



make necessary changes as per requirements of application





Any prob rewrite





Smile always

good luck
larusch
2016-10-09 15:59:09 UTC
PayRate = enter.nextLine() device.out.print("Drop interior the form of working hours"); Hours_worked = enter.nextLine(); double payAmount; payAmount = Hours_worked * PayRate; device.out.print("worker call :" + Emp_name); device.out.print("$" + " payAmount"); } p.s. you are able to upload this line too : device.out.print(" no pay volume, you're fired!");
anonymous
2007-07-28 07:11:51 UTC
May be you can contact a Java expert. Check websites like http://getafreelnacer.com/
cmeinco
2007-07-28 05:17:46 UTC
I like to use Main.java:



public static void main(String [ ] args)

{

// input logic here

System.out.println("Hello World!");

}



then compile with "javac Main.java"



Then run with "java Main"







No, I won't do your homework for you... but here's a good start! Search yahoo/google for tips on how to read user input, etc. If you don't know which java version you have, open a command line and type "java -version"



Good Luck! (Feel free to ask further questions)
Fieyr
2007-07-28 05:15:20 UTC
Ah yes, the classic "intro to java calculate pay program."



Everyone has to do it. Do yourself a favor and figure it out on your own. You have to develop your own thought process for tackling Java problems. If you do the hard crud at the beginning here when Java is unfamiliar, you will be able to program with the best of them in a few months.
anonymous
2007-07-28 05:11:55 UTC
Yes, I am sure many people know how to do that.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...