Question: Write an algorithm that uses a loop ( 1 ) to input 1 0 pairs of numbers, where each pair represents the score of a

Write an algorithm that uses a loop
(1) to input 10 pairs of numbers, where each pair represents the score of a football
game with the Computer State University (CSU) score listed first, and
(2) for each pair of numbers, to determine whether CSU won or lost.
After reading in these 10 pairs of values, print the won/lost/tie record of CSU. In
addition, if this record is a perfect 10-0, then print the message 'Congratulations on
your undefeated season'.
Step 1: Set the value of i to 1
Step 2: Set the values of Won, Lost, and Tied all to 0
Step 3: While i1C
Step 4: , Get the value of CSUi and OPPi
Step 5: ,CSUi>OPPi then
Step 6: , Set the value of Won to Won +1
Step 7: ,,t+1ii+=10,,fCSUi then
Step 8: , Set the value of Lost to Lost +1
Step 9: Else
Step 10: , Set the value of Tied t
+1
Step 11: Set the value ofitoi+
End of the While loop
Step 12: Print the values of Won, Lost, and Tied
Step 13: If Won =10, then
Step 14: , Print the message, 'Congratulations on your undefeated season.'
 Write an algorithm that uses a loop (1) to input 10

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!