Question: Problem 1 . (Average GPA) Write an ST client called AvgGPA that creates a symbol table mapping letter grades to numerical scores, as in the
Problem 1. (Average GPA) Write an ST client called AvgGPA that creates a symbol table mapping letter grades to numerical scores, as in the table below, then reads from standard input a list of letter grades and computes and prints the average GPA (the average of the numbers corresponding to the grades).
$ java AvgGPA B A - A A - B A - A - B A+ B A + A - B - B B+ B+ A C A + F
import edu.princeton.cs.algs4.StdIn; import edu.princeton.cs.algs4.StdOut; import edu.princeton.cs.algs4.ST;
public class AvgGPA { public static void main(String[] args) { ... }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
