Question: Given the following script, answer questions that follow: echo Please enter 1st integer: read n1 echo Please read 2ndinteger: read n2 echo Please

Given the following script, answer questions that follow:

echo "Please enter 1st integer: "

read n1

echo "Please read 2ndinteger: "

read n2

echo "Please read the 3rd integers: "

read n3

# Finding the MIDDLE number among the 3 numbers

##### Q2: CODE WILL BE HERE

The Questions:

1. How to show the messages and read the numbers in the same line? Write any of the reading echo commands to read the variable in the same line with the echo output (2 pts)

2. Write the missing code to find the Middle number among the three read numbers. For example, middle of 20, 10, 50 is 20. Middle of 12, 10, 20 is 12 (5 Pts)

3. Is it possible to make the read numbers read only variables? Explain your answer with explaining what is read only variables (3 pts)

4. Define the variable avg that will store the average of the three read numbers and initialize it to any value you like (2 Marks)

5. Can I calculate the average of the three read numbers? If yes write the command. If no, explain why (3 Marks)

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 Programming Questions!