Suppose you are asked to write a program for the world\'s laziest grader. Rather
ID: 3630479 • Letter: S
Question
Suppose you are asked to write a program for the world's laziest grader. Rather than properly grading and averaging all of a student's exams to determine an overall latter grade, this grader wants a program that will randomly assign a letter grade based on whether or not the grader likes the student.
Your programs should prompt the grader to enter 1 if they like the student or 0 if they do not. If the grader likes the student, your program should randomly select either A, B, or C for the letter grade. If the grader does not like the student, your program should randomly select either D or F.
After you have received the input from the grader, you must make a method call to calculate the letter grade using the technique described above (you may not perform the calculations inside of the main method) and then print the returned letter grade. The method signature of the method called inside of main must be:
public static char calculateGrade( boolean likesStudent)
Explanation / Answer
import java.util.Scanner; public class LazyGrader { public static void main(String[] args){ String[] students = {"Beth", "Jordan", "Rudy", "George", "Frank", "Elizabeth", "Cody"}; Scanner keyboard = new Scanner(System.in); for (int n = 0; nRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.