Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed****************************************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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

Students also viewed these Databases questions

Question

=+e) What is the marginal distribution of the campus constituents?

Answered: 1 week ago

Question

1. What is meant by Latitudes? 2. What is cartography ?

Answered: 1 week ago

Question

What is order of reaction? Explain with example?

Answered: 1 week ago

Question

3. What information do participants need?

Answered: 1 week ago