Question: 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?
 PartA.java darr # PartB.java darr Course Concept(s) Covered 5 Primitive Data

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!