Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PartA.java darr # PartB.java darr Course Concept ( s ) Covered 5 Primitive Data Types Object References Arithmetic Operators Using Objects Instructions Create a new

PartA.java darr #
PartB.java darr
Course Concept(s) Covered
5
Primitive Data Types
Object References
Arithmetic Operators
Using Objects
Instructions
Create a new project in jdoodle called DataAndOperators2 and upload the three supporting files into it. Once you have completed the lab, download the project, rename the .zip file as W3_DataAndOperators_2 and upload in Canvas.
Part A
You will need the code from PartA.java to complete this part of the lab. Make PartA as the Start File to run it.
Answer the following questions before compiling and running the code:
What should the output be if 2 is entered as the radius (use the calculator to determine this)?
Can you identify the need for the following statement:
import java.lang.Math.;;
Execute the code.
Was the output what you expected? Is the output correct?
This program is producing incorrect output because of a problem associated with types. Can you identify and fix the problem so that the output is correct?
After fixing the code, compile and execute it so you know it is running correctly.
Part B
You will need the code from PartB.java to complete this part of the lab. Make PartB as the Start File to run it.
Without running the code, can you determine what the output will be if you enter 2 for b1 and 3 for b2? What if you enter 100 for b1 and 2 for b2(more super bonus points if you answer this correctly)?
Execute the code to see if your answers were correct. If not, can you identify why not?
Can you fix the code so that it produces the value 200 when you enter 100 and 2?
image text in transcribed

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

Students also viewed these Databases questions

Question

What are Mergers ?

Answered: 1 week ago