Skip to content
Snippets Groups Projects
Verified Commit 70526c0e authored by Christopher Bohn's avatar Christopher Bohn :thinking:
Browse files

Added starter code for Lab 3

parent 9cc78356
No related branches found
No related tags found
No related merge requests found
import java.util.Scanner;
public class Problem3 {
private static Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
float payRate;
float hoursWorked;
float grossEarnings;
payRate = scanner.nextFloat();
hoursWorked = scanner.nextFloat();
grossEarnings = hoursWorked * payRate;
System.out.print(grossEarnings);
}
}
import java.util.Scanner;
public class Problem4 {
private static Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
// Re-order lines 7-19 to solve the problem
System.out.print("A");
System.out.print("B");
System.out.print("C");
System.out.print("D");
System.out.print("F");
float examGrade;
if (examGrade >= 90) {
} else if (examGrade >= 60) {
} else if (examGrade >= 70) {
} else if (examGrade >= 80) {
examGrade = scanner.nextFloat();
} else {
}
// Re-order lines 7-19 to solve the problem
}
}
import java.util.Scanner;
public class Problem5 {
private static Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
// Re-order lines 7-21 to solve the problem
System.out.print(averageScore);
averageScore = sumOfScores / numberOfStudents;
currentStudent = 0;
currentStudent = currentStudent + 1;
currentStudentScore = scanner.nextFloat();
float averageScore;
float currentStudentScore;
float sumOfScores;
int currentStudent;
int numberOfStudents;
numberOfStudents = scanner.nextInt();
sumOfScores = 0;
sumOfScores = sumOfScores + currentStudentScore;
while (currentStudent < numberOfStudents) {
}
// Re-order lines 7-21 to solve the problem
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment