Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.'
image text in transcribed

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

Question

How do you create a Document object for a new Word document?

Answered: 1 week ago