Respond to this messageReturn to Index
Original Message
  • New Topic : Same C++ help
    • alexandria lynn (no login)
      Posted Dec 2, 2009 2:18 AM

      First of all, I apologize for giving everyone the wrong idea about me. I'm not a cheater as I have done everything on my own and I'm passing the class. That aside, I have my source code so you can check out what it is that I'm doing wrong. This is my own source code:

      #include <iostream>
      #include <math>
      #include <iomanip>

      const A = 4
      const B = 3
      const C = 2
      const D = 1
      const F = 0

      void displayOutput(char grade); // function prototype

      int main()

      {
      // Local Declarations
      int course no;
      int credits;
      char grade;


      // Program Statements


      cout << " enter student id ";
      cin >> student id;
      cout << " enter the course ";
      cin >> course;
      cout << " enter the credits ";
      cin >> credits;
      cout << " enter the grade ";
      cin >> grade;

      GPA = no_credits / no_courses
      displayOutput (GPA);

      while (course < 4)
      {
      cout




      grade = calc_grade(test1,test2,test3); // call the function
      displayOutput(grade); // call the function

      // Output Formats

      cout << setiosflags (ios::fixed)
      << setiosflags (ios::showpoint)
      << setprecision(2);

      return 0;

      }

      char calc_grade(double test1, double test2, double test3)

      {
      // Local Declarations
      double total, average;
      char grade;

      // Program Statements
      total = test1 + test2 + test3;
      average = total/3.0; // divide the total by 3.0

      if (average >= 90.00)
      grade = 'A';
      else if (average >= 70.00 && average < 90.00)
      {
      if (test3> 90.00)
      grade = 'A';
      else
      grade = 'B';
      }
      else if (average >= 50.00 && average < 70.00)
      {
      if (test3> 70.00)
      grade = 'C';
      else
      grade = 'D';
      }
      else if (average < 50.00)
      grade = 'F';
      else
      cout << "An invalid test grade was entered." << endl;

      return grade;

      }

      void displayOutput(char grade)

      {

      cout << " A student's letter grade is " << grade << endl; // display volume of the cylinder

      return;
    Your Name
    Message Title
    Message Text
    Image Services Photobucket.com
    Options
    Enable formatted text (what's this?)
          


     Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement