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

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

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

ITCS103 -CSC103-ITCS111-ITCS101 للدراسة و المناقشة الجماعيه 2014-2015

ما هو رأيك في الحصة و بشكل عام ( الشرح - المواضيع -الأسلوب )؟

  • سيئ ، لم أفهم شيئا .

    الأصوات: 9 28.1%
  • جيد ، فهمت نص و نص .

    الأصوات: 10 31.3%
  • ممتاز ، واضح و مقبول .

    الأصوات: 13 40.6%

  • مجموع المصوتين
    32

و عليكم السلام

أول خطأ كان طبعا في الـwhile
لازم
PHP:
while(GPA>=0.0)

بعدين في المسج اللي يطلع عند كل معدل
PHP:
if(GPA>=0&&GPA<=1.99)
cout<<"The student is placed on the dean's honor list"<<endl;
!!
المفروض يسأل هني جم مرة رسب
مو يحطونه في لوحة الشرف للعميدة :mellow:
و حتى يوم قلتي له
PHP:
cin>>sf;
ماقلتي له شنو يسوي بالـsf اللي دخلها :mellow:

و هذا المسج طبعا لازم يكون داخل الـwhile
PHP:
cout<<"Enter astudent GPA (or negative to stop):"<<endl;
عشان يكرر اللوب


و هذا الحل الصحيح
PHP:
#include <iostream>
using namespace std;
int main()
{
double GPA;
int sf;

cout<<"Enter a student GPA (or negative to stop):"<<endl;
cin>>GPA;

while(GPA>=0.0 && GPA<=4.0)
{
	if(GPA<=1.99)
	{
		cout<<"How many previous semester have the student falied:"<<endl;
		cin>>sf;
		{
			if(sf>=2)
				cout<<"The student is suspended."<<endl;
			else
				cout<<"The student is on probation."<<endl;
		}	
	}

		else if(GPA>=2.00 && GPA<=2.99)
			cout<<"The student has passed the semester."<<endl;
		
		else if(GPA>=3.00 && GPA<=3.49)
				cout<<"The student is placed on the dean's honor list"<<endl;
		
		else if (GPA>=3.50)
				cout<<"The student is placed on the president 's honors list"<<endl;

		cout<<"Enter a student GPA (or negative to stop):"<<endl;
		cin>>GPA;

}


return 0;
}
 
(5)
What will the value of n be after execution of the following code?
int n=-1;
for (int i=0; i<9;i++)
if(i%2) n++;

(6)
What will the value of n be after execution of the following code?
int n=0;
for(int i=0; i<=5; i++)
n+=i*2;
شنو حل هالسؤالين مافهمتهم
أبي أعرف في المدتير شنكتب حلهم بالضبط لو سمحتوا
 
(2) Find the output of the following C++ statements given the input: 55.5 11 22
int main()
{
int x; char ch; float z;
cin>> x>>z>>ch;
cout<<x<<" "<<ch<<" "<<z<<endl;
return 0;
}

الجواب 0.5 1 55
بس ابي اعرف الفلوت ليش صار 0.5؟؟
(3) Find the output of the following C++ statements given the input: 55.5 11 22
int main()
{
int x; char ch; float z;
cin>>ch>>z>>x;
cout<<x<<" "<<ch<<" "<<z<<endl;
return 0;
}

الجواب 5.5 5 11
هذي بس عرفت الكركت بس الفلوت و الأنتجر شلو صارو هلون؟؟؟؟؟
 
(2) Find the output of the following C++ statements given the input: 55.5 11 22
int main()
{
int x; char ch; float z;
cin>> x>>z>>ch;
cout<<x<<" "<<ch<<" "<<z<<endl;
return 0;
}

الجواب 0.5 1 55
بس ابي اعرف الفلوت ليش صار 0.5؟؟

(3) Find the output of the following C++ statements given the input: 55.5 11 22
int main()
{
int x; char ch; float z;
cin>>ch>>z>>x;
cout<<x<<" "<<ch<<" "<<z<<endl;
return 0;
}

الجواب 5.5 5 11
هذي بس عرفت الكركت بس الفلوت و الأنتجر شلو صارو هلون؟؟؟؟؟

بالنسبه حق اول سؤال اختي اليوزر دخل 55.5 11 22
والانبوت حسب البرنامج اول شي الانتجر وبعده الفلوت وبعده الكاراكتر..
وخلنا نمشي من اليسار الى اليمين حسب اللي دخله اليوزر 55.5 11 22
الانتجر بياخذ الرقم 55 وبيوقف عند النقطه لان الانتجر ما يقرا فواصل ويبقى عندنا .5 11 22
وبالتالي لفلوت بياخذ .5 وبيوقف عند لسبيس ويبقى عندنا 11 22
واخر شي الكاراكتر بياخذ اول رقم او اول رمز يلقاه وهو الرقم 1 ويبقى عندنا 1 22 بيتجاهلهم البرنامج..


اما بالنسبه حق ثاني سؤال..
عندنا اول شي لازم يدخله اليوزر كاراكتر وبعده رقم من نوع فلوت وبعده رقم من نوع انتجر..
و الانبوت اللي دخله اليوزر 55.5 11 22 وبنمشي بالترتيب من اليسار الى اليمين كالتالي
اول شي الكاراكتر بياخذ الرقم 5 وبيوقف ويبقى عندنا 5.5 11 22
وبعده لفلوت بياخذ الرقم المكون من فاصله عشريه اللي هو 5.5 وبيوقف عشان في سبيس ويبقى عندنا 11 22
واخر شي الانتجر بياخذ الرقم 11 ويوقف عند لسبيس والباقي 22 يتم تجاهله من قبل البرنامج..
وراح يطلعهم على الشاشه على حسب الترتيب cout<<x<<" "<<ch<<" "<<z<<endl

واتمنى إني وفقت في الشرح واذا في شي مو واضح خبريني :rolleyes2:

 
write a program that ask the user to enter id and Gpa of 50 students.The prgrm shld output into a new file RESULT.DAT the ID,the GPA with two deciaml places and the result either (PASS or FAIL)seperated by space, each student record in a new line.


The result is PASS if GPA is greater than or equal to 2.0, FAIL otherwise.



i.e. if the firsttwo inputs is 20071122 1.8 and 20072233 3.7 then the first two lines in the file should be
كود:
20071122 1.8 FAIL
20072233 3.7 PASS



من امتحان سابق​


هذا الحل بس اذا ماعليكم امر تشوفونه لي صح او خطأ :blush-anim-cl:

PHP:
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int main ()
{
	ofstream fout;
	fout.open("RESULT.txt");

	int ID,counter=1;
	double GPA;

	cout<<"Enter the ID and GPA:"<<endl;
	cin>>ID>>GPA;

	fout<<fixed<<showpoint<<setprecision(2);

	while (counter<=50)
	{
		
	if(GPA>=2.0)
		 fout<<ID<<" "<<GPA<<" "<<"pass"<<endl;
	else fout<<ID<<" "<<GPA<<" "<<"fail"<<endl;

	counter++;
	cout<<"Enter the ID and GPA:"<<endl;
	cin>>ID>>GPA;
	}

	return 0;
}
 
هذا الحل بس اذا ماعليكم امر تشوفونه لي صح او خطأ :blush-anim-cl:

PHP:
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int main ()
{
	ofstream fout;
	fout.open("RESULT.txt");

	int ID,counter=1;
	double GPA;

	cout<<"Enter the ID and GPA:"<<endl;
	cin>>ID>>GPA;

	fout<<fixed<<showpoint<<setprecision(2);

	while (counter<=50)
	{
		
	if(GPA>=2.0)
		 fout<<ID<<" "<<GPA<<" "<<"pass"<<endl;
	else fout<<ID<<" "<<GPA<<" "<<"fail"<<endl;

	counter++;
	cout<<"Enter the ID and GPA:"<<endl;
	cin>>ID>>GPA;
	}

	return 0;
}


تمام التمام , 9 من عشرة :showoff:

الاخطاء ,,
الفايل اسمه RESULT.dat وليس RESUALT.txt

ولازم تكتب عبارة الـcout و الـ cin اللي صايرة برى اللوب , تكتبها داخل اللوب وتشيل اللي حطيتهم في نهايتها
السبب , لو شغلت البرنامج عندك وخليته يدخل مثلن حق 4 طلاب بس , بتلاقي في كودك السابق ان عبارة Enter the ID and GPA تطلع 5 مرات مو 4 مرات

عشان جذي قلت لك خلها داخل اللوب , عشان اهي نفسها تتكرر فقط 4 مرات :rolleyes2:

وبالتوفيق :icon31:
 

تمام التمام , 9 من عشرة :showoff:

الاخطاء ,,
الفايل اسمه RESULT.dat وليس RESUALT.txt

ولازم تكتب عبارة الـcout و الـ cin اللي صايرة برى اللوب , تكتبها داخل اللوب وتشيل اللي حطيتهم في نهايتها
السبب , لو شغلت البرنامج عندك وخليته يدخل مثلن حق 4 طلاب بس , بتلاقي في كودك السابق ان عبارة Enter the ID and GPA تطلع 5 مرات مو 4 مرات

عشان جذي قلت لك خلها داخل اللوب , عشان اهي نفسها تتكرر فقط 4 مرات :rolleyes2:

وبالتوفيق :icon31:

الفايل انا كتبت اسمه نفس ماهو مطلوب في السؤال RESULT.dat بس طلع لي نوع فيديو وما يشتغل وما قدرت اشوف الاوتبوت من جذي خليته RESUALT.txt :sad_1: ونسيت اغيره ههههه

وتسلمين اختي على التمارين والتصحيح ويعطيج العافيه :icon30:
 
(5)
What will the value of n be after execution of the following code?
int n=-1;
for (int i=0; i<9;i++)
if(i%2) n++;

(6)
What will the value of n be after execution of the following code?
int n=0;
for(int i=0; i<=5; i++)
n+=i*2;
شنو حل هالسؤالين مافهمتهم
أبي أعرف في المدتير شنكتب حلهم بالضبط لو سمحتوا

يبونش تكتبين الأوت بوت مالهم
يبونش تعطينهم قيمة الـ n في النهاية من بعد ما يخلص البرنامج شغله


السؤال الأول :
في البداية قيمة n=-1 بندخل اللوب , ومثل ما موجود ان قيمة i=0
طيب ,,

بنمر عقبها على الـ if اذا تحققت بنزيد الـ n بواحد
أول مرة لما كانت الـ i=0 الشرط ما يتحقق
فما راح نمر على الـ if وبتظل الـ n=-1

عقب , الـ i بتصير i=1 لان في الفور لوب قال لي ++i ,
نفس الشي هني , بنمر على الـ if بنشوف هل يتحقق الشرط أو لا
1 قسمة 2 , هنا يوجد باقي القسمة
إذن ما بنزيد الـ n , و بنرجع للوب مالتنا وبنزيد الـ i بواحد وبتصير 2

وهكذا , إلى أن توصل الـ i=8 لان 8 أقل من 9 مثل ما هو موجود في شرط اللوب
وعقبها بنوقف


وبتشوفين ان قيمة الـ n من بعد ما خلصتي اللوب تساوي 3​
 
الفايل انا كتبت اسمه نفس ماهو مطلوب في السؤال RESULT.dat بس طلع لي نوع فيديو وما يشتغل وما قدرت اشوف الاوتبوت من جذي خليته RESUALT.txt :sad_1: ونسيت اغيره ههههه

وتسلمين اختي على التمارين والتصحيح ويعطيج العافيه :icon30:

عجل بنزيدك نص , 9.5 من عشرة :shiny:

الله يعافيك​
 
المدتيرم الى اي موضوع قالولكم؟؟؟ :nosweat:

احنه الدكتور قال لنا المواضيع اللي داشين في المدتيرم
numbering system
chapter 1
chapter 2
chapter 3
chapter 4
chapter 5 (except for, do-while, nested)


في موضوع اسمه End of file مو فاهمه ياليت احد يشرحه :tears:
 
المدتيرم الى اي موضوع قالولكم؟؟؟ :nosweat:

احنه الدكتور قال لنا المواضيع اللي داشين في المدتيرم
numbering system
chapter 1
chapter 2
chapter 3
chapter 4
chapter 5 (except for, do-while, nested)


في موضوع اسمه End of file مو فاهمه ياليت احد يشرحه :tears:

قصدك اللي في هالمثال :



PHP:
while (!inputfile.eof())
{
inputfile>>name>>GPA;
cout<<name<<GPA<<endl;

}


هذي تدلك على نهاية الفايل

خل نفرض ان الفايل المذكور inputfile فيه معلومات واجد (اسم الطالب و معدله ) , وماندري حق جم واحد بالضبط
والمطلوب منا كان : قراءة الموجود فيه وطباعته على الشاشة

اذن ومما لا شك فيه راح نستخدم لوب , وبنبتدي من اول الفايل الى نهايته
اذن لحد ما نوصل الى end of file



أو بامكانك تقول :



PHP:
while(inputfile>>name>>GPA)
{
cout<<name<<GPA<<endl;

}
 
كود وأصعاب السعاده مااااااااااااااااااقصرتو
عندي سؤااال ههههه
Question 4 ( 10 Points)
Hesham
(selection and repetition)
A factory creates electricity cables, all of which are tested to find their CableFactor.
Cables are classified for sale as either grade A or grade B. Grade A cables are guaranteed
to have a CableFactor of between 5.5 and 6.5, whereas grade B cables are of a lower
quality, with a CableFactor of between 4.5 and 7.5. Any cable with a CableFactor outside
of this range are rejected and not sold. Write a quality control program, that prompts the
user for the CableFactor of each Cable, and then classifys it as either grade A, grade B or
a reject. The program should continue until the user enters a negative number to quit.
The output should look similar to the following:
Cable Quality Control
Enter CableFactor (or a negative number quit): 5.7 Grade A
Enter CableFactor (or a negative number quit): 7.2 Grade B
Enter CableFactor (or a negative number quit): 4.1 *** reject ***
Enter CableFactor (or a negative number quit): -1
Goodbye.
Page 10 of 12
A.fattah
1) Write a complete C++ program that:
· Prompts the user to enter from the keyboard 2 integers separated by an operator
symbol (+,-,*,/). “
· Uses switch statement to perform the operation indicated by the operator symbol:
“+“ for addition, “-“ for subtraction, “*“ for multiplication, and”/“ for division.
Entering other operator symbols causes the program to print error message and
quit the program.
· Displays the entered numbers separated by the operator symbol and the result.
Values are separated by tabs.
For example: if the user entered 20+60, the program should print: 20 + 60 =
80.
Write a C++ program that reads an integer number that represents a 4-digit binary
number (the integer number consists of 4 digits) from an input file named “binary.dat”.
The program should convert the binary number to decimal number and print the binary
number and its corresponding decimal number in an output file named “decimal.dat”.
The input and output files should be:
1101 The binary number is 1101
The equivalent decimal number is 13

هذي مدتير قديم بس أبي أعرف جم برنامج يبون الأسئلة ورابعض مب فهمة وشنو معناة
selection and repetition)
والأسئلة أنحلهم في ورقه خارجيه لأنه مافي مكان في الورقه؟؟؟؟ أدري سؤال بايخ بس شاسوي وسواس
 
Question 5 ( 15 Points)
A set of people have applied for a driver’s license. Not all of them are eligible since some
are younger than 18 years old. Write a C++ program that will help calculate how many
are eligible and how many are not. Your program should ask first for the current year.
Then it should enter the year of birth of the candidates. Use -1 as a termination value to
stop entering data. A sample output might look like the following:
Nahla
* Write a program that reads daily temperatures, as floats from a file until
end of file. Your program should print the maximum and minimum
temperature values and the average of all temperatures. You can assume
that there is at least one input data value.
Yaqoob
Write a C++ program that ask the user to enter ID number and GPA of 50
students. The program should output into a new file RESULT.DAT the
ID, the GPA with 2 decimal places and the result (either PASS or FAIL)
for each student. The result is PASS if GPA is greater than or equal to
2.0, FAIL otherwise.
Enter the current year: 2007
Please start entering year of birth of candidates (-1 to
stop)
2000
1980
1983
1999
1984
1987
1960
1997
1998
1983
1983
-1
The number of eligible candidates= 6
The number of non-eligible candidates= 4

A perfect number is a positive integer that is equal to the sum of its proper divisors. A
proper divisor is a positive number other than the number itself that divides the number
evenly (no remainder). For example, 6 is a perfect number because the sum of its proper
divisors 1, 2, and 3 is 6. eight (8) is not a perfect divisor because 1+2+4 is not equal to 8.
Write a complete C++ program that reads an integer and determines whether the number
is perfect number or not. Your program should also print the proper divisors of the
number.
Your program RUN (Input/Output) should be as follows:
Enter a number: 6
The proper divisors of the number 6 is 1 2 3
6 is a perfect number
OR as follows:
Enter a number: 8
The proper divisors of the number 8 is 1 2 4
8 is not a perfect number

وهذي نفس الشي.؟؟؟
 


قصدك اللي في هالمثال :



PHP:
while (!inputfile.eof())
{
inputfile>>name>>GPA;
cout<<name<<GPA<<endl;

}


هذي تدلك على نهاية الفايل

خل نفرض ان الفايل المذكور inputfile فيه معلومات واجد (اسم الطالب و معدله ) , وماندري حق جم واحد بالضبط
والمطلوب منا كان : قراءة الموجود فيه وطباعته على الشاشة

اذن ومما لا شك فيه راح نستخدم لوب , وبنبتدي من اول الفايل الى نهايته
اذن لحد ما نوصل الى end of file



أو بامكانك تقول :



PHP:
while(inputfile>>name>>GPA)
{
cout<<name<<GPA<<endl;

}

تسلمين اختي كود والله لا يهينج
وصلت الفكره :clap:
 
كود وأصعاب السعاده مااااااااااااااااااقصرتو
عندي سؤااال ههههه
Question 4 ( 10 Points)
Hesham
(selection and repetition)
A factory creates electricity cables, all of which are tested to find their CableFactor.
Cables are classified for sale as either grade A or grade B. Grade A cables are guaranteed
to have a CableFactor of between 5.5 and 6.5, whereas grade B cables are of a lower
quality, with a CableFactor of between 4.5 and 7.5. Any cable with a CableFactor outside
of this range are rejected and not sold. Write a quality control program, that prompts the
user for the CableFactor of each Cable, and then classifys it as either grade A, grade B or
a reject. The program should continue until the user enters a negative number to quit.
The output should look similar to the following:
Cable Quality Control
Enter CableFactor (or a negative number quit): 5.7 Grade A
Enter CableFactor (or a negative number quit): 7.2 Grade B
Enter CableFactor (or a negative number quit): 4.1 *** reject ***
Enter CableFactor (or a negative number quit): -1
Goodbye.
Page 10 of 12
A.fattah
1) Write a complete C++ program that:
· Prompts the user to enter from the keyboard 2 integers separated by an operator
symbol (+,-,*,/). “
· Uses switch statement to perform the operation indicated by the operator symbol:
“+“ for addition, “-“ for subtraction, “*“ for multiplication, and”/“ for division.
Entering other operator symbols causes the program to print error message and
quit the program.
· Displays the entered numbers separated by the operator symbol and the result.
Values are separated by tabs.
For example: if the user entered 20+60, the program should print: 20 + 60 =
80.
Write a C++ program that reads an integer number that represents a 4-digit binary
number (the integer number consists of 4 digits) from an input file named “binary.dat”.
The program should convert the binary number to decimal number and print the binary
number and its corresponding decimal number in an output file named “decimal.dat”.
The input and output files should be:
1101 The binary number is 1101
The equivalent decimal number is 13

هذي مدتير قديم بس أبي أعرف جم برنامج يبون الأسئلة ورابعض مب فهمة وشنو معناة
selection and repetition)
والأسئلة أنحلهم في ورقه خارجيه لأنه مافي مكان في الورقه؟؟؟؟ أدري سؤال بايخ بس شاسوي وسواس

اول شي اختي هالاسئله على الوحدتين الرابعه والخامسه واذا ترجعين حق الكتاب بتشوفين العنوان selection على الوحده الرابعه والعنوان repetition على الوحده الخامسه اما بالنسبه للاوراق ما ادري بصراحه لكن انا شفت امتحانات سابقه فيهم مساحه كافيه للاجابه واذا مافي مساحه بنسوي حطيه ربيتين بنشتري لهم اوراق :bleh:

هم 3 اسئله وهذا اول سؤال:
A factory creates electricity cables, all of which are tested to find their CableFactor.
Cables are classified for sale as either grade A or grade B. Grade A cables are guaranteed
to have a CableFactor of between 5.5 and 6.5, whereas grade B cables are of a lower
quality, with a CableFactor of between 4.5 and 7.5. Any cable with a CableFactor outside
of this range are rejected and not sold. Write a quality control program, that prompts the
user for the CableFactor of each Cable, and then classifys it as either grade A, grade B or
a reject. The program should continue until the user enters a negative number to quit.
The output should look similar to the following:
Cable Quality Control
Enter CableFactor (or a negative number quit): 5.7 Grade A
Enter CableFactor (or a negative number quit): 7.2 Grade B
Enter CableFactor (or a negative number quit): 4.1 *** reject ***
Enter CableFactor (or a negative number quit): -1
Goodbye.


وهذا السؤال الثاني:
1) Write a complete C++ program that:
· Prompts the user to enter from the keyboard 2 integers separated by an operator
symbol (+,-,*,/). “
· Uses switch statement to perform the operation indicated by the operator symbol:
“+“ for addition, “-“ for subtraction, “*“ for multiplication, and”/“ for division.
Entering other operator symbols causes the program to print error message and
quit the program.
· Displays the entered numbers separated by the operator symbol and the result.
Values are separated by tabs.
For example: if the user entered 20+60, the program should print: 20 + 60 =


وهذا السؤال الثالث:


Write a C++ program that reads an integer number that represents a 4-digit binary
number (the integer number consists of 4 digits) from an input file named “binary.dat”.
The program should convert the binary number to decimal number and print the binary
number and its corresponding decimal number in an output file named “decimal.dat”.
The input and output files should be:
1101 The binary number is 1101
The equivalent decimal number is 13


واذا في شي مو فاهمته من الاسئله احنه في الخدمه :icon30:
 
السلام طلبتكم فلا تردوني :sad_1::sad_1:

اني طالبة مستجدة ادرس bis :nosweat::nosweat:

مو فاهمة شي من جبتر 5 :icon1366::icon1366:

لو سمحتون اذا ما عليكم امر تقدرون تشرحونه ليي (( وعلى قولة القايل .... ارحم عبيدا ذل )) :tears::tears:

فساعدوني ارجوكم لاني واقفة عند جبتر 5 واقراه واقراه بعد ماافهم منه شي ولا اعرف متى استخدم القوانين اللي فيه :tears::tears:


فطلبتكم ولا تردوني :rolleyes2::smile::rolleyes2:
 
حياك الله أصحاب السعادة ,,

سواري اليقين ,, شنو الدرس اللي مو عارفة له ؟
 
بصراحة خيوووو كله مو فاهمتة :sad_1::sad_1:

وارجو المساعدة اذا ممكن:tears:

اذا ما تقدرين لا تضغطين على روحج :rolleyes2::rolleyes2:

والله كريم الله ما يخلي عباده:smile::smile:
 
بصراحة خيوووو كله مو فاهمتة :sad_1::sad_1:

وارجو المساعدة اذا ممكن:tears:

اذا ما تقدرين لا تضغطين على روحج :rolleyes2::rolleyes2:

والله كريم الله ما يخلي عباده:smile::smile:

طيب خيو , شنو الدروس اللي في هالجابتر ؟
الكتاب مالكم مو عندي
عشان جذي سألت​
 
هااااا شعندكم قاعدين هالحزة تعقرون على من<<< فاضي هالآدمي هههههه :bleh:
 
عودة
أعلى أسفل