Question: 5. In this problem, we are going to compare some values. We will examine the difference between comparing integers, doubles, and words Create a class

 5. In this problem, we are going to compare some values.

5. In this problem, we are going to compare some values. We will examine the difference between comparing integers, doubles, and words Create a class named Comparison Do no create instance variables Do not create a constructor Write a method called compFloat2 which accepts as input two doubles as an argument (parameter). Write the appropriate code to test the two numbers up to two decimal points to see if they are close enough. If they are close enough return true else return false. This would be a Boolean value Write a method called compFloat5 which accepts as input two doubles as an argument (parameter). Write the appropriate code to test the two numbers up to five decimal points to see if they are close enough. If they are close enough return true else return false. This would be a Boolean value Write a method called complnt which accepts as input two integers as an argument (parameter) Write the appropriate code to test the two integers to see if they are equal. If they are equal return true else return false. This would be a Boolean value a. b. c. d. e. f. g. Write a method called stringEaual program that reads in two sentences as an argument (parameter). Write the appropriate code to test the two strings to see if they are the equal. If they are equal return true else return false. This would be a Boolean value h. Write a method called strioeCampare program that reads in two sentences as an argument (parameter). Write the appropriate code to test the two strings to see if string 1 is greater than string 2. If they are return true else return false. This would be a Boolean value Now for the tester class: i. Create a ComparisanTester class j. Import Scanner k. Create a Scanner object I. Prompt the user to enter two doubles. You will need two variables to receive the input m. Create a Comparison object n. Create a Boolean variable named areTbeEua Boolean areTbeyEaual: o. Call compFloat2 and assign it to ateTbexEaual, p. Print The two doubles are equal up to two decimal points: areTbevEaual q. Call compFloat5 and assign it to ateTbexEaual. r. Print The two doubles are equal up to five decimal points: areTbeyEaual s. Prompt the user to enter two integers. You wl need two variables to receive the input t. Call complnt and assign the result to areTbexEgual u. Print using the same type of format as above V. Prompt the user to enter two Strings. You will need two variables to receive the input. These should be allowed to have spaces and therefore you need to use nextline). If you use that you will have an issue sa do it this way. S1-innextlinel): innextiine); s2 -inDextline) w. Call stringEaual and assign the result to areTbeyEaua x. Print using the same type of format as above y. Call stringCampare and assign the result to aebevEaua z. Print using the same type of format as above

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!