diff --git a/small-computational-problems/Problem3.java b/small-computational-problems/Problem3.java new file mode 100644 index 0000000000000000000000000000000000000000..5487bac127b68ca13da413ccebaa599b8432b003 --- /dev/null +++ b/small-computational-problems/Problem3.java @@ -0,0 +1,14 @@ +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); + } +} diff --git a/small-computational-problems/Problem4.java b/small-computational-problems/Problem4.java new file mode 100644 index 0000000000000000000000000000000000000000..e0084ba28dbdd0ab5e7b3ffd135f79a27f757825 --- /dev/null +++ b/small-computational-problems/Problem4.java @@ -0,0 +1,22 @@ +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 + } +} diff --git a/small-computational-problems/Problem5.java b/small-computational-problems/Problem5.java new file mode 100644 index 0000000000000000000000000000000000000000..3438c4765800bb360b9738e0c509ce12853f709c --- /dev/null +++ b/small-computational-problems/Problem5.java @@ -0,0 +1,24 @@ +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 + } +}