Advertisement
Paste_King

cccc

Sep 19th, 2019
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.62 KB | None | 0 0
  1. When the user starts the programme, a menu comes up with options such as recording scores, viewing scores, recording weather, time and location, viewing weather, time and location. If the user wants to record scores, weather, time and location, he/she has to type “1” into the programme. If the user wants to view scores, he/she has to type “2”. If they want to view weather, time and location they have to type “3” into the computer.
  2. When the user chooses option “1”, the programme asks for each couple’s location and once the judge enters an answer, it records the answers on a notepad, which is saved onto the computer. The same thing happens with the time, temperature, wind intensity and sunlight. When the judge has entered all that information for one of the couples, they have to enter the score, which is saved on a separate notepad. The judges keep inputting the score until all the info for all the couples is entered and the judges are immediately taken to the main menu where they have to wait for the programme to calculate who goes to the next round. Once the scores are decided, the scores pop up for all the judges and all the info can be used again when the judges type “end”.
  3. Introduction
  4. A dancing competition called Dancers UK is organising a dance competition, which consists of many events across the UK, and each event involves six couples, five judges and three rounds. Each judge awards each couple a score out of ten in every round, and the highest and lowest score for each couple is discarded, so they can be used as tie breakers, while the rest of the marks are added together. The couples who remain in the competition will carry forward their scores to the next round. The two couples with the lowest scores are eliminated at the end of the first two rounds, so that only two couples are left to dance off in the final.
  5.  
  6. Sub-problems
  7. 1. Options for the judges: The programme must have an easy and user-friendly interface with many options which can easily be used and navigated by the judges to do as they wish, such as record scores, access scores, type weather information, etc.
  8. 2. Storage of scores: Judges need to be able to type scores somewhere in the program and this must be read, sorted and stored into a list, which the programme will be able to access, view and use.
  9. 3. Recording non-score information: The programme must be able to extract information from the judges such as location, time period, weather, wind speed, sunlight, temperature range and rain, and this must all be stored in a list
  10. 4. Working out an average: The programme must be able to work out a range and average for all the info, such as the score, weather info, location, etc.
  11. 5. Presenting scores: The scores for each pair of dancers must be displayed and shown to the user in the correct format when it the option for this in the menu is chose by the user.
  12. 6. Presenting weather, time and location: all info about the time, weather and location has to be displayed when the user requests to see them by clicking on the option for this in the menu
  13. 7. Working out the total score: The programme has to be able to use a formula to use the scores given by the judges, give an overall score to each pair of dancers and decide who has the highest score.
  14. 8. Tiebreaker: If two or more pairs have the same overall score, the programme must provide a tiebreaker to decide who is the winner, and another tie breaker so that if more than one couple still has the same score, one of them is eliminated.
  15. 9. Declaring who is the winner: When the winner is decided by the programme, a message must be sent to the user declaring who the winner is for the round.
  16.  
  17.  
  18.  
  19.  
  20.  
  21. scores1="0"
  22. scores1a= "0"
  23. scores2a= "0"
  24. scores3a= "0"
  25. scores4a= "0"
  26. scores5a= "0"
  27. scores6a= "0"
  28. scores2="0"
  29. scores3="0"
  30. scores4="0"
  31. scores5="0"
  32. scores6="0"
  33. couple1total = "0"
  34. couple2total = "0"
  35. couple3total = "0"
  36. couple4total = "0"
  37. couple5total = "0"
  38. couple6total = "0"
  39. coupleatotal= [float("0"),float("0")]
  40.  
  41.  
  42.  
  43.  
  44.  
  45. judges =float("0")
  46. compround =float("1")
  47. whado = input("what would you like to do? (Press 1 to record info, press 2 to view atmosphere info) ")
  48.  
  49. if whado == "1":
  50. while compround <4:
  51. if scores1 != False:
  52. while judges <5:
  53. scores1=input("What is the score for couple1? ")
  54. scores1a= [*scores1a,scores1]
  55. judges = judges+1
  56. judges =float("0")
  57. print("")
  58. if scores2 != False:
  59. while judges <5:
  60. scores2= input("What is the score for couple2? ")
  61. scores2a= [*scores2a,scores2]
  62. judges = judges+1
  63. judges =float("0")
  64. print("")
  65. if scores3 != False:
  66. while judges <5:
  67. scores3= input("What is the score for couple3? ")
  68. scores3a= [*scores3a,scores3]
  69. judges = judges+1
  70. judges =float("0")
  71. print("")
  72. if scores4 != False:
  73. while judges <5:
  74. scores4= input("What is the score for couple4? ")
  75. scores4a= [*scores4a,scores4]
  76. judges = judges+1
  77. judges =float("0")
  78. print("")
  79. if scores5!= False:
  80. while judges <5:
  81. scores5= input("What is the score for couple5? ")
  82. scores5a= [*scores5a,scores5]
  83. judges = judges+1
  84. judges =float("0")
  85. print("")
  86. if scores6 != False:
  87. while judges <5:
  88. scores6= input("What is the score for couple6? ")
  89. scores6a= [*scores6a,scores6]
  90. judges = judges+1
  91. judges =float("0")
  92. sorted(scores1a)
  93. sorted(scores2a)
  94. sorted(scores3a)
  95. sorted(scores4a)
  96. sorted(scores5a)
  97. sorted(scores6a)
  98. print (scores1a)
  99. print (scores2a)
  100. print (scores3a)
  101. print (scores4a)
  102. print (scores5a)
  103. print (scores6a)
  104. if scores1 != False:
  105. couple1total = float(couple1total)+float(scores1a[2])+float(scores1a[3])+float(scores1a[4])
  106. coupleatotal=[coupleatotal],[couple1total,"A"]
  107. if scores2 != False:
  108. couple2total = float(couple2total)+float(scores2a[3])+float(scores2a[4])+float(scores1a[4])
  109. coupleatotal=[coupleatotal],[couple2total,"B"]
  110. if scores3 != False:
  111. couple3total = float(couple3total)+float(scores3a[3])+float(scores3a[4])+float(scores1a[4])
  112. coupleatotal=[coupleatotal],[couple3total,"C"]
  113. if scores4 != False:
  114. couple4total = float(couple4total)+float(scores4a[3])+float(scores4a[4])+float(scores1a[4])
  115. coupleatotal=[coupleatotal],[couple4total,"D"]
  116. if scores5 != False:
  117. couple5total = float(couple5total)+float(scores5a[3])+float(scores5a[4])+float(scores1a[4])
  118. coupleatotal=[coupleatotal],[couple5total,"E"]
  119. if scores6 != False:
  120. couple6total = float(couple6total)+float(scores6a[3])+float(scores6a[4])+float(scores1a[4])
  121. coupleatotal=[coupleatotal],[couple6total,"F"]
  122. print (coupleatotal)
  123. #coupleatotal = [[couple1total,"A"],[couple2total,"B"],[couple3total,"C"],[couple4total,"D"],[couple5total,"E"],[couple6total,"F"]]
  124. coupleatotal.sort()
  125. print (coupleatotal)
  126. if coupleatotal[0][1] == ("A") or (coupleatotal[1][1]) == ("A") or scores1 == False:
  127. print("Couple A is out")
  128. scores1 = 0
  129. #couple1total =False
  130. scores1 = False
  131. if coupleatotal[1][1] == ("B") or (coupleatotal[1][1]) == ("B") or scores2 == False:
  132. print("Couple B is out")
  133. scores2 = 0
  134. #couple2total =False
  135. scores2 = False
  136. if coupleatotal[1][1] == ("C") or (coupleatotal[1][1]) == ("C") or scores3 == False:
  137. print("Couple C is out")
  138. scores3 = False
  139. #couple3total =False
  140. scores3 = "0"
  141. if coupleatotal[1][1] == ("D") or (coupleatotal[1][1]) == ("D") or scores4 == False:
  142. print("Couple D is out")
  143. scores4 = 0
  144. #couple4total =False
  145. scores4 = False
  146. if coupleatotal[1][1] == ("E") or (coupleatotal[1][1]) == ("E") or scores5 == False:
  147. print("Couple E is out")
  148. scores5 = 0
  149. #couple5total =False
  150. scores5 = False
  151. if coupleatotal[1][1] == ("F") or (coupleatotal[1][1]) == ("F") or scores6 == False:
  152. print("Couple F is out")
  153. #couple6total =False
  154. scores6 = 0
  155. scores6 = False
  156. scores1a= "0"
  157. scores2a= "0"
  158. scores3a= "0"
  159. scores4a= "0"
  160. scores5a= "0"
  161. scores6a= "0"
  162. compround = compround+1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement