Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A program is given to you below. Go through each line and describe what it does by writing notes in the margins. Add necessary data

image text in transcribed
image text in transcribed
A program is given to you below. Go through each line and describe what it does by writing notes in the margins. Add necessary data type casting to the lines (The program below does not compile otherwise). Next, fill the table in page #2, with the answer to the corresponding inline comment question as well as the corresponding inputs for dx and dy. import java.util.Scanner; 12 13 public class BasicCalculator { public static void main(String[] args) { Scanner input = new Scanner (System.in); // Variable Declaration int y, x, Z, 22; double dy, dx, dz; float f- 7.12f; System.out.print("Enter a Double Number: "); //Take user input and store it in dy dy = input.nextDouble(); //Prompt the user for another number 14 System.out.print("Enter another Double Number: "); 15 dx = input.nextDouble(); 16 ; // What do you think will happen now? x = dx; // 18 System.out.println(y + ", " + dy); // What is the output in Line #28? System.out.println(x + " " + dx); //What is the output in Line #20? dz = dx + dy; z = dx + dy, f = z; 22 = x + y; System.out.println (z+" " +22+ - + f); 27 // What is the output in Line #26? 28 //Are they the same? If different, explain why are they different? (Write your answer in the Table below for Line #28.) 29 System.out.println(x / y + "," + dx / dyli answer in the Table below for line 128.) 29 System.out.println(x / Y + "," + dx / dy); 30 /What is the output in Line #29? 31 System.out.println( x y + " , " + (int) dx % (int)dy); 32 /What is the output in Line #312 Line #18 Line #20 Line #26 Line 1.2 9.12 3.456 3.56 7.12345678 0.12345678 -3.456 -3.456 -0.0001 -0.1 0.00001

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

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions

Question

Let 0

Answered: 1 week ago

Question

Be familiar with the integrative servicescape model.

Answered: 1 week ago

Question

Determine the roles of spatial layout and functionality.

Answered: 1 week ago