Question: Write two Java programs for the following algorithms: Algorithm 1: (name your program Algo1) -Step 1: Declare a double variable named distance, -Step 2: initialize

 Write two Java programs for the following algorithms: Algorithm 1: (name

Write two Java programs for the following algorithms: Algorithm 1: (name your program Algo1) -Step 1: Declare a double variable named distance, -Step 2: initialize distance to 16.5 -Step 3: print distance out on the console.The output should look like this: The distance is 16.5 km Algorithm 2: (name your program Algo2) -Step 1: Declare two int variables named x and y and initialize them to 5 and 6 -Step 2: Declare an int variable named sum and initialize it to the sum of x and y -Step 3: print sum on the console. The output should look like The sum of 5 and 6 is 11

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!