anonymous
  • anonymous
I need help help calculating and updating the total grade for a structure student inside an array.
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
FortyTheRapper
  • FortyTheRapper
In C++? Have you tried the source code, if so?
anonymous
  • anonymous
yes, for c++
anonymous
  • anonymous
and what do you mean source code?

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
I'm getting data from a file with various parts i.e id, first name, last name, midterm, final,quizzes, labs, projects
anonymous
  • anonymous
and these things make up the structure student
FortyTheRapper
  • FortyTheRapper
Like, have you attempted the code and get errors? If so, would you mind posting so I give a quick look? I gotta go in 10 minutes and won't be back til tomorrow. I don't mind helping though
anonymous
  • anonymous
okay
anonymous
  • anonymous
I am using functions
anonymous
  • anonymous
void fillArrayFromFile(ifstream& ins,student studentArray[], int& numberOfStudents, int weightMidterm, int weightFinal, int weightQuizzes, int weightLabs, int weightProjects) { int id; string firstName; string lastName;; string line; numberOfStudents = 0; while (!ins.eof()) { ins >> studentArray[numberOfStudents].id >> studentArray[numberOfStudents].first >> studentArray[numberOfStudents].last >> studentArray[numberOfStudents].midterm >> studentArray[numberOfStudents].final >> studentArray[numberOfStudents].quizzes >> studentArray[numberOfStudents].labs >> studentArray[numberOfStudents].project; numberOfStudents++; } } void updateTotalGrade(student studArray[], int index, int weightMidterm, int weightFinal, int weightQuizzes, int weightLabs, int weightProject) { int totalGrade; index = 0; for (int i = 0; i < index; i++) { } }
anonymous
  • anonymous
updateTotalGrade is called by fillArrayFromFile
anonymous
  • anonymous
@FortyTheRapper
FortyTheRapper
  • FortyTheRapper
So are you trying to create a struct like...? struct blahblah { }; Then wanting to print out the values of the files in main or the function?
anonymous
  • anonymous
just store the informantion in the struct
anonymous
  • anonymous
the struct is already created
anonymous
  • anonymous
struct student // stucture of type student. { int id; string first; string last; float midterm; float final; float quizzes; float labs; float project; float totalGrade; string letterGrade; };
anonymous
  • anonymous
this is what the file contains
1 Attachment
anonymous
  • anonymous
@FortyTheRapper

Looking for something else?

Not the answer you are looking for? Search for more explanations.