loops

Sample output:
How many cars are driving by this hour?
10
What percentage (0-100) will you see approx., sleepyhead?
30
You missed a car...
You missed a car...
You missed a car...
That one is BLUE!
You missed a car...
That one is some other ugly color.
You missed a car...
You missed a car...
That one is BLUE!
That one is RED!
You saw 2 blue and 1 red car out of 4 cars seen.


how would i write this code. can you some guide me to the right direction
Im not sure I understand. Do you just want a code that will output these lines to the console? Or is there supposed to be some sort of user interaction here?
i believe there are some i++ our countings involve.

Prompt for the total number of cars. Prompt for the percent chance of seeing a car when it drives by. If 10% of cars in the world are solid blue and 25% of cars are solid red, print out the status of every car and then the total of blue and red you saw. No percentage is determinate - they are both independent random behaviors.
i was giving this idea to start off with, but i am not sure how list works.

list1 {"You missed a car"}
list2 {"That one is BLUE!", "That one is Red!"}
my bad
list1 {"You missed a car", "That one is some other ugly color."}
once the user type in the number
just do random on each list
until you get the right percentage for each list
done
Topic archived. No new replies allowed.