Skip to content
Sign upLog in
← Back to Community

Hi can someone help me with school stuff?

Profile icon
anikuya2626

Hey so for school i have to "design a program that can compare data from two students to identify who deserves an award.

You must compare three grades per student: Test grade, conduct grade and social involvement grade .

The best student will be the one that has better grade average. If the two students have the same grade average, you must compare their conduct grades. If both have the same conduct grade, must use the social involvement grade to break the tie.

If all grades are the same, the program must display the message "AWARD CAN NOT BE ASSIGNED".

Test grades are graded from 0 to 100.

Conduct grades are graded from A to F (A=100, B=90, C=80, D=50, and F=0)

Social Involvement is graded as follows: OUTSTANDING (=100), EXCELLENT (=70), REGULAR (=50) and NORMAL (=40)

Write the program using a function to calculate the average. The function must be called averageGrade(student)

Write a function called StudentComparison(student 1, student 2) that will return 1 if the first student wins and 2 if the second student wins.

Write a procedure called displayWinner(student) to display the message

"Student LASTNAME, FIRSTNAME has been awarded with the "Supreme Mister Del Valle Award" for Oustanding Students.

"Final Test Grade = GRADE - - Final Conduct Grade = GRADE - - Social Involvement Grade GRADE"

Note: Students must be saved as an array of structures."

But idk HOW bcs im new to the class and idk how to do anything... can someone help??

Voters
Profile icon
anikuya2626
Comments
hotnewtop
Profile icon
JasonLiu19

ok so first why are you stuck on the first steps when I'm stuck on an efficient way to compare data from 3 different students?
Ok here are some starters:
Have these libraries and the using namespace std

#include <iostream> #include <string> #include <vector> #include <algorithm>

Next, declare your structure and stuff:

struct grades{ string fname; string lname; int test; char conduct; string si; } student[3]; int studentAverage(int t, char c, std::string s); int studentCompare(vector<int>t); int valueChar(char c); int valueStr(std::string s); void displayWinner(); void printGrades(); vector<int>order{};

I am only going to do studentAverage and studentCompare.

int studentAverage(int t, char c, string s){ int cv; int sv; int total; switch(c){ case 'A': cv=100; break; case 'B': cv=90; break; case 'C': cv=80; break; case 'D': cv=50; break; case 'F': cv=0; break; default: return -1; } if(s=="Outstanding"){ sv=100; } else if(s=="Excellent"){ sv=70; } else if(s=="Normal"){ sv=50; } else if(s=="Low"){ sv=40; } total=t+cv+sv; total/=3; return total; } int studentCompare(vector<int>t){ if(t[0]>t[1]){ return 1; } else if(t[0]<t[1]){ return 2; } else{ return 0; } }

This is all I'm going to give you, I shouldn't be doing this in the first place. But you should be able to do the rest from here.

Profile icon
[deleted]

@JasonLiu19
DO NOT USE NAMESPACE STD! it's a terrible practice!

Profile icon
JasonLiu19

@owoDev
i know and i don't, but that's we are learning so she understands the code

Profile icon
anikuya2626

Thanks! hopefully i can do this now, thanks for ur help!


@JasonLiu19

Profile icon
TannerTommy

I can help you with school and anything that you want. Of course I am a college essay writing help provider, so I know what I'm doing. I'll be of great value to anyone.

Profile icon
IntellectualGuy

@anikuya2626
Add me to a repl, I'll see how I can help

Profile icon
anikuya2626

no thanks, someone already helped me out a bit, but thank you for offering to help!

@IntellectualGuy