Question: Java Question: Part 1: Manipulating Numbers You need to understand Type Casting (cf. Section 212] before you do this overcise Create a new class called
![Casting (cf. Section 212] before you do this overcise Create a new](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3a34df1c31_08566f3a34d906f7.jpg)

Part 1: Manipulating Numbers You need to understand Type Casting (cf. Section 212] before you do this overcise Create a new class called Manipulate with the following behaviot. Ask the user for two int numbers ni and n2 from the user just like Averages.java and display the following 5 results using the two numbers (assuming til = 1 and 2 e 3 Sum of 4 and 3 is 7 Difference of 4 and 3 is 1 Product of 4 and 3 is 12 Integer cast of (4/5) is 1 Integer cast of (4*)) is 1 He state that the tesult is an int by casting it before printing itu. Now repeat the same operations for two short, two float and two double numbers. More precisely, ask the user for three additional types of number pains from the . Two short numbers Two float numbers Two double numbers For each pair of inputs, perform all 5 math operations where the results should match the input type, te, addition of two short numbers should result in a short and so on. For each operation, print out the results like you did for the int numbers. Make sure peut pas for each spot There should be a total of 20 (4 data types, cach with 5 operations ousputines as shown in the sample uput below Sample Run (user input shown in greens Input two Integer Sum of 4 and is Difference of 4 and 3 is 1 Product of 4 and 3 is 12 Integer cast of (4 / 3) is 1 Integer cast of (4 X 3) is 3 Input two shorts (-32,768 to 32,767) 12 15 Sum of 12 and 15 is 27 Difference of 12 and 15 is - 3 Product of 12 and 15 is 180 Short cast of (12/15) is e Short cast of (12 * 15) is 12 Input two floating points: Sum of 1.4 and 2.35 is 3.75 Difference of 1.4 and 2.35 is - 0.9999999 Product of 1.4 and 2.35 is 3.2899997 Float cast of (1.4 / 2.35) is 8.59574467 Float cast of (1.4 X 2.35) is 1.4 Input two doubles: 14.750 12.40 Sum of 14.756 and 12.44) is 27.198999999999998 Difference of 14.756 and 12.443 2.313001 Product of 14.756 and 12.443 is 183.689e799999999 Double cast of (14.756 / 12.463) is 1.185887647673796 Double cast of (14.756 * 12.443) is 2.313006 Part 2: (Assessment) Level of Understanding Create a Word document or text file named Part2 that contains answers to the following: 1. Give the expression for printing OUTPUT is Vusing the variable char charA - A; by using type casting and manipulating it (as shown in the examples in Type Casting). 2. Are there certain numbers that do not work as input of Manipulate? 3. Are there any output differences between float and double numbers in Manipulate? 4. Can the result of some operation on two large integers be converted into a short without losing information? If so, what would be such an operation? Part 3: Interviewer Program Modify the Interviewer from Lab 03 with the following requirements: Answers must be able to handle sentences or numbers. Add a question about height in inches (float type). 1 in = 2.54 cm. Output the user's height in centimeters (float type). Ask all the questions first before the results are printed out. Output is all in one paragraph like a biography of the interviewee. Sample Run (user input shown in blue): What is your name? Alice Williams What is your favorite number? 17 What are your hobbies? hike and travel Do you live on or off campus? off campus What is your favorite color? blue What is your height in inches? 64.5 So your name is Alice Williams. Your favorite number is 17. You like to hike and travel. You live off campus. Your favorite color is blue. Your height in centimeters is 163.83 cm
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
