Question
need help with this app in java Write a Java program that reads in a student username (e.g. mpaulding) and a course in which they
need help with this app in java
Write a Java program that reads in a student username (e.g. mpaulding) and a course in which they would like to enroll (e.g. CS170). Use a HashMap to store the username and an ArrayList of all the courses (Strings) for which that student has enrolled. Specifically, we will create a HashMap with the following definition:
HashMap
In a loop, prompt the user to enter their username and the course they want to enroll in. The loop will continue as long as the user does not input the word "quit".
After the loop completes, display a listing of each student's username and the courses in which they are enrolled, followed by statistics about enrollment, including the total number of students, total number of courses enrolled and the student with the most number of courses.
For example, a sample transaction with the user might be:
~~~~~~~~~~~~~~~~~Welcome to MyOCC ~~~~~~~~~~~~~~~~~
Please enter student username (or "quit" to exit): mpaulding Please enter course to enroll in: CS A170
Please enter student username (or "quit" to exit): mpaulding Please enter course to enroll in: CS A150
Please enter student username (or "quit" to exit): mpaulding Please enter course to enroll in: SPAN A180
Please enter student username (or "quit" to exit): dkeaton123 Please enter course to enroll in: THEA A105
Please enter student username (or "quit" to exit): dkeaton123 Please enter course to enroll in: THEA A107
Please enter student username (or "quit" to exit): sseagal77 Please enter course to enroll in: THEA A103
Please enter student username (or "quit" to exit): sseagal77 Please enter course to enroll in: THEA A104
Please enter student username (or "quit" to exit): quit
~~~~~~~~~~~~~~~Spring 2017 Enrollment~~~~~~~~~~~~~~~
Student: mpaulding Courses: CS A170, CS A150, SPAN A180
Student: dkeaton123 Courses: THEA A105, THEA A107
Student: sseagal77 Courses: THEA A103, THEA A104
Total students enrolled: 3 Total courses enrolled: 7 Student with most courses: mpaulding
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started