CS173: Intro to Computer Science - Introduction to Conditionals (3 Points)

Developed by Professor Tralie and Professor Mongan.

Exercise Goals

The goals of this exercise are:
  1. To use compound conditionals
Modify the GradePrinter.java file to print the letter grade earned for a given final grade using an if statement, using our syllabus letter grade table.

Enter your Ursinus netid before clicking run. This is not your ID number or your email. For example, my netid is wmongan (non Ursinus students can simply enter their name to get this to run, but they won't get an e-mail record or any form of credit)

Netid
Clicking Run below will check your work and, if it passes, will submit your work automatically. You must be connected to the VPN for submission to be successful! You will receive a copy of your code via e-mail, so you'll know that it was submitted if you receive that e-mail! VPN access requires Multi-Factor Authentication, which sends you a code when you log into the network. Instructions on configuring these for your account can be found here.

GradePrinter.java

public class GradePrinter { public static void printGrade(double grade) { /* TODO: fill this in by printing the letter grade For example, if the grade is 92, you should: System.out.println("A-"); You can assume that the grade variable contains the number grade you're checking. */ } }

Driver.java

public class Driver { public static void main(String[] args) { GradePrinter.printGrade(89.75); GradePrinter.printGrade(96.9); GradePrinter.printGrade(82.99); } }
Driver.main(null);

Output