Plz help ,, my exam tomorrow :(

i want a code for this plz :(

Write a C – Program which :
a) stores the students data in an " array " , ( stu [102] [6] )
b) data of each one of the (100 students) is stored in " one raw " of the array, (stu),
( this data includes:- "student number " and marks of "five " subjects ) .
c) sorts the array (rows) according to the marks of the " second subject" .
d) calculates the " average marks " for every subject.
------------------------------------------------------------------------------------------------------------
Write a C – Program which
a) define a "structure type", ( distance ) which includes
( meters , centimeters , and millimeters).
b) defines two variables of type ( distances ) , A and B.
c) reads values for A and B.
d) defines a "FUNCTION" that receives the two ( distances ) , A , B
e) the function will reserve ( another ) two ( distances ) C and D.
f) stores ( A + B ) in ( C ) , and ( prints ) its contents on screen
g) stores ( A * B ) in ( D ), and ( returns ) ( D ) to the main program


Write a C-program that :-
o Reads an integer number, (n) .
o Sends (n) to a "FUNCTION"
o The function prints on screen (n) terms of the following series ;
ai ,(i = 0 , 1 , ... n-1 );
(for example. a0 , a1 , ....... , an-1 ) , where, , ai = (-1)i x (i)2i

Plz help meeeeee :(
Dude, you have to write code in an exam so it doesn't help you if others do it for you...

furthermore, this is not a site to make your homework...
i have a 100 questions for the exam and i can solve all of them but this i haven't any idea for how can i do bro ,, thank u
Nah, no bro, post your code so we can see what you've tried
#include <iostream>
#include <string>

using namespace std;

const int MAXSTUDENTS = 100;
const int MAXTESTS = 5;

int main()
{

struct {
float grade[MAXTESTS];
string studentName;
} student[MAXSTUDENTS];


for (int i = 0; i < MAXSTUDENTS; i++) {
cout << "please enter student " << i+1 << ". name: " ;
cin >> student[i].studentName;

for (int k = 0; k < MAXTESTS; k++) {
cout << "please enter student " << i+1 << ". grade to test " << k+1 ;
cin >> student[i].grade[k];
}

}

int averageGrade = 0;
int totalStudentScore = 0;
for (int i = 0; i < MAXSTUDENTS; i++) {

for (int k = 0; k < MAXTESTS; k++) {
totalStudentScore = totalStudentScore+ student[i].grade[k];

}

}

averageGrade = totalStudentScore/MAXSTUDENTS;

cout << "Average student grade is: " << averageGrade;

return 0;

}

first one
Last edited on
use code tags please <>
i'm afraid it's didn't work
Topic archived. No new replies allowed.