Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Now, create a new public class. Add both the methods from 6.1 and 6.2 into this file. Write the main method which calls getUserChoice and
Now, create a new public class. Add both the methods from 6.1 and 6.2 into this file. Write the main method which calls getUserChoice and then also calls getTwoFloats one after another.
Note: Create the scanner and float array in main method, and pass scanner to getUserChoice, and pass same scanner and the array to getTwoFloats. After the getTwoFloats is called the array will have two floats and can be used to display the data like this:
Welcome to sorting program
1. Title
2. Rank
3. Date
4. Stars
5. Like
Enter your choice between 1 and 5 only: ;f af afa
You have entered an invalid choice. Try again.
Enter your choice between 1 and 5 only: 4
You entered valid choice 4
Thank you for giving your choice
Welcome to bonus get two floats program
Enter two floats separated by a space: as fas fas fa You have entered an invalid input. Try again.
Enter two floats separated by a space: 12 2
You entered 12.00 and 2.00 successfully!
Press enter key to continue ...
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