Question: Given a HashMap pre - filled with student names as keys and grades as values, complete main ( ) by reading in the name of
Given a HashMap prefilled with student names as keys and grades as values, complete main by reading in the name of a student, outputting their original grade, and then reading in and outputting their new grade.
Ex: If the input is:
Quincy Wraight
import java.util.Scanner;
import java.util.HashMap;
public class StudentGrades
public static void main String args
Scanner scnr new ScannerSystemin;
String studentName;
double studentGrade;
HashMap studentGrades new HashMap;
Students's grades preentered
studentGrades.putHarry Rawlins", ;
studentGrades.putStephanie Kong", ;
studentGrades.putShailen Tennyson", ;
studentGrades.putQuincy Wraight", ;
studentGrades.putJanine Antinori", ;
TODO: Read in new grade for a student, output initial
grade, replace with new grade in HashMap,
output new grade
get the correct code
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
