-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSchedule.java
More file actions
58 lines (47 loc) · 1.74 KB
/
Copy pathSchedule.java
File metadata and controls
58 lines (47 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* This code is my own work. I did not get any help from any online source
such as chegg.com; from a classmate, or any other person other than the instructor
or TA for this course. I understand that getting outside help from this course
other than from the instructor or TA will result in a grade of 0 in this
assignment and other disciplinary actions for academic dishonesty.
# Name : Cristian Z
# Class: CSET 1200
# Instructor: Dr. Jared Oluoch
# Programming Assignment: 7
# Problem: 1
# Date: 10/19/21
# Summary: Schedule
# Problem 1
Write a program that asks the user to enter the number of employees
in an organization, the employees' names, and the number of hours they
worked during the week from Monday through Friday. The program should
display the names of employees and the total number of hours
they worked in the week.
(10 Points.)
https://youtu.be/t6bftIoBllQ
*/
import java.util.Scanner;
public class Schedule{
public static void main(String[] args) {
//Start looking for thingies
Scanner input = new Scanner (System.in);
//Say something familiar
System.out.println("Please enter the number of employees in your organization.");
//Grab a number
int n = input.nextInt();
//Start 2 new
String [] Name = new String [n];
int [] hWorked = new int [n];
//loop the grabbing of unsightly information
for (int i = 0; i<Name.length; i++)
{
System.out.println("Please enter the first name of the employee and hours worked\nfrom Monday through Friday.\n\n");
Name[i] = input.next();
hWorked[i] = input.nextInt();
}
//loop the printing in order
for(int i = 0; i < Name.length; i++)
{
System.out.println(Name[i] + "\t" + hWorked[i]);
}
}
}