CPT121 Task 1.3.1 Practice Exercises – Decisions Solved

30.00 $ 15.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . zip solution files instantly, after Payment

Description

Rate this product

Task 1.3.1 Practice Exercises – Decisions

  1. Write a program which simulates the logic of a traffic light, based on the road rules for traffic light signals as outlined at https://www.vicroads.vic.gov.au/safetyandroadrules/roadrules/atozofroadrules/trafficcontrolsatintersections (basic Traffic lights rules only), and prints the appropriate outcome according to the prevailing conditions (ie. either “stop” or “proceed through intersection”).

Note that there are multiple factors to take into account when approaching a traffic light and your program should gather information from the user about each of these factors as when / as required and take each of these factors into account, as outlined in the rules for basic Traffic lights noted above.

  1. Consider how you would test the program implemented for question 1 above to ensure that the expected outcome is achieved for each possible combination of factors and test your program accordingly, noting whether the expected outcomes were produced or not.

In any situation where the expected outcome was not produced you should re-examine your code, identify the problem and correct it so that the program produces the correct outcome for that situation.

 

  • task_1_3_1-ygh6sy.zip