Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java only please ****************************************PROVIDED CODE****************************************** // Lab 12 - Working with Wrapper classes public class Lab12 { public static void main( String[] args ) {
Java only please
****************************************PROVIDED CODE******************************************
// Lab 12 - Working with Wrapper classes public class Lab12 { public static void main( String[] args ) { String firstInteger = "364"; String secondInteger = "651"; String firstDouble = "1436.83"; String secondDouble = "187.74"; // Output the results of firstInteger + secondInteger. System.out.printf( "The sum of firstInteger plus secondInteger is: %d%n", .......... ); // Output the results of secondInteger - firstInteger. System.out.printf( "The difference of secondInteger less firstInteger is: %d%n", .......... ); // Output the results of firstInteger / secondInteger. NOTE: the output MUST include the DECIMAL PORTION of the result. System.out.printf( "The result of dividing firstInteger by secondInteger is: %g%n%n", .......... ); // Output the results of firstDouble + secondDouble. System.out.printf( "The sum of firstDouble plus secondDouble is: %f%n", .......... ); // Output the results of firstDouble - secondDouble. System.out.printf( "The difference of firstDouble less secondDouble is: %f%n", .......... ); // Output the results of firstDouble / secondDouble. NOTE: the output MUST include the DECIMAL PORTION of the result. System.out.printf( "The result of dividing firstDouble by secondDouble is: %f%n", .......... ); } }Purpose Working with Wrapper classes General Information In this lab assignment, you need to use methods of at least two API wrapper classes to complete the code Provided Resources 1. 2. 3. Lab 12 Instructions, including requirements The code shell (Lab12.java) Sample output Requirements Complete the printf statements to provide the required output. Do not changes any provided variable declarations. Do not add any variable declarations to the code Use API wrapper class methods to complete the printf statements In one case, you will need to cast a result into the proper type in order for the printf statement to process correctly Grading If your program compiles clearly and functions exactly as required, your grade will be 100%. Otherwise, it will be 0% Expected Output Following is a sample of expected output when you run Lab12.java The sum of firstInteger plus secondInteger is: 1015 The difference of secondInteger less firstInteger is: 287 The result of dividing firstInteger by secondInteger is: 0.559140 The sum of firstDouble plus secondDouble is: 1624.570000 The difference of firstDouble less secondDouble is: 1249.090000 The result of dividing firstDouble by secondDouble is: 7.653297
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