BTC USD 83,764.2 Gold USD 4,353.24
Time now: Jun 1, 12:00 AM

Pakar C++ BAntu Jap

rezonk

Fun Poster
Messages
315
Joined
Jun 29, 2006
Messages
315
Reaction score
1
Points
15
#include<iostream>
using namespace std;

struct Student_Record{
int id_num;
int assignment;
int quiz;
int test;
char grade;
};
void get_data(Student_Record &p);
int calc_mark(Student_Record p);
Student_Record read_data();
void print_all(const struct Student_Record p{});

int main()
{
Student_Record amir,naim, amirNaim[2];
int amirtotal_mark, naimtotal_mark;

get_data (amir);
amirtotal_mark=calc_mark(amir);
if (amirtotal_mark>=60)
amir.grade ='p';
else
amir.grade='F';

naim= read_data();
amirNaim[0]=amir;
amirNaim[1]=naim;

naimtotal_mark=calc_mark(amirNaim[1]);
if (naimtotal_mark>=60)
amirNaim[1].grade='P';
else
amirNaim[1].grade='F';

print_all(amirNaim);

system("pause");
return 0;
}
ni masalah ambo ni....tk tau nak buat function dia...program dah kasi function tak reti nak masuk.
 
this question is complete the program.The program ask the user to enter mark for assignment,quiz and test for amir and naim,the calculates the total mark using simple formula (assignment+quiz+test)/3.Finally the program print report card for both students and the report display all content of the structure.You required to write definitions for the given 4 function performing task in the program.
 
function atas tu pon memang dah sedia ada dalam code ker??..
 
1. Tulis kod biar tersusun sikit. Sbb senang org bc dan gunakan BBCode utk letak code ni.
2. Aku tak tau pucuk pangkal ko nak wat program ni. Mcmana formula kira gred. Jd mgkn mcm kata rezonk tu leh pakai.
3. Aku tak pasti sama ada ko tak tahu nak tulis function mcmana ke, atau tak tau mcmana nak letak function. Tp kalu ikut ayat ko "function tak reti nak masuk. "

Aku rs2 ko tak tau nak bubuh function kat mana. Jd:
a) Leh terus expand function tu kat baris tulis
void get_data(Student_Record &p);
int calc_mark(Student_Record p);
Student_Record read_data();
void print_all(const struct Student_Record p{});

b) Atau tulis function tu sekali lagi selepas main function.
 
1. Tulis kod biar tersusun sikit. Sbb senang org bc dan gunakan BBCode utk letak code ni.
2. Aku tak tau pucuk pangkal ko nak wat program ni. Mcmana formula kira gred. Jd mgkn mcm kata rezonk tu leh pakai.
3. Aku tak pasti sama ada ko tak tahu nak tulis function mcmana ke, atau tak tau mcmana nak letak function. Tp kalu ikut ayat ko "function tak reti nak masuk. "

Aku rs2 ko tak tau nak bubuh function kat mana. Jd:
a) Leh terus expand function tu kat baris tulis
void get_data(Student_Record &p);
int calc_mark(Student_Record p);
Student_Record read_data();
void print_all(const struct Student_Record p{});

b) Atau tulis function tu sekali lagi selepas main function.

:D
memang rezonk punya thread ni.. :D.. aku tengok code dia pon pening..

btw TT.. code ni memang lecturer ko dah provide bagi ataupon ko tulis sendiri?? :)
 
haha..aku salah tgk nick le plak... :-) Aku pikir yg tny tu org lain. Yg reply tu org lain...haha.

Tuan tanah pun snyap je...
 
Last edited:
aku rasa mungkin tuan thread ni tak tau camne nak buat isi dalam method tu kot.. (andaian kasar je ni)

and tt ni tengah bz.. maybe malam malam karang dia reply
 
tt dah buat takat mana? kalau nak suap habih tak syok la

cuba bagitau secara spesifik tang mana tt sangkut, baru kitorang leh tolong
 
TT online tp terlupa kot thread ni..
 
takpon dia dah jumpa solution tentang problem dia ni
 
Back
Top
Log in Register