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

Migrated from Coral Simulator to Java Visualizer

parent 83a7723d
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
}
}
float payRate
float hoursWorked
float grossEarnings
payRate = Get next input
hoursWorked = Get next input
grossEarnings = hoursWorked * payRate
Put grossEarnings to output
Put "A" to output
Put "B" to output
Put "C" to output
Put "D" to output
Put "F" to output
float examGrade
if examGrade >= 90
elseif examGrade >= 60
elseif examGrade >= 70
elseif examGrade >= 80
examGrade = Get next input
else
Put averageScore to output
averageScore = sumOfScores / numberOfStudents
currentStudent = 0
currentStudent = currentStudent + 1
currentStudentScore = Get next input
float averageScore
float currentStudentScore
float sumOfScores
integer currentStudent
integer numberOfStudents
numberOfStudents = Get next input
sumOfScores = 0
sumOfScores = sumOfScores + currentStudentScore
while currentStudent < numberOfStudents
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment