I'm new to programming.
Can you guys help me on how to make a simple program that will display the employees name and how to let user enter the rate(pay) per hour and the number of hours worked separated by spaces only and then it'll calculate the wage, cause this part is makes me confused what to used to run...
Thank you so much!!
Hello guys ! Please help me how to separate this code into four class, i really dont know what to do??
Expand|Select|Wrap|Line Numbers
- import java.text.DecimalFormat;
- import java.util.*;
- public class EmployeeClass {
- private static DecimalFormat df2 = new DecimalFormat("#.##");
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.println("\n");
- System.out.print("\tEnter Name : \n");
- String name = input.nextLine();
- System.out.print("\tPress F for Full Time or P for Part Time: \n");
- char job_criteria =input.next().charAt(0);
- char select = Character.toUpperCase(job_criteria);
- if (select == 'F') {
- System.out.print("\tEnter Basic Pay : ");
- double monthlySalary = input.nextDouble();
- System.out.println("\n");
- System.out.println("\tName : " + name );
- System.out.println("\tMonthly Salary : " + df2.format(monthlySalary));
- System.out.println("\n");
- } else if (select == 'P') {
- System.out.print("\tEnter rate per hour and hours worked separated by spaces:\n");
- double ratePerHour = input.nextDouble();
- int hoursWorked = input.nextInt();
- double wage = (ratePerHour * hoursWorked);
- System.out.println("\n");
- System.out.println("\tEnter Name: " + name );
- System.out.println("\tWage: PHP " + df2.format(wage));
- System.out.println("\n");
- } else {
- System.out.println("\n");
- System.out.print("\tInvalid Option. Please Try Again");
- }
- System.out.print("\tEnd of Program");
- System.out.println("\n");
- }
- }