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.

I need help with this Java program, please help! 1. You should

Enter the course code CCC Enter the course number 234 Enter credits 4 The course code and number is null234 The credits are 4.0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!