Question: Java Code for the following: Create a program that will allow a user to enter each persons favorite color, favorite number (between1 and 10, inclusive),

Java Code for the following:

Create a program that will allow a user to enter each persons favorite color, favorite number (between1 and 10, inclusive), and current number of friends.

After all values are entered, if no invalid values are entered, a compatibility rating will be calculated as follows:

The compatibility rating starts at 0

Two people with a matching favorite number adds 2 to the compatibility rating

Two people with a matching favorite color adds 5 to the compatibility rating

For each person, having less than 10 current friends adds 4 to the compatibility rating, while

having 10 or more current friends adds 1 to the compatibility rating

Once the compatibility rating is calculated, print a well-formatted message that includes the information collected for each person, the compatibility rating, and the level of compatibility. The level of compatibility is determined as follows:

For a compatibility rating of 7 or more, the level of compatibility is VERY COMPATIBLE

For a compatibility rating of 3 or less, the level of compatibility is NOT AT ALL

In all other cases, the level of compatibility is POSSIBLY COMPATIBLE

However, if after all values are entered there is at least one invalid value entered, the program should display an error message to contact the IT department and then end.

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 Databases Questions!