Thread: Noob needing some help and insight

  1. #1
    Registered User
    Join Date
    Feb 2009

    Noob needing some help and insight

    well i am taking c++ in college having a bit of difficulty on grasping it a bit basically im just wondering if someone could take a look to see what im doing wrong in this i would appreciate the help and criticism. like i said it is a class project so this is the project in detail:

    Lowest Score Drop
    Write a program that calculates the average of a group of test scores, where the lowest
    score in the group is dropped. It should use the following functions:
    void getScore() should ask the user for a test score, store it in a reference
    parameter variable, and validate it. This function should be called by main once
    for each of the five scores to be entered.
    void calcAverage() should calculate and display the average of the four high-
    est scores. This function should be called just once by main, and should be passed
    the five scores.
    int findLowest() should find and return the lowest of the five scores passed to
    it. It should be called by calcAverage, which uses the function to determine which
    of the five scores to drop.
    Input Validation: Do not accept test scores lower than 0 or higher than 100.
    (Starting Out with C++: From Control Structures through Objects, 6th Edition. 03/19/2008: Addison-Wesley, 03/19/2008. 377).

    #include <iostream>
    using namespace std;

    // function prototype
    void getScore(int);
    void calcAverage();

    int main()
    char restartProgram; // restarting program for next set of grades

    cout << "This Program will average\n";
    cout << " the test scores you input, \n";
    cout << "and will drop the smallest grade." << endl;
    getScore(int sum);
    return 0;

    void getScore(int sum)
    double testScore;
    int sum = 0;
    int count;

    for(count = 1; count <= 5; count++)
    cout << "Enter test score number " << count << endl;
    cin >> testScore;
    if(testScore < 0 || testScore > 100) // make sure real test number
    cout << testScore << " is an invalid entry. Please input correct score.\n";
    sum += testScore;
    __________________________________________________ _____________

    thanks in advance for even givin this a peek

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Please post code properly formatted and within code tags, to preserve that formatting.
    All the buzzt!

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Tags for this Thread