Go Back   Novahq.net Forum > Computers > Web design and Programming
FAQ Community Calendar Today's Posts Search

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-10-2004, 09:53 AM
BOne is offline BOne
Registered User

Join Date: Aug 2003
Posts: 1,640

Send a message via ICQ to BOne Send a message via Yahoo to BOne
eek grade calculator

//C++ business programming
//program 6
//cameron university fall 2004
//instructor: Greg Henry

//================================================== ============

//====================== problem statement =====================
//this program allows a user to enter test and daily grades
//then uses an array to sort the grades by average and above average

//================================================== ============

//set pre-processor directives

#include(iostream)
#include(iomanip)
using namespace std;
//================================================== =============

//set function prototypes

void header();
double average(int arr[],int number);

//================================================== ==============

int main()
{
header();
int i=0;
int number,number1;
double test_avg=0.0;
double prog_avg=0.0;
double class_avg = 0.0;

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

cout <<"Enter number of test grades: ";
cin >> number; //user input amount of test grades

cout <<"Enter number of daily grades: ";
cin >> number1; //user input amount daily grades

int test_grades[number]; //fill array test grades with input number
int daily[number1]; //fill array daily grades with input number

for(int i=0;i<number;++i)
{
cout<<"\nenter test grades "<<i+1 << " : ";
cin>>test_grades[i];
}

for (int j=0;j<number1;++j)
{
cout <<"\nenter daily grades "<<j+1<<":";
cin >>daily[j];
}

test_avg = average(test_grades,number);
prog_avg = average(daily,number1);
class_avg = (test_avg + (prog_avg * 5))/2;

cout<<"\nThe average test grade = "<< test_avg <<endl;
cout << "The program average = " << prog_avg << endl;
cout << "The class average = " << class_avg << endl;

return 0;

}

//================================================== ================

//call header function

void header()
{
system("clear");
cout<<"this program averages class grades"<<endl;
cout<<"then displays the average as well as above"<<endl;
cout<<"average grades"<< endl;
cout<<"programmer:TANK"<<endl<<endl;
}

//================================================== ==============

//call average function

double average(int arr[],int number)
{
double sum=0.0, avg = 0.0;
for(int i=0;i<number;++i)
{
sum +=arr[i];
}
return avg = (double) sum/number;

}
//================================================== ===========

/*call above average function

void above_average(double test_grades[],int number,double avg)
{
for(int i=0;i<number;++i)
{
if(test_grades[i]>avg)
{
cout<<"the above average test grades are: "<<test_grades[i]<<endl;

}
}
}*/

//================================================== ===========
//=========================END PROGRAM=========================



WOOT WOOT.....use this script to figure your grades
this is a sweet little script and it work a charm
give it a go lemme' know what ya think
__________________
=====Retired sig team member=====
Reply With Quote
  #2  
Old 12-10-2004, 10:03 AM
Lakie is offline Lakie

Join Date: Mar 2002
Posts: 5,540

whats the backdoor password to change the grades?
Reply With Quote
  #3  
Old 12-10-2004, 02:54 PM
BOne is offline BOne
Registered User

Join Date: Aug 2003
Posts: 1,640

Send a message via ICQ to BOne Send a message via Yahoo to BOne
Biggrin

lmao....last semester someone hacked the university network and erased all student emails lol .... huuuummmm

damn computer science students lol
__________________
=====Retired sig team member=====
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mature: First Grade Drawing - PRICELESS! Hellfighter Humor & Jokes 0 01-28-2011 01:16 PM
C# Quadratic Formula Calculator (Beginner) --BulletMagnet-- Web design and Programming 11 09-13-2010 11:19 PM
Math in 1st grade ShArP Humor & Jokes 1 03-04-2008 11:05 AM
Americans, can u pass 4th grade? Lucky General Chat 14 03-13-2006 09:25 PM


All times are GMT -5. The time now is 11:39 AM.




Powered by vBulletin®