# Thread: Any C++ Programmers in the house ..

1. ## Any C++ Programmers in the house ..

I nee some help with this

Define the necessary variables and write a program to solve the following problem.

We have a class that has a number of students in it. The specific number can change from one time to the next, but assume it is at least 10. Each student provides a single evaluation for the instructor of the class ranging from 1 to 10. 1-3 is considered Fair, 4-7 is Good, and 8-10 is Excellent. You need to write a program that will read in these evaluation scores, drop the highest score and the lowest score (this isnt how evaluations are actually done) and compute the following:
 how many students rated the professor as excellent (provide both a number and percentage)
 how many rated the professor as good (provide both a number and percentage)
 how many rated the professor as fair (provide both a number and a percentage)
 what was the average rating
 if the high and low scores are not dropped, what would be the average rating

The first number you get as input will be the number of students followed by the individual ratings.  Reply With Quote

2. Buh wey allyuh does come out from boy.  Reply With Quote

3. this man wan ppl do he hw fi him

bwoy i tell yuh allyuh good yes  Reply With Quote

4. I was following everything except the last sentence.. The first number you get is an input!? Meaning the program asks the user how many total students?! Originally Posted by GuyaLucian
I nee some help with this

Define the necessary variables and write a program to solve the following problem.

We have a class that has a number of students in it. The specific number can change from one time to the next, but assume it is at least 10. Each student provides a single evaluation for the instructor of the class ranging from 1 to 10. 1-3 is considered Fair, 4-7 is Good, and 8-10 is Excellent. You need to write a program that will read in these evaluation scores, drop the highest score and the lowest score (this isnt how evaluations are actually done) and compute the following:
 how many students rated the professor as excellent (provide both a number and percentage)
 how many rated the professor as good (provide both a number and percentage)
 how many rated the professor as fair (provide both a number and a percentage)
 what was the average rating
 if the high and low scores are not dropped, what would be the average rating

The first number you get as input will be the number of students followed by the individual ratings.  Reply With Quote

5. it's been awhile, but you'd need a variable to hold the number of students in the class since this isn't a static number you can hard code.

variables to hold the respective percentages.

variables to compute the averages.

variables to hold the highest int and the lowest int, since you are going to drop them later, but will use them again.

if you are pulling the numbers from an array, then you could easily sort the numbers storing the highest number in the [n] position and the lowest number in the  position (since the position  is the number of students). then the variables would correspond to the address of the data position in the array.

doodle, is that sorta right?   Reply With Quote

6. Allyuh briiiiiiiiiiiiiiiiiiight! I wasn't into the IT thing, sorry.  Reply With Quote

7. Well close illuminati. The program is a lil more complex cause its asking the user to program a value. So assuming 10 people there are 10 different inputs that each class member is supposed to make. After that breaking down each entry is simple IF THEN statements..  Reply With Quote

8. Originally Posted by PJK
Well close illuminati. The program is a lil more complex cause its asking the user to program a value. So assuming 10 people there are 10 different inputs that each class member is supposed to make. After that breaking down each entry is simple IF THEN statements..
i would think that u would have to store each inputs into an array and then pull them at a different point in a program.

this is y i hate c++...to damn difficult  Reply With Quote

9. Originally Posted by PJK
Well close illuminati. The program is a lil more complex cause its asking the user to program a value. So assuming 10 people there are 10 different inputs that each class member is supposed to make. After that breaking down each entry is simple IF THEN statements..
PJK: tell me if my logic is close: wouldn't you just ask for the number, store it at & and keep doing a for loop for the other n digits (up to 10) and storing at &[n]? they do have some computing to do for the percents and averages, after that's the IF-THENs to determine good, fair, excellent, etc.

right?  Reply With Quote

10. Originally Posted by ringo357
i would think that u would have to store each inputs into an array and then pull them at a different point in a program.

this is y i hate c++...to damn difficult
Yeah but once you break down the logic then everything else falls into place.. And you are correct my sir an array of inputs works nicely right here.. You can then store and crop the lowest and highest numbers and then do calculations by the total amount of inputs which would be another variable by itself..   Reply With Quote

11. Originally Posted by PJK
Yeah but once you break down the logic then everything else falls into place.. And you are correct my sir an array of inputs works nicely right here.. You can then store and crop the lowest and highest numbers and then do calculations by the total amount of inputs which would be another variable by itself.. ok at least i still remember something   Reply With Quote

12. Originally Posted by illuminati
PJK: tell me if my logic is close: wouldn't you just ask for the number, store it at & and keep doing a for loop for the other n digits (up to 10) and storing at &[n]? they do have some computing to do for the percents and averages, after that's the IF-THENs to determine good, fair, excellent, etc.

right?
Nah you were good to go I am just not sure if the inputs are going to be per student or something else..   Reply With Quote

13. Originally Posted by PJK
Nah you were good to go I am just not sure if the inputs are going to be per student or something else.. had me worried! gimme some rum! nerves all rattled...  Reply With Quote

14. Originally Posted by illuminati
had me worried! gimme some rum! nerves all rattled...   Reply With Quote

15. not sure y this is to be done in c++. this is a simple program for c. c++ is for data structures really......

i'm rusty, but this would not be hard at all in VB.

if i had a c compiler i'd take a stab and if not get a compiled working version at least the logic down w/ functions.

salty  Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•