Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.48 KB | None | 0 0
  1. CowIDs <- []
  2. MilkYield <- []
  3. loopone <- True
  4. looptwo <- True
  5. loopthree <- True
  6. D1S1 <- []
  7. D1S2 <- []
  8. D2S1 <- []
  9. D2S2 <- []
  10. D3S1 <- []
  11. D3S2 <- []
  12. D4S1 <- []
  13. D4S2 <- []
  14. D5S1 <- []
  15. D5S2 <- []
  16. D6S1 <- []
  17. D6S2 <- []
  18. D7S1 <- []
  19. D7S2 <- []
  20. i= 0
  21. #Task 1
  22. NumOfCows <- int(input("How many cows are in your herd"))
  23. for i in range(NumOfCows): # This loop will repeat for the number of cows in the herd
  24. while loopone = True:
  25. CowID <- input("Please enter Cow identification code")
  26. ENDIF
  27. try:
  28. val <- int(CowID) # Checks IF Userinput is a Integer
  29. ENDIF
  30. except ValueError:
  31. OUTPUT "That's not a valid identification code!"
  32. ENDIF
  33. loopone <- True # Restarts Loop instead of quitting program
  34. IF len(CowID) = 3: # Checks IF ID is 3 digits long
  35. for b in range(len(CowIDs)):
  36. IF CowID = CowIDs[b]:
  37. OUTPUT "this has been entered before"
  38. ENDFOR
  39. loopone <- True
  40. ENDIF
  41. ENDIF
  42. ENDFOR
  43. CowIDs.insert(i, CowID)
  44. for c in range(NumOfCows):
  45. CowYield <- input("Please enter the yield for cow:"+ CowID)
  46. ENDFOR
  47. D1S1.insert(c, CowYield)
  48. ENDFOR
  49. del CowIDs
  50. ENDWHILE
  51. ENDFOR
  52. for i in range(NumOfCows): # This loop will repeat for the number of cows in the herd
  53. while loopone = True:
  54. CowID <- input("Please enter Cow identification code")
  55. ENDIF
  56. try:
  57. val <- int(CowID) # Checks IF Userinput is a Integer
  58. ENDIF
  59. except ValueError:
  60. OUTPUT "That's not a valid identification code!"
  61. ENDIF
  62. loopone <- True # Restarts Loop instead of quitting program
  63. IF len(CowID) = 3: # Checks IF ID is 3 digits long
  64. for b in range(len(CowIDs)):
  65. IF CowID = CowIDs[b]:
  66. OUTPUT "this has been entered before"
  67. ENDFOR
  68. loopone <- True
  69. ENDIF
  70. ENDIF
  71. ENDFOR
  72. CowIDs.insert(i, CowID)
  73. for c in range(NumOfCows):
  74. CowYield <- input("Please enter the yield for cow:"+ CowID)
  75. ENDFOR
  76. D1S2.insert(c, CowYield)
  77. ENDFOR
  78. OUTPUT "End of day one"
  79. del CowIDs
  80. ENDWHILE
  81. ENDFOR
  82. for i in range(NumOfCows): # This loop will repeat for the number of cows in the herd
  83. while loopone = True:
  84. CowID <- input("Please enter Cow identification code")
  85. ENDIF
  86. try:
  87. val <- int(CowID) # Checks IF Userinput is a Integer
  88. ENDIF
  89. except ValueError:
  90. OUTPUT "That's not a valid identification code!"
  91. ENDIF
  92. loopone <- True # Restarts Loop instead of quitting program
  93. IF len(CowID) = 3: # Checks IF ID is 3 digits long
  94. for b in range(len(CowIDs)):
  95. IF CowID = CowIDs[b]:
  96. OUTPUT "this has been entered before"
  97. ENDFOR
  98. loopone <- True
  99. ENDIF
  100. ENDIF
  101. ENDFOR
  102. CowIDs.insert(i, CowID)
  103. for c in range(NumOfCows):
  104. CowYield <- input("Please enter the yield for cow:"+ CowID)
  105. ENDFOR
  106. D2S1.insert(c, CowYield)
  107. ENDFOR
  108. OUTPUT "End of day one"
  109. del CowIDs
  110. ENDWHILE
  111. ENDFOR
  112. for i in range(NumOfCows): # This loop will repeat for the number of cows in the herd
  113. while loopone = True:
  114. CowID <- input("Please enter Cow identification code")
  115. ENDIF
  116. try:
  117. val <- int(CowID) # Checks IF Userinput is a Integer
  118. ENDIF
  119. except ValueError:
  120. OUTPUT "That's not a valid identification code!"
  121. ENDIF
  122. loopone <- True # Restarts Loop instead of quitting program
  123. IF len(CowID) = 3: # Checks IF ID is 3 digits long
  124. for b in range(len(CowIDs)):
  125. IF CowID = CowIDs[b]:
  126. OUTPUT "this has been entered before"
  127. ENDFOR
  128. loopone <- True
  129. ENDIF
  130. ENDIF
  131. ENDFOR
  132. CowIDs.insert(i, CowID)
  133. for c in range(NumOfCows):
  134. CowYield <- input("Please enter the yield for cow:"+ CowID)
  135. ENDFOR
  136. D2S2.insert(c, CowYield)
  137. ENDFOR
  138. OUTPUT "End of day one"
  139. del CowIDs
  140. ENDWHILE
  141. ENDFOR
  142. for i in range(NumOfCows): # This loop will repeat for the number of cows in the herd
  143. while loopone = True:
  144. CowID <- input("Please enter Cow identification code")
  145. ENDIF
  146. try:
  147. val <- int(CowID) # Checks IF Userinput is a Integer
  148. ENDIF
  149. except ValueError:
  150. OUTPUT "That's not a valid identification code!"
  151. ENDIF
  152. loopone <- True # Restarts Loop instead of quitting program
  153. IF len(CowID) = 3: # Checks IF ID is 3 digits long
  154. for b in range(len(CowIDs)):
  155. IF CowID = CowIDs[b]:
  156. OUTPUT "this has been entered before"
  157. ENDFOR
  158. loopone <- True
  159. ENDIF
  160. ENDIF
  161. ENDFOR
  162. CowIDs.insert(i, CowID)
  163. for c in range(NumOfCows):
  164. CowYield <- input("Please enter the yield for cow:"+ CowID)
  165. ENDFOR
  166. D3S1.insert(c, CowYield)
  167. ENDFOR
  168. OUTPUT "End of day one"
  169. del CowIDs
  170. ENDWHILE
  171. ENDFOR
  172. for i in range(NumOfCows): # This loop will repeat for the number of cows in the herd
  173. while loopone = True:
  174. CowID <- input("Please enter Cow identification code")
  175. ENDIF
  176. try:
  177. val <- int(CowID) # Checks IF Userinput is a Integer
  178. ENDIF
  179. except ValueError:
  180. OUTPUT "That's not a valid identification code!"
  181. ENDIF
  182. loopone <- True # Restarts Loop instead of quitting program
  183. IF len(CowID) = 3: # Checks IF ID is 3 digits long
  184. for b in range(len(CowIDs)):
  185. IF CowID = CowIDs[b]:
  186. OUTPUT "this has been entered before"
  187. ENDFOR
  188. loopone <- True
  189. ENDIF
  190. ENDIF
  191. ENDFOR
  192. CowIDs.insert(i, CowID)
  193. for c in range(NumOfCows):
  194. CowYield <- input("Please enter the yield for cow:"+ CowID)
  195. ENDFOR
  196. D3S2.insert(c, CowYield)
  197. ENDFOR
  198. OUTPUT "End of day one"
  199. del CowIDs
  200. ENDWHILE
  201. ENDFOR
  202. for i in range(NumOfCows): # This loop will repeat for the number of cows in the herd
  203. while loopone = True:
  204. CowID <- input("Please enter Cow identification code")
  205. ENDIF
  206. try:
  207. val <- int(CowID) # Checks IF Userinput is a Integer
  208. ENDIF
  209. except ValueError:
  210. OUTPUT "That's not a valid identification code!"
  211. ENDIF
  212. loopone <- True # Restarts Loop instead of quitting program
  213. IF len(CowID) = 3: # Checks IF ID is 3 digits long
  214. for b in range(len(CowIDs)):
  215. IF CowID = CowIDs[b]:
  216. OUTPUT "this has been entered before"
  217. ENDFOR
  218. loopone <- True
  219. ENDIF
  220. ENDIF
  221. ENDFOR
  222. CowIDs.insert(i, CowID)
  223. for c in range(NumOfCows):
  224. CowYield <- input("Please enter the yield for cow:"+ CowID)
  225. ENDFOR
  226. D4S1.insert(c, CowYield)
  227. ENDFOR
  228. OUTPUT "End of day one"
  229. del CowIDs
  230. ENDWHILE
  231. ENDFOR
  232. for i in range(NumOfCows): # This loop will repeat for the number of cows in the herd
  233. while loopone = True:
  234. CowID <- input("Please enter Cow identification code")
  235. ENDIF
  236. try:
  237. val <- int(CowID) # Checks IF Userinput is a Integer
  238. ENDIF
  239. except ValueError:
  240. OUTPUT "That's not a valid identification code!"
  241. ENDIF
  242. loopone <- True # Restarts Loop instead of quitting program
  243. IF len(CowID) = 3: # Checks IF ID is 3 digits long
  244. for b in range(len(CowIDs)):
  245. IF CowID = CowIDs[b]:
  246. OUTPUT "this has been entered before"
  247. ENDFOR
  248. loopone <- True
  249. ENDIF
  250. ENDIF
  251. ENDFOR
  252. CowIDs.insert(i, CowID)
  253. for c in range(NumOfCows):
  254. CowYield <- input("Please enter the yield for cow:"+ CowID)
  255. ENDFOR
  256. D4S2.insert(c, CowYield)
  257. ENDFOR
  258. OUTPUT "End of day one"
  259. del CowIDs
  260. ENDWHILE
  261. ENDFOR
  262. for i in range(NumOfCows): # This loop will repeat for the number of cows in the herd
  263. while loopone = True:
  264. CowID <- input("Please enter Cow identification code")
  265. ENDIF
  266. try:
  267. val <- int(CowID) # Checks IF Userinput is a Integer
  268. ENDIF
  269. except ValueError:
  270. OUTPUT "That's not a valid identification code!"
  271. ENDIF
  272. loopone <- True # Restarts Loop instead of quitting program
  273. IF len(CowID) = 3: # Checks IF ID is 3 digits long
  274. for b in range(len(CowIDs)):
  275. IF CowID = CowIDs[b]:
  276. OUTPUT "this has been entered before"
  277. ENDFOR
  278. loopone <- True
  279. ENDIF
  280. ENDIF
  281. ENDFOR
  282. CowIDs.insert(i, CowID)
  283. for c in range(NumOfCows):
  284. CowYield <- input("Please enter the yield for cow:"+ CowID)
  285. ENDFOR
  286. D5S1.insert(c, CowYield)
  287. ENDFOR
  288. OUTPUT "End of day one"
  289. del CowIDs
  290. ENDWHILE
  291. ENDFOR
  292. for i in range(NumOfCows): # This loop will repeat for the number of cows in the herd
  293. while loopone = True:
  294. CowID <- input("Please enter Cow identification code")
  295. ENDIF
  296. try:
  297. val <- int(CowID) # Checks IF Userinput is a Integer
  298. ENDIF
  299. except ValueError:
  300. OUTPUT "That's not a valid identification code!"
  301. ENDIF
  302. loopone <- True # Restarts Loop instead of quitting program
  303. IF len(CowID) = 3: # Checks IF ID is 3 digits long
  304. for b in range(len(CowIDs)):
  305. IF CowID = CowIDs[b]:
  306. OUTPUT "this has been entered before"
  307. ENDFOR
  308. loopone <- True
  309. ENDIF
  310. ENDIF
  311. ENDFOR
  312. CowIDs.insert(i, CowID)
  313. for c in range(NumOfCows):
  314. CowYield <- input("Please enter the yield for cow:"+ CowID)
  315. ENDFOR
  316. D5S2.insert(c, CowYield)
  317. ENDFOR
  318. OUTPUT "End of day one"
  319. del CowIDs
  320. ENDWHILE
  321. ENDFOR
  322. for i in range(NumOfCows): # This loop will repeat for the number of cows in the herd
  323. while loopone = True:
  324. CowID <- input("Please enter Cow identification code")
  325. ENDIF
  326. try:
  327. val <- int(CowID) # Checks IF Userinput is a Integer
  328. ENDIF
  329. except ValueError:
  330. OUTPUT "That's not a valid identification code!"
  331. ENDIF
  332. loopone <- True # Restarts Loop instead of quitting program
  333. IF len(CowID) = 3: # Checks IF ID is 3 digits long
  334. for b in range(len(CowIDs)):
  335. IF CowID = CowIDs[b]:
  336. OUTPUT "this has been entered before"
  337. ENDFOR
  338. loopone <- True
  339. ENDIF
  340. ENDIF
  341. ENDFOR
  342. CowIDs.insert(i, CowID)
  343. for c in range(NumOfCows):
  344. CowYield <- input("Please enter the yield for cow:"+ CowID)
  345. ENDFOR
  346. D6S1.insert(c, CowYield)
  347. ENDFOR
  348. OUTPUT "End of day one"
  349. del CowIDs
  350. ENDWHILE
  351. ENDFOR
  352. for i in range(NumOfCows): # This loop will repeat for the number of cows in the herd
  353. while loopone = True:
  354. CowID <- input("Please enter Cow identification code")
  355. ENDIF
  356. try:
  357. val <- int(CowID) # Checks IF Userinput is a Integer
  358. ENDIF
  359. except ValueError:
  360. OUTPUT "That's not a valid identification code!"
  361. ENDIF
  362. loopone <- True # Restarts Loop instead of quitting program
  363. IF len(CowID) = 3: # Checks IF ID is 3 digits long
  364. for b in range(len(CowIDs)):
  365. IF CowID = CowIDs[b]:
  366. OUTPUT "this has been entered before"
  367. ENDFOR
  368. loopone <- True
  369. ENDIF
  370. ENDIF
  371. ENDFOR
  372. CowIDs.insert(i, CowID)
  373. for c in range(NumOfCows):
  374. CowYield <- input("Please enter the yield for cow:"+ CowID)
  375. ENDFOR
  376. D6S2.insert(c, CowYield)
  377. ENDFOR
  378. OUTPUT "End of day one"
  379. del CowIDs
  380. ENDWHILE
  381. ENDFOR
  382. for i in range(NumOfCows): # This loop will repeat for the number of cows in the herd
  383. while loopone = True:
  384. CowID <- input("Please enter Cow identification code")
  385. ENDIF
  386. try:
  387. val <- int(CowID) # Checks IF Userinput is a Integer
  388. ENDIF
  389. except ValueError:
  390. OUTPUT "That's not a valid identification code!"
  391. ENDIF
  392. loopone <- True # Restarts Loop instead of quitting program
  393. IF len(CowID) = 3: # Checks IF ID is 3 digits long
  394. for b in range(len(CowIDs)):
  395. IF CowID = CowIDs[b]:
  396. OUTPUT "this has been entered before"
  397. ENDFOR
  398. loopone <- True
  399. ENDIF
  400. ENDIF
  401. ENDFOR
  402. CowIDs.insert(i, CowID)
  403. for c in range(NumOfCows):
  404. CowYield <- input("Please enter the yield for cow:"+ CowID)
  405. ENDFOR
  406. D7S1.insert(c, CowYield)
  407. ENDFOR
  408. OUTPUT "End of day one"
  409. del CowIDs
  410. ENDWHILE
  411. ENDFOR
  412. for i in range(NumOfCows): # This loop will repeat for the number of cows in the herd
  413. while loopone = True:
  414. CowID <- input("Please enter Cow identification code")
  415. ENDIF
  416. try:
  417. val <- int(CowID) # Checks IF Userinput is a Integer
  418. ENDIF
  419. except ValueError:
  420. OUTPUT "That's not a valid identification code!"
  421. ENDIF
  422. loopone <- True # Restarts Loop instead of quitting program
  423. IF len(CowID) = 3: # Checks IF ID is 3 digits long
  424. for b in range(len(CowIDs)):
  425. IF CowID = CowIDs[b]:
  426. OUTPUT "this has been entered before"
  427. ENDFOR
  428. loopone <- True
  429. ENDIF
  430. ENDIF
  431. ENDFOR
  432. CowIDs.insert(i, CowID)
  433. for c in range(NumOfCows):
  434. CowYield <- input("Please enter the yield for cow:"+ CowID)
  435. ENDFOR
  436. D7S2.insert(c, CowYield)
  437. ENDFOR
  438. OUTPUT "End of day one"
  439. del CowID
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement