Page 1 of 4 123 ... LastLast
Results 1 to 15 of 48

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

  1. #1
    Loving Life K1zzy's Avatar K1zzy is offline
    Join Date
    Jun 2003
    Location
    on the planet
    Posts
    88
    Credits
    1,505,583

    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.

  2. #2
    Toppa_Toppa
    Guest


    Buh wey allyuh does come out from boy.

  3. #3
    OnE eYe MoNsTeR InC. DJ Ringo's Avatar DJ Ringo is offline
    Join Date
    Sep 2003
    Location
    DaVillE
    Posts
    2,071
    Credits
    1,041,115
    this man wan ppl do he hw fi him

    bwoy i tell yuh allyuh good yes

  4. #4
    Super Moderator Jason kiDD's Avatar Jason kiDD is offline
    Join Date
    Jul 2003
    Location
    Da Streets
    Posts
    42,527
    Credits
    7,664,113
    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?!

    Quote 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.

  5. #5
    Habitual Line Stepper illuminati's Avatar illuminati is offline
    Join Date
    Nov 2002
    Location
    Deluxe Apartment in the Sky, FL
    Posts
    4,764
    Credits
    1,061,739
    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 [1] position (since the position [0] 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?
    Last edited by illuminati; 03-08-2005 at 09:54 PM. Reason: oops, not [n+1] position

  6. #6
    Toppa_Toppa
    Guest
    Allyuh briiiiiiiiiiiiiiiiiiight! I wasn't into the IT thing, sorry.

  7. #7
    Super Moderator Jason kiDD's Avatar Jason kiDD is offline
    Join Date
    Jul 2003
    Location
    Da Streets
    Posts
    42,527
    Credits
    7,664,113
    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..

  8. #8
    OnE eYe MoNsTeR InC. DJ Ringo's Avatar DJ Ringo is offline
    Join Date
    Sep 2003
    Location
    DaVillE
    Posts
    2,071
    Credits
    1,041,115
    Quote 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

  9. #9
    Habitual Line Stepper illuminati's Avatar illuminati is offline
    Join Date
    Nov 2002
    Location
    Deluxe Apartment in the Sky, FL
    Posts
    4,764
    Credits
    1,061,739
    Quote 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 &[1] 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?

  10. #10
    Super Moderator Jason kiDD's Avatar Jason kiDD is offline
    Join Date
    Jul 2003
    Location
    Da Streets
    Posts
    42,527
    Credits
    7,664,113
    Quote 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..

  11. #11
    OnE eYe MoNsTeR InC. DJ Ringo's Avatar DJ Ringo is offline
    Join Date
    Sep 2003
    Location
    DaVillE
    Posts
    2,071
    Credits
    1,041,115
    Quote 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

  12. #12
    Super Moderator Jason kiDD's Avatar Jason kiDD is offline
    Join Date
    Jul 2003
    Location
    Da Streets
    Posts
    42,527
    Credits
    7,664,113
    Quote Originally Posted by illuminati
    PJK: tell me if my logic is close: wouldn't you just ask for the number, store it at &[1] 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..

  13. #13
    Habitual Line Stepper illuminati's Avatar illuminati is offline
    Join Date
    Nov 2002
    Location
    Deluxe Apartment in the Sky, FL
    Posts
    4,764
    Credits
    1,061,739
    Quote 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...

  14. #14
    Super Moderator Jason kiDD's Avatar Jason kiDD is offline
    Join Date
    Jul 2003
    Location
    Da Streets
    Posts
    42,527
    Credits
    7,664,113
    Quote Originally Posted by illuminati
    had me worried! gimme some rum! nerves all rattled...

  15. #15
    Take Kaiso In Yuh Mouth!! lordsalt is offline
    Join Date
    Jan 2000
    Location
    QBNYC
    Posts
    9,928
    Credits
    1,558,216
    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

Page 1 of 4 123 ... LastLast

Posting Permissions

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