Need help! supposed to take in 6 project grades and 2 test grades... multiply each by %50 and add together for final average. however, i cant figure out how to add the integers in the array much less compute the average... any help is highly appreciated!!!
heres the code:
#include <iostream>
using namespace std;
int main(void) {
cout <<endl;
cout << "CSE 2050 Program 1" << endl;
cout << "Arun Chandra" << endl;
int proj[6]; //creates an array for project grades
int test[2]; // creats an array for test grades
float psum;// project grade sum
float tsum;// test grade sum
float pave;// project grade average
float tave;// project grade average
cout << "Let's calculate your grades!"<<endl;
cout << "Enter your 6 program grades"<<endl;
//this will allow you to input exactly 6 project grades
for (int i=0; i < 6; i++) {
cin >> proj[6]; }
//This will output the project grades
cout << "\nThe project grades you entered were:" << endl;
for (int i=0; i < 6; i++)
cout << proj[i] << endl;
// add the project grades together and then compute average
for (int i=0; i < 1; i++){
psum += psum + proj[i];//this is supposed to add the values in the array
cout<<endl;
cout<<"this is sum"<<psum<<endl;//this is to test the sum
pave=psum/6;
cout<<pave<<endl;}//this is to test the average
cout <<endl;
cout << "Great..................."<<endl;
cout << "Now enter your 2 test grades"<<endl;
//this will allow you to input exactly 2 test grades
for (int i=0; i < 2; i++) {
cin >> test[i]; }
//This will output the test grades
cout << "\nThe test grades you entered were:" << endl;
for (int i=0; i < 2; i++)
cout << test[i] << endl;
// add the test grades together and then compute average
for (int i=0; i < 1; i++){
tsum += tsum + test[i];//this is supposed to add the values in the array
cout<<endl;
cout<<"this is sum"<<tsum<<endl;//this is to test the sum
tave=tsum/6;
cout<<tave<<endl;}//this is to test the average
return 0;
}