Search:

Type: Posts; User: Barkley

Search: Search took 0.01 seconds.

  1. Replies
    30
    Views
    3,243

    this is what I have now, now I get an arguments...

    this is what I have now, now I get an arguments too many compile error.



    int getGrades()
    {
    int grade[10];
    int i,sum=0, avg=0;
    int max=0,min=100;
  2. Replies
    30
    Views
    3,243

    So from getGrades the variables int grade and int...

    So from getGrades the variables int grade and int sum need to be passed into averageGrades right? Then when I call it in main I just put grade, sum in the () of averageGrades.

    edit: it would just...
  3. Replies
    30
    Views
    3,243

    So I still don't have a clue I've switched the...

    So I still don't have a clue I've switched the variables all the ways I can think of and it still won't compile, can I get a major hint? maybe in the most simple form possible :)
  4. Replies
    30
    Views
    3,243

    I have no background at all in anything hence why...

    I have no background at all in anything hence why I pulled this from the tutorial here and tried to modify it haha. I have been trying to fool around with this language for about 3 weeks now and not...
  5. Replies
    30
    Views
    3,243

    This is what I have now and I still get the...

    This is what I have now and I still get the undeclared in main. When I declare them then I get another totally different error.

    also would it be(something along the lines of this)


    if...
  6. Replies
    30
    Views
    3,243

    I don't declare the type? As in the "int" are you...

    I don't declare the type? As in the "int" are you sure? When I do this it just gives me a not declared compiler error. Then when I delcare it in the actual function and in main it still gives me the...
  7. Replies
    30
    Views
    3,243

    so when I pass grade, avg, sum I get a compile...

    so when I pass grade, avg, sum I get a compile error saying expected primary expression before int
  8. Replies
    30
    Views
    3,243

    So from what I read about passing variables it...

    So from what I read about passing variables it needs to be in the () of the function that I am passing it too. So in my program would it be
    averageGrades(int grade[], int i)
    edit: Actually I...
  9. Replies
    30
    Views
    3,243

    You know I was thinking about that, how would I...

    You know I was thinking about that, how would I do that though? In other words how would I make the program not take into account the value of -1?

    And I will read up on it thanks!
  10. Replies
    30
    Views
    3,243

    I thought I copied the latest of what I had but I...

    I thought I copied the latest of what I had but I declared the variables in both functions thus thats why I was getting zeros, so how do I pass variables then? It goes in the () right?
  11. Replies
    30
    Views
    3,243

    Ok great I'll edit that, I also have another...

    Ok great I'll edit that, I also have another question if I still have your attention. How would I split this program up into functions? I tried this but when I enter all my grades I always get 0. Did...
  12. Replies
    30
    Views
    3,243

    cout

    cout << "Average Grade: ";
    if (avg<0)cout << "---";
    else cout << avg;
    cout << "%" << endl;


    would I do something like this?
  13. Replies
    30
    Views
    3,243

    Get rid off negative averages

    So I pulled this from the C++ tutorial here and played around with it to make it into a program that averages ten grades. How ever when I input all negative grades it gives a negative average. How...
Results 1 to 13 of 13