ITCS Student
Well-Known Member
- تاريخ التسجيل
- 13 سبتمبر 2011
- المشاركات
- 562
- المجموعة
- ذكر
- الدفعة الدراسية
- معلومة خاصة
- الكلية
- كلية تقنية المعلومات
- التخصص
- CS
ممكن الحل مال هدا
Write a program that reads student's names followed by their ID and test scores. student data should be stored in a struct variable of type studenttype which has 3 members: name ,ID, and test score. Declare array ITCS104students of size 5 of elements of type studenttype. add the following functions to your program:
* a function to read all members of your array.
* a function to print name and ID of the student with the lowest test score.
اني بعد ابي مساعده في هالسؤال رحم الله والديكم
ملاحظه ، السؤال يقول ان اطبع الاسم والID واقل درجه
معنى هالكلام ان score في struct نوعه array
والسؤال مو كاتب هالشي ( هذي اولاً )
ثانيا : لازم function ثالثه عشان تطلع لنا اقل درجه
وهالشي مو مكتوب بعد
فـ انا سويت المطلوب بس ، لكن في طباعه اقل درجه خليت يطبع الدرجه نفسها
اذا تبون ما التزم بالمطلوب بعدله وقت أخر
PHP:
#include<iostream>
#include<string>
using namespace std;
struct studentType {
string name;
long ID;
int testScore;
};
void Read(studentType &arr)
{
cout<<"Enter name,ID and test Score = ";
cin>>arr.name>>arr.ID>>arr.testScore;
}
void Print(studentType &arr)
{
cout<<"Name = "<<arr.name<<endl;
cout<<"ID = "<<arr.ID<<endl;
cout<<"Test Score = "<<arr.testScore<<endl;
cout<<endl;
}
int main()
{
studentType ITCS104student[5];
for(int i=0 ;i<5 ;i++)
Read(ITCS104student[i]);
for(int i=0 ;i<5 ;i++)
Print(ITCS104student[i]);
system("pause");
return 0;
}
..

