Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions