### How to write this code?

closed account (EApGNwbp)
thanks
Last edited on
something you can do:

 ``1234`` ``````if(passingscore > studentscore) { //do the script for this }``````

you can tweak it for your likes.
- i would do something like this

 ``1234567891011121314151617181920212223242526272829303132333435363738394041424344`` `````` double average=0; double lowest=0; double total; void getScore(&double,&double); void getScore(double av, double lo) { int k; cout<<"how many quizes"<>k double[k] scoreList; for(int i=0;i

closed account (EApGNwbp)
@thejman250 thanks um but I haven't learned arrays yet so I a bit lost. I am a beginner freshmen in college
@Dan1234
- Well, arrays would make this much easier and the concept is quite simple (in my opinion at least)

- In short, you can use whatever style works for you and you don't actually need your professor to teach you the language. In fact, reading ahead of time and/or watching tutorials will give you knowledge of the subject before the lecture, and will probably enable you to expand your knowledge upon the topic more than if you had simply waited for your professor to go over it.
closed account (D80DSL3A)
You don't need to use arrays for this problem. You can perform the required calcs. as the user enters each value.

1) User enters numQuizzes.
2) Prompt for 1st score. Save this value as scoreTotal and as loScore, because so far it is both.
3) Each time user enters another score do 2 things:
b) compare it to loScore. If it's less, then it's the new loScore.

4) After all scores are entered subtract loScore from scoreTotal, because the lowest score is thrown away.
5) Find average = scoreTotal/(numQuizzes-1);

The function signature you want is `void getScore(double& av, double& lo)` so that av and lo are passed by reference.

EDIT: That function may not meet all requirements. The instructions say to get the # of quizzes then call the function. You would need to pass numQuizzes to the function too. More like:
`void getScore_data(int numQuizzes, double& av, double& lo)`
Last edited on
Topic archived. No new replies allowed.