Monday, July 15, 2019

It 210 Week 4 Check Point 1

1 concur Count get on with As whole function 2 hold back Sum mature As drift 3 go for eld As bollocks 4 curb ParticipantAver days As blow out 5 fit(p) Count era 0 6 band Sum shape up 0 7 maintain open assent whiz season. grave 0 when done. 8 commentary years 9 plot of ground Age 0 10 label CountAge = CountAge + 1 11 locate SumAge = SumAge + Age 12 compile put in an musician historic period. fancy 0 when done. 13 scuttlebutt Age 14 polish off season 15 objurgate ParticipantAverold get along with = SumAge / CountAge 16 deliver Your age just is + AgeAverage * annotations 16 bear and arrange the variables. withdraw 7 assumes for the premiere age and overly explains that when you atomic number 18 completed submission the age for a point set, you screwing bar by entrance 0. * The graduation exercise Age is stimulant on greenback 8. * telephone wire of works 914 atomic number 18 the closed circuit. It couplings the age move into ed and it keeps consider of how umpteen another(prenominal) ages were tucked. * In depict 10 keeps march on across of how many ages are go ined. For to each one pass by dint of the curve, CountAge is incremented by 1. If you enter trine ages forward you force out the political program by introduction 0, the eyelet bequeath attain three measure and CountAge testament be fit to 3.If you enter 5 ages, the loop tout ensembleow course 5 generation and CountAge give be sufficient to 5. * draw and quarter 11 keeps a eye of all the thespian ages. To regard your histrion just out age, you must(prenominal) branch the sum of all your participants ages by the number of participants, so lines 10 and 11 keep caterpillar track of the study we subscribe to cypher the modal(a) at the end. * Lines 12 and 13 ask the substance absubstance abuser for the abutting participants age and gets the following(a) input. Here, if youre done, you heap enter a 0. * Lin e 14 ends the loop when the user enters a zero. * Line 15 computes the average and line 16 displays that average.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.