Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For questions 3 - 6: Consider the following algorithm to determine which of 3 input values is the largest: Step Operation 1 Get 3 integers

For questions 3 - 6: Consider the following algorithm to determine which of 3 input values is the largest:

Step Operation 1 Get 3 integers from the user, call them x, y and z 2 if (x > y) and (x > z). then output the value of x as the largest number and STOP 3 if (y > x) and (y > z). then output the value of y as the largest number and STOP 4 if (z > x) and (z > y). then output the value of z as the largest number and STOP 5 Stop 3-5 (1 point each) 3) Walk through the algorithm for the input values x = 2, y = 3 and z = 5. What is the output? 4) Walk through the algorithm for the input values x = 5, y = 3 and z = 3. What is the output? 5) Walk through the algorithm for the input values x = 3, y = 5 and z = 5. What is the output? 6) (2 points) Fix the algorithm so that it correctly outputs the largest value for all cases.

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