Question

Coral 5.1. Write a program whose inputs are three integers, and whose output is the largest...

Coral 5.1. Write a program whose inputs are three integers, and whose output is the largest of the three values. Ex: If the input is 7 15 3, the output is: 15 Please provide the answer in Coral with proper line spacing/format.

2 0
Add a comment Improve this question Transcribed image text
✔ Recommended Answer
Answer #1

CODE

integer x // declare a variable x of type integer
integer y // declare a variable y of type integer

integer z // declare a variable x of type integer

x = Get next input // input the value from user and is assigned to x
y = Get next input // input the value from the user and is assigned to y
z = Get next input // input the value from the user and is assigned to z

if x>y and x>z // if x is greater than y and z
Put x to output // print the value of x i.e., x is largest
elseif y>x and y>z // else if y is greater than x and z
Put y to output // print the value of y i.e., y is largest
else
Put z to output // else z is largest so print the value of z

SCREENSHOT OF THE SOURCE CODE:

1 2 integer x integer y integer z x= Get next input y= Get next input z= Get next input 9 if x>y and xz 10 Put x to output 11

OUTPUT:

Variables 15 3 x integer y integer z integer Input 7 153 Output 15-

Note: Coral uses 3 spaces indentation

Add a comment
Know the answer?
Add Answer to:
Coral 5.1. Write a program whose inputs are three integers, and whose output is the largest...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • 4.12 LAB: Smallest number Write a program whose inputs are three integers, and whose output is...

    4.12 LAB: Smallest number Write a program whose inputs are three integers, and whose output is the smallest of the three values. Ex: If the input is: 7 15 3 the output is: 3 I have to write this in python, having a hard time deciding how to approach this. Thank you!

  • Write a program whose inputs are three integers, and whose output is the smallest of the three values.

    # Python Write a program whose inputs are three integers, and whose output is the smallest of the three values. a.) Write out the steps of a computational thinking process b.) Write out the Pseudocode c.) Write out the Python code

  • Write a program whose input is two integers and whose output is the two integers swapped....

    Write a program whose input is two integers and whose output is the two integers swapped. Write in C language 7.3 LAB: Swapping variables Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 38 then the output is: 83 Your program must define and call a function. SwapValues returns the two values in swapped order. void SwapValues(int* userVali, int* userVal2) ACRIVITY 7.3.1: LAB: Swapping variables 0/10 ] main.c...

  • Write a program whose input is two integers, and whose output is the first integer

    5.20 (Ch 5) HW: Output range with increment of 10 Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer Ex: If the input is: -15 30 Then the output is: 15 -5 5 15 25 Ex: If the second integer is less than the first as in 20 5, the output is: Second integer can't be less than the...

  • Coral Language Please to thanks Write a program that first gets a list of 5 integers...

    Coral Language Please to thanks Write a program that first gets a list of 5 integers from input. Then, get another value from the input, and output all integers less than or equal to that value. Ex: If the input is 50 60 140 200 75 100, the output is: 50 60 75 For coding simplicity, follow every output value by a space, including the last one. Then, output a newline. Such functionality is common on sites like Amazon, where...

  • Write MARIE assembly language programs that do the following: I. Write a program that inputs thre...

    Write MARIE assembly language programs that do the following: I. Write a program that inputs three integers, a, b, and c, in that order. It computes the following ia-bi-fc+ c The result should be written to output 2. Write a program that inputs integers, s. y, and z. It outputs the difference of the langest and first element entered. You may assume x. y, and z all have different values. So if 8, 12, and 9 are input, the output...

  • ****Coral Please**** Given a sorted list of integers, output the middle integer. Assume the number of...

    ****Coral Please**** Given a sorted list of integers, output the middle integer. Assume the number of integers is always odd. Ex: If the input is 2 3 4 8 11 -1 (a negative indicates end), the output is: 4 The maximum number of inputs for any test case should not exceed 9. If exceeded, output "Too many inputs". Hint: Use an array of size 9. First read the data into an array. Then, based on the number of items, find...

  • *Coral Language* Write a program that first gets a list of six integers from input. The first five values are the intege...

    *Coral Language* Write a program that first gets a list of six integers from input. The first five values are the integer list. The last value is the upper threshold. Then output all integers less than or equal to the threshold value. Ex: If the input is 50 60 140 200 75 100, the output is: 50 60 75 For coding simplicity, follow every output value by a space, including the last one. Such functionality is common on sites like...

  • Write a program that inputs ten (10) integers and then sorts them in order from largest...

    Write a program that inputs ten (10) integers and then sorts them in order from largest to smallest in the programming language called Perl. You do not need to error check the input; you can assume the user enters integers. You can select the sorting algorithm of your choice, but you must implement this algorithm yourself. You cannot use a built-in sorting function. [15 points] Below is an example of a sample program run: Unsorted: 10, 4, 23, 99, 7,...

  • 3.16 LAB: Output range with increment of 10 Write a program whose input is two integers,...

    3.16 LAB: Output range with increment of 10 Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer. Ex: If the input is: -15 30 the output is: -15 -5 5 15 25 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can't be less than...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT