موقع طلبة جامعة البحرين

يمكنك تصفح الموقع كزائر ولكن ندعوك لتسجيل عضوية خاصة بك لتحصل على كافة الصلاحيات مثل تنزيل ملفات المكتبة وقراءة تعليقات هيئة التدريس وغيرها. يمكنك الحصول على عضوية مجانية بالضغط على زر تسجيل. إذا قمت بالتسجيل مسبقا فيمكنك الضغط على زر دخول.

تسجيل دخول
  • قسم المكتبة الجامعية مغلق مؤقتا بعد الاستهداف التي تعرضت له بعض خدمات أمازون في البحرين، جاري استرجاع الملفات ونقلها إلى سيرفرات جديدة وسيتم بعدها اعادة افتتاح المكتبة

ITCS112 - ITCS104 - ITCS102 للفصل الصيفي 2014 - 2015

viod clocktype:: settime(int H, int M, int S){
if (H>=0&& H< 24) hr=H;
else
hr=0;
if(M>=0 && M<60) min= H; else min=0;
if(s>=0 && <60) sec= 5; els sec=0;}
void clocktype::gettime(int & M, int & S)
{
H=h; M=main; S=sec;
{

void clocktype::printtine(){
if (hr<10) cout<<0;
cout<<hr<<':';
if ( min<10) cout<<0;
cou<<main<<':';
if(sec< 10) cout<<0;
cout<<sec;
}
viod main(){
clocktype TS6,Tss;
TS6,sttine(8,0,0);
int X,Y,Z;
cout<<"enter time for sec5";
cin>>X>>Y>>Z;
TSS.setime(X,Y,Z);


هذا الي اعرفه بليييززز ساعدوني باقي ساعتين على التسليم :RpS_crying: اخي ITCS Student وينك:tears:
​

ذي اهوه الحل كامل حق السؤال ؟؟
ضروري الررد بليز :99::no:
 
هي مثال لبروقرام يكون السي ان رقم و اسم و يطلع الاسم حق أكبر رقم بس
فرضاً اليوزر كرر أكبر رقم مرتين شلون أطلع الاسمين؟
​
PHP:
 #include<iostream>
 #include<string>
 using namespace std;
 struct Name
 {
  string name;
  int num;
 };

 int main()
 {
 Name x[5];

 for(int i =0; i<5; i++)
 {
  cout << "Enter name ";
  cin >> x[i].name;
  cout << "Enter a number ";
  cin >> x[i].num;
  cout << endl;
 }
 
 int tempMax = x[0].num;
 int Max;
 for(int j=0;j<5;j++)
 { if(tempMax < x[j].num)
 {
  tempMax = x[j].num;
   Max = j;
 }
 }
 cout << "The Max is " << x[Max].name << endl;
 return 0;
 }
​
 
^^
نقدر نسويها بواسطه حركه بسيطه


PHP:
#include<iostream>
#include<string>
using namespace std;
struct Name
{
string name;
int num;
};

int main()
{
Name x[5];
int Max;

for(int i=0; i<5; i++)
{
cout << "Enter name ";
cin >> x[i].name;
cout << "Enter a number ";
cin >> x[i].num;
cout << endl;
}
         
         
    int tempMax = 0 ;
    for(int j=0;j<5;j++) 
    if(tempMax < x[j].num)
    {
    tempMax = x[j].num;
    Max = j;
}
         cout <<"The Max is ";
         for(int i=0;i<5;i++)
         if(tempMax == x[i].num)
         cout<<x[i].name<<"  ";
    cout<<endl;
    system("pause");
         return 0;
         }

ملاحظه :
tempMax عطيتينه قيمه افتراضيه وهي قيمة الاندكس الأول
اذا المفروض تبدأين الloop من i=1
لان اوردي خلصنا من الاندكس الأولي
انا عطيته صفر عشان ابدأ من الاندكس الأول
 
  • Like
التفاعلات: FHJ
ذي اهوه الحل كامل حق السؤال ؟؟
ضروري الررد بليز :99::no:
لا
هذا الحل ، سويته بس ماخليته في الموضوع
اعتذر

PHP:
#include<iostream>
#include<string>
using namespace std;

struct TimeType {
int hour;
int minute;
};


struct lecture {
       string CC;
       int SN;
       int NBS;
       TimeType LT;
       long IDS[40];
};


void Readlecture (lecture &LECT ){
     cout<<"Enter Course code : "<<endl;
     cin>>LECT.CC;
     cout<<"Enter Section number : "<<endl;
     cin>>LECT.SN;
     cout<<"Enter NB of student in the section : "<<endl;
     cin>>LECT.NBS;
     cout<<"Enter lecture time (hour & minute) : "<<endl;
     cin>>LECT.LT.hour>>LECT.LT.minute;
     cout<<"Enter IDS of the students registered in the section : "<<endl;
     for(int i=0 ; i<LECT.NBS;i++)
     cin>>LECT.IDS[i];  
     cout<<endl; 
     }

void Printlecture (lecture LECT){
     cout<<"Course code : "<<LECT.CC<<endl;
     cout<<"Section number : "<<LECT.SN<<endl;
     cout<<"NB of student in the section : "<<LECT.NBS<<endl;
     cout<<"lecture time (hour & minute) : "<<LECT.LT.hour<<":"<<LECT.LT.minute<<endl;
     cout<<"IDS of the students registered in the section : "<<endl;
     for(int i=0 ; i<LECT.NBS;i++)
     cout<<LECT.IDS[i]<<"  ";
     cout<<endl;
     }
int main()
{
lecture L[10];
for(int i=0;i<10 ;i++)
Readlecture(L[i]);

cout<<endl;

cout<<"lectures starting at 08:00 clock : "<<endl;
for(int i=0;i<10 ;i++)
if(L[i].LT.hour == 8 && L[i].LT.minute == 0 )
Printlecture (L[i]);

system("pause");
return 0;
}
 
^^
نقدر نسويها بواسطه حركه بسيطه


PHP:
#include<iostream>
#include<string>
using namespace std;
struct Name
{
string name;
int num;
};

int main()
{
Name x[5];
int Max;

for(int i=0; i<5; i++)
{
cout << "Enter name ";
cin >> x[i].name;
cout << "Enter a number ";
cin >> x[i].num;
cout << endl;
}
         
         
    int tempMax = 0 ;
    for(int j=0;j<5;j++) 
    if(tempMax < x[j].num)
    {
    tempMax = x[j].num;
    Max = j;
}
         cout <<"The Max is ";
         for(int i=0;i<5;i++)
         if(tempMax == x[i].num)
         cout<<x[i].name<<"  ";
    cout<<endl;
    system("pause");
         return 0;
         }

ملاحظه :
tempMax عطيتينه قيمه افتراضيه وهي قيمة الاندكس الأول
اذا المفروض تبدأين الloop من i=1
لان اوردي خلصنا من الاندكس الأولي
انا عطيته صفر عشان ابدأ من الاندكس الأول
شكككككراً على الحل و الملاحظة

و حتى الـint Max ما بنحتاجه
​
 
^^
العفو ، يس ماراح نحتاجه
حتى تحت الif امسحي الstatement الخاصه فيه
 
شكررا عالحل .. :shiny:
 
السلام عليكم

بغيت حل حق هذا السؤال
حليت فيه كبدايه بس احس شوي يخربط

Part A)
Define a class studentType, which has four components:
As private:

  1. studentFName
  2. studentLName of type string
  3. testScore of type float (testScore is between 0 and 100)
As public:

  1. A function to set (studentFName, studentLName and testScore)
void SetData(string, string ,int);

  1. A function to that return (studentFName, studentLName and testScore)
void GetData(string&, string& ,int&);

  1. A function to that compare if the two students have same score.
bool Samescore(const studentType&);



In the main function:

  1. Declare two variable of type studentType named S1 and S2.
  2. Read the Student data into S1 and S2.
  3. Call the function Samescore to compare S1 score with S2 score.
  4. Output all data of student S1.
 
^^
Try and show me your answer
 
^^
Try and show me your answer

#include<iostream>
usind namespace std;
class studentType{
private:
string studentFName;
string studentLName;
float testScore(0<x<100);
public:
void SetData(string a , string b ,float c );
void GetData(string &a, string &b ,float &c);
bool Samescore(const studentType&);
};
void studentType::SetData(string a , string b ,float c )
{
studentFName=a;
studentLName=b;
testScore(0<x<100)=c;
}
void studentType::GetData(string &a, string &b ,float &c)
{
a=studentFName;
b=studentLName;
c=testScore(0<x<100);
}
void studentType::bool Samescore(const studentType&)
int main(){
studentType S1 , S2;
s1.studentType;
s2.studentType;
Samescore;
 
ممكن الحل مال هدا
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.
 
سراب
Good
بس في اخطاء بعضها عاديه وبعضها يعني مادري شقول :)
المهم دققي على Syntax بشكل افضل
مثلا

testScore(0<x<100
مثلا هذا ، هل نستطيع وضع شرط في متغير في وقت واحد ؟؟


بحاول احط الحل في اقرب وقت ممكن ( الليلة اذا شاء الله )

الاخت sayodaa
السؤال سهل ، حاول فيه اول
وراوينا



 
سراب
Good
بس في اخطاء بعضها عاديه وبعضها يعني مادري شقول :)
المهم دققي على Syntax بشكل افضل
مثلا

testScore(0<x<100
مثلا هذا ، هل نستطيع وضع شرط في متغير في وقت واحد ؟؟


بحاول احط الحل في اقرب وقت ممكن ( الليلة اذا شاء الله )




شكراً مقدماً ..
احنا لازم نسلمه الليلة قبل الساعة 12 ! :(

 
اختي هذا الحل واعتذر على التأخير
لان انشغلت

PHP:
#include<iostream>
#include<string>
using namespace std;

class studentType {
      private:
      string FName;
      string LName;
      float testScore;
      public:
      void SetData(string,string,float);
      void GetData(string&,string&,float&);
      bool Samescore(const studentType&);
            };
            
void studentType::SetData(string f ,string l ,float s)
{
     FName=f;
     LName=l;
     if(0<=s && s<=100)
     testScore=s;
     
     }
void studentType::GetData(string &f ,string &l ,float &s)
{    f=FName;
     l=LName;
     s=testScore;
     }
     
    bool studentType::Samescore(const studentType &st)
     {
       if(testScore == st.testScore)
       return true;
       else
       return false;
    }
     
int main()
{
    
    studentType S1,S2;
    string f,l;
    float s;
    bool R;
    
    cout<<"Enter first and last name , and testScore : ";
    cin>>f>>l>>s;
    S1.SetData(f,l,s);
    cout<<endl;
    cout<<"Enter first and last name , and testScore : ";
    cin>>f>>l>>s;
    S2.SetData(f,l,s);    
    cout<<endl;
    
R=S1.Samescore(S2);
if(R)
cout<<"score of S1 = score of S2 "<<endl;
else
cout<<"score of S1 not equal score of S2 "<<endl;

cout<<endl;

    cout<<"All data of student (S1) : "<<endl;
S1.GetData(f,l,s);
cout<<"Name = "<<f<<" "<<l<<endl;
cout<<"His/her test score = "<<s<<endl;    
        cout<<endl;   

    system("pause");
    return 0;
    }

شوفي اذا في شي مو واضح او في شي غلط

نسألكم صالح الدعاء
 
ممكن الحل مال هدا
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.


اني بعد ابي مساعده في هالسؤال رحم الله والديكم
 
^^

رجعتي من الجامعه ان شاء الله
 
@itcs student

اخوي بغيتك تدرسني الفنكشن وشلون نسوي لهم كوول فب المين لان وايد معقد عليه بصراحه وماني فاهم فيه شي وكل ساعه بعطيك تعبك

حده مهم لان دةرت المعاهد ومالقيت .. كلهم راحوا جدام في الماده! !

الستركجر والكلاس كلشي تمان بس عندي مشكله في الفنكشن معقدتني

كلمني عالخاص ماعليك امر ولك مني على كل ساعه كثر ماتبي ..
 
@itcs student

اخوي بغيتك تدرسني الفنكشن وشلون نسوي لهم كوول فب المين لان وايد معقد عليه بصراحه وماني فاهم فيه شي وكل ساعه بعطيك تعبك

حده مهم لان دةرت المعاهد ومالقيت .. كلهم راحوا جدام في الماده! !

الستركجر والكلاس كلشي تمان بس عندي مشكله في الفنكشن معقدتني

كلمني عالخاص ماعليك امر ولك مني على كل ساعه كثر ماتبي ..

اذا مو فاهم الفنكشن ..
ارجع لـ 103 .. انا في الصيفي خذيت 104 ..

كان عندي بعض المشاكل في الفنكشن .. رجعت الى 103 وصار كل شي تمام ..

​
 
السلام عليكم

بغيت حل حق هذا السؤال

مو فاهمة الصراحة

[FONT=&amp]A) [/FONT][FONT=&amp]Add to the program of your previous lab a new struct called DateType with 3 members (day, month and year).[/FONT]​
[FONT=&amp]B) [/FONT][FONT=&amp]Redefine the struct bookType to hold the following information about a book: [/FONT]​
[FONT=&amp]a. [/FONT][FONT=&amp]Title (string),[/FONT]​
[FONT=&amp]b. [/FONT][FONT=&amp]up to four authors (array of strings),[/FONT]​
[FONT=&amp]c. [/FONT][FONT=&amp]number of authors(string),[/FONT]​
[FONT=&amp]d. [/FONT][FONT=&amp]price (float),[/FONT]​
[FONT=&amp]e. [/FONT][FONT=&amp]number of copies in stock(int).[/FONT]​
[FONT=&amp]f. [/FONT][FONT=&amp]Publication Date(DateType).[/FONT]​
[FONT=&amp]C) [/FONT][FONT=&amp]Rewrite the function called ReadOnebook.[/FONT]​
[FONT=&amp]D) [/FONT][FONT=&amp] Rewrite the function called OutputOnebook..[/FONT]​
[FONT=&amp]E) [/FONT][FONT=&amp]Rewrite the function outofstock that receives an array of struct bookType and outputs Tiles of books with 0 copies in stock . [/FONT]​
[FONT=&amp]Use same main function:[/FONT]​
[FONT=&amp]Example of data:[/FONT]​
[TABLE="class: MsoNormalTable, width: 497"]
[TR]
[TD="width: 67"]
[FONT=&amp]Title[/FONT]​
[/TD]
[TD="width: 156, colspan: 4"]
[FONT=&amp]Authors[/FONT]​
[/TD]
[TD="width: 96"]
[FONT=&amp]Nb authors[/FONT]​
[/TD]
[TD="width: 54"]
[FONT=&amp]price[/FONT]​
[/TD]
[TD="width: 228, colspan: 3"]
[FONT=&amp]Publication Date[/FONT]​
[/TD]
[TD="width: 62"]
[FONT=&amp]Nb copies[/FONT]​
[/TD]
[/TR]
[TR]
[TD="width: 37"]
[FONT=&amp]1[/FONT]​
[/TD]
[TD="width: 37"]
[FONT=&amp]2[/FONT]​
[/TD]
[TD="width: 39"]
[FONT=&amp]3[/FONT]​
[/TD]
[TD="width: 42"]
[FONT=&amp]4[/FONT]​
[/TD]
[TD="width: 75"]
[FONT=&amp]day[/FONT]​
[/TD]
[TD="width: 72"]
[FONT=&amp]month[/FONT]​
[/TD]
[TD="width: 81"]
[FONT=&amp]year[/FONT]​
[/TD]
[/TR]
[TR]
[TD="width: 67"]
[FONT=&amp]AAA[/FONT]​
[/TD]
[TD="width: 37"]
[FONT=&amp]A1[/FONT]​
[/TD]
[TD="width: 37"]
[FONT=&amp]A2[/FONT]​
[/TD]
[TD="width: 39"]
[FONT=&amp]A3[/FONT]​
[/TD]
[TD="width: 42"]
[FONT=&amp]A4[/FONT]​
[/TD]
[TD="width: 96"]
[FONT=&amp]3[/FONT]​
[/TD]
[TD="width: 54"]
[FONT=&amp]10.5[/FONT]​
[/TD]
[TD="width: 75"]
[FONT=&amp]12[/FONT]​
[/TD]
[TD="width: 72"]
[FONT=&amp]11[/FONT]​
[/TD]
[TD="width: 81"]
[FONT=&amp]2004[/FONT]​
[/TD]
[TD="width: 62"]
[FONT=&amp]0[/FONT]​
[/TD]
[/TR]
[TR]
[TD="width: 67"]
[FONT=&amp]BBB[/FONT]​
[/TD]
[TD="width: 37"]
[FONT=&amp]B1[/FONT]​
[/TD]
[TD="width: 37"]
[FONT=&amp]B2[/FONT]​
[/TD]
[TD="width: 39"]
[FONT=&amp]B3[/FONT]​
[/TD]
[TD="width: 42"]
[FONT=&amp]B4[/FONT]​
[/TD]
[TD="width: 96"]
[FONT=&amp]1[/FONT]​
[/TD]
[TD="width: 54"]
[FONT=&amp]25.0[/FONT]​
[/TD]
[TD="width: 75"]
[FONT=&amp]1[/FONT]​
[/TD]
[TD="width: 72"]
[FONT=&amp]12[/FONT]​
[/TD]
[TD="width: 81"]
[FONT=&amp]1999[/FONT]​
[/TD]
[TD="width: 62"]
[FONT=&amp]55[/FONT]​
[/TD]
[/TR]
[TR]
[TD="width: 67"]
[FONT=&amp]CCC[/FONT]​
[/TD]
[TD="width: 37"]
[FONT=&amp]C1[/FONT]​
[/TD]
[TD="width: 37"]
[FONT=&amp]C2[/FONT]​
[/TD]
[TD="width: 39"]
[FONT=&amp]C3[/FONT]​
[/TD]
[TD="width: 42"]
[FONT=&amp]C4[/FONT]​
[/TD]
[TD="width: 96"]
[FONT=&amp]2[/FONT]​
[/TD]
[TD="width: 54"]
[FONT=&amp]5[/FONT]​
[/TD]
[TD="width: 75"]
[FONT=&amp]3[/FONT]​
[/TD]
[TD="width: 72"]
[FONT=&amp]7[/FONT]​
[/TD]
[TD="width: 81"]
[FONT=&amp]2011[/FONT]​
[/TD]
[TD="width: 62"]
[FONT=&amp]0[/FONT]​
[/TD]
[/TR]
[/TABLE]
​
 

اذا مو فاهم الفنكشن ..
ارجع لـ 103 .. انا في الصيفي خذيت 104 ..

كان عندي بعض المشاكل في الفنكشن .. رجعت الى 103 وصار كل شي تمام ..

​

عندي الكتاب .. بس مافهمت منه شي! ! لازم احد يشرح =(
 
عودة
أعلى أسفل