212k views
3 votes
Examine the following algorithm.

1. Get the student name.
2. Get the degree program name.
3. Subtract the number of credits taken so far from the required credits for the degree.
4. Get the number of credits required for the degree program.
5. Get the number of credits the student has taken so far.
6. Display the input information in Step 1 and 2.
7. Display the calculated information.
A. What logic error do you spot and how would you fix it?
B. What steps require user interaction (Ex: user must type in some input)?

User TheKolaNN
by
5.1k points

1 Answer

3 votes

Answer:

See the explanation please

Step-by-step explanation:

A.

The algorithm tries to subtract the number of credits taken so far and the required credits for the degree before getting the number of credits required for the degree program and the number of credits the student has taken so far. Since the values are not known, calculation cannot be done.

Write the step 3 after step 5

B.

Step 1, 2, 4, 5 require user interaction, since it is asking the user to enter values

User Xiepan
by
5.2k points