Question
I need help with this Java program, please help! 1. You should divide the entries into different methods to prepare for your Junit tests. 2.
I need help with this Java program, please help!
1. You should divide the entries into different methods to prepare for your Junit tests.
2. All methods should have parameters and return value.
3. You should use the try and catch in a while loop to ensure that the user enters only 3 letters for course code. The exception should have a message when the user violates this requirement.
4. You should use the try and catch in a while loop to ensure that the user enters the valid data for course number. Course number is an integer. The exception should have a message when the user violates this requirement.
5. The possible credits should be saved in an array with the following values: credits = {3, 4, 7.5, 0, 100, 2.5}.
6. You should have a try and catch method that ensure only numbers from the array are accepted. The exception should have a message when the user violates this requirement.
7. Create 3 Junit tests, one test to test if the user inputted a 3 letter string, a Junit test if the user inputs a numeric value for course number and a Junit test if the user selects a valid input from the array.
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