import java.util.Scanner;.

Added on - 16 Oct 2019

  • 2

    Pages

  • 247

    Words

  • 219

    Views

  • 0

    Downloads

Trusted by +2 million users,
1000+ happy students everyday
Showing pages 1 to 1 of 2 pages
import java.util.Scanner;public class EmployeeApp{//-----------------------------------------------------------------// Read input//-----------------------------------------------------------------public static void main (String[] args){Scanner scan = new Scanner(System.in);String name;double attendanceRate;int hoursWorked;System.out.println("Employee1 name:");name = scan.next();System.out.println("Employee1 attendance rate:");attendanceRate = scan.nextDouble();System.out.println("Employee1 hours worked:");hoursWorked = scan.nextInt();//To-Do: Passing the user provided data (name, attendanceRate, hoursWorked) to the Employeeconstructor and create an employee object//For example,//Employee emp1 = new Employee(name, attendanceRate, hoursWorked);//To-Do: We need one more employee. So, repear the above steps (line 17-28) one more time
desklib-logo
You’re reading a preview
Preview Documents

To View Complete Document

Click the button to download
Subscribe to our plans

Download This Document