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

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

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

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

مرحبا
بغيت احد فاهم الستراكت يشرحه اليي ؟ شنو وظيفته ؟ وشلون نكتب الفنكشن اليع عقب ما نعرفه .؟
 
السلام عليكم والرحمة


سكشن 3 :tears:

اذا ماعليكم امر
من منكم فهم الجزء الأخير من الأساينمت
ياريت الي سواه يفهمني شسالفة ؟!!:mellow:
 
السلام عليكم والرحمة


سكشن 3 :tears:

اذا ماعليكم امر
من منكم فهم الجزء الأخير من الأساينمت
ياريت الي سواه يفهمني شسالفة ؟!!:mellow:
ويش هو السؤال ؟ :confused:
 
Using the classes designed at 5 and 6 write a program to simulate a bookstore. The bookstore has two types of customers: those who are members of the bookstore and those who buy books from the bookstore only occasionally. Each member has to pay a $ 10 yearly membership fee and receives a 5% discount on each book purchased.

For each member, the bookstore keeps track of the number of books purchased and the total amount spent. For every eleventh book that a member buys, the bookstore takes the average of the total amount of the last 10 books purchased, applies this amount as a discount, and then resets the total amount spent to 0.

Write a program that can process up to 1000 book titles and 500 members. Your program should contain a menu that gives the user different choices to effectively run the program; in other words, your program should be user-driven.
 
:nosweat: اي عارفة ان اذا الأري فيها 2 كي و نبي الأخير لازم نبحث من النهاية و اذا حصله يسوي الازم بعدين بريك
:rolleyes2: بس بما انه الأخ kaito kid قال ما يحتاج بريك فرضت انه الأري ما فيها الا كي واحد


:shiny:

انا قلت اذا غيرتي أول فور لوب من
كود:
for( int i=size-1;i>0;i--)
إلى
كود:
for( int i=0;i<size;i++)
ما يحتاج بريك :shiny:

يمكن مو عملي بس صح :icon30:
:nosweat: كنت متخربطة بين جهة اليمين و اليسار

اني سويتها بفور لوب وحدة

لأن بما انه بيمسح من النهاية اذا بس نسوي ليه سايز-- لين ما يوصل للكي

:confused: صح تفكيري لو غلط !!!


كود:
    for( int i=size-1;i>0;i--)
    if ( arr[i]==key ) 
	pos=i;
   for (int j=size-1; j>pos; j-- ) 
    size-- ;
:ongue: صح

تحياتي
 
هذي سوال كويز ::ongue:عن الكلاس
q)))write a class called date ;it has three integer day;month;and year.it has the following functions
1)constructor with default vaules parameters.
2)one set and three gets.
3)print to print the month in dd\\mm\\yy or mm\\dd\\yy pass flag to choose which format.
4)IsEqual to compare two dates .
5) days that return the number of days for a given month.
6)Dname that return the date name i.e sunday ;monday....
7)private function called check to make sure the date is correct .it should be used by set and the constrtuctor ;if the day is invalid make the date as 1\1\2000.
****Implement the following function
A)))constructor/
B)))check.​
 
شباب عدي ستفسار بسيط

مثلا عدنا اري 1,2,3,4,5,6
نبي اليوزر يدخل رقم البوزشن وعدد تكرار الحذف
يعني لو دخل رقم البوزشن :2 وعدد تكرار الحذف 2
تصير الاري كتالي 1,2,5,6 يعني يحذف 3,4
لو دخل رقم البوزشن 1 وعدد التكرار 4
تكون الاري كتالي 1,6
بختصار يحذف من اليسار الى اليمين
بهل فكشن
PHP:
void DEL(int arr[],int pos,int& len,int f) 
{ 
	int ii=0;
	while(ii<f)
	{

    for(int i=pos;i<len;i++)      
	
	arr[i]=arr[i+1];
	
    len--; 
	ii++;
	}	
}
طيب اذا ابيه يحذف بالعكس يعني لو كتبت البوزشن :2 والحذف 2
تكونا لاري كتالي 1,4,5,6 يعني 2,3 يطيرون
شلون تصير الفنكشن؟!
 
^^
الفكرة في شي واحد بس :shiny:
هي تغيير مكان الحذف
خله pos-1
عشان تغير المكان اللي يسوي فيه shift​
 
^^^
طريقة أخرى
كود:
arr[i-1]=arr[i];
بس طريقة سيد حسين أسهل :shiny:

تحياتي
 
^^
الفكرة في شي واحد بس :shiny:
هي تغيير مكان الحذف
خله pos-1
عشان تغير المكان اللي يسوي فيه shift​


^^^
طريقة أخرى
كود:
arr[i-1]=arr[i];
بس طريقة سيد حسين أسهل :shiny:

تحياتي

تسلمون ماقصرتون على الرد السريع :clap: وكل فكره احلى من الثانيه :icon30: نخدمكم في الافراح :blush-anim-cl:
 
q)))write a class called date ;it has three integer day;month;and year.it has the following functions

1)constructor with default vaules parameters.

2)one set and three gets.

3)print to print the month in dd\\mm\\yy or mm\\dd\\yy pass flag to choose which format.

4)IsEqual to compare two dates .

5) days that return the number of days for a given month.

6)Dname that return the date name i.e sunday ;monday....

7)private function called check to make sure the date is correct .it should be used by set and the constrtuctor ;if the day is invalid make the date as 1\1\2000.

****Implement the following function

A)))constructor/

B)))check

PHP:
class Date]
}
private:
int y;
int m;
int d;
bool (check(;
public:
Date(int yy=1,int mm=1,int dd=2000);
void set (int yy,int mm, int dd);
 int get y();\\or void get y(int&)
int get m() ;
int get d();
void print (bool f);
bool IsEqual (const Date &D);
int day();
string Dname();
;{
 Date::Date(int yy, int mm int dd);
}
y=yy;
m==mm;
d==dd;
{;
وال check ماعرفتها لو توضحون ليي
في بعد سوال ماحطيته تابع ليه
تبع الامبلمنت
للفنكشن IsEqua
PHP:
Date::IsEqual ( const Date &D)
}
found=false
if(y=D.yy&&m==D.mm&&d==dd)
return true:
l
وفي شي ثاني ماعرفته تابع لنفس السوال :::::
create a main program with array of object of size 366 . set each date to the days of the year starting with 1\1\2010
***print the Date of the first friday in every month.

وماتقصرون............
 
التعديل الأخير:
:rolleyes2:

الإختبـار يوم الأثنيـن له ؟!
بيكـون فويـنه.، والساعَة جَم،
..
راجعوا بخشـونة ها

:shiny:
​
 
في مبنى لآي تي ,, بس السااعه مو متاكده حاليا ً بس جنه من 11 لي 12 ونص مو اكييد
 
مسامحة بحريني,,

عندي عفسة شوي,,
حتى أكثر من PM ما رديت عليهم للحين :nosweat:,,​

الخطوات,,
افتح البرنامج,,
و اضغط
File
New
Project​

بتحصل أكثر من خيار على اليسار,,
تحت الخيار
Visual c++
تحصل كلمة
Win32
اضغطها,,
و في الويندو اللي على اليمين, بتحصل,,
Win32 Console Application
حط الاسم في الفراغ تحت,,
و اضغط OK​

بعدين بتفتح لك وندو جديدة,,
Next
اختار Empty project
اضغط Finish​

بعدين على اليسار, بتحصل أشكال فولدرات,,
Header Files
Recorses Files
Source Files​

اضغط في الفراغ رايتن كليك,,
و اضغط
Add
New Item
على اليسار اختار Code
و في اليمين, اختار
Sorce File (.cpp)
و اختار ليه اسم,,
و اضغط OK​

و اكتب برنامجك,,
و اذا خلصت منه,,
اضغط
Debug
Start without debugging

أو اضغط CTRL + F5​

ِشكراً سيدنا .. ،

الحين صار صح .. بس الايرور زادوا :icon28:.. 12 .. كانوا ولا واحد .. > يمكن لأن كان غلط !!
 
ِشكراً سيدنا .. ،

الحين صار صح .. بس الايرور زادوا :icon28:.. 12 .. كانوا ولا واحد .. > يمكن لأن كان غلط !!

حاضرين,, :nosweat:
المشكلة جذي في البرنامج يعني
جوفي وين الأخطاء,
و حاولي تعدلينهم​
 
حاضرين,, :nosweat:

المشكلة جذي في البرنامج يعني
جوفي وين الأخطاء,

و حاولي تعدلينهم​


اييييي .. كنت أختار أشياء غلط .. مو مثل ما انته خليتهم ..

إن شاء الله .. بحاول ..

--

حاولنا نحل هذا السؤال .. وهذا اللي طلع ويانا .. صح وإلا غلط !!

كود:
void input_points (point_type PTS [], int NBPTS )
for ( int i=0 , i<NBPTS , i++ )
{
cin >>NBPTS [i];
}
for (int j=0,j<PTS , j++)
{
cin >> PTS[j];
}
for ( int x=0, x< ) ------------
 
NBPTS [x]=PTS [x];
 

المرفقات

  • question4.gif
    question4.gif
    24.2 KB · المشاهدات: 47
PHP:
class Date]
}
private:
int y;
int m;
int d;
bool (check(;
public:
Date(int yy=1,int mm=1,int dd=2000);
void set (int yy,int mm, int dd);
 int get y();\\or void get y(int&)
int get m() ;
int get d();
void print (bool f);
bool IsEqual (const Date &D);
int day();
string Dname();
;{
 Date::Date(int yy, int mm int dd);
}
y=yy;
m==mm;
d==dd;
{;
وال check ماعرفتها لو توضحون ليي
في بعد سوال ماحطيته تابع ليه
تبع الامبلمنت
للفنكشن IsEqua
PHP:
Date::IsEqual ( const Date &D)
}
found=false
if(y=D.yy&&m==D.mm&&d==D.dd)
return true:
l
وفي شي ثاني ماعرفته تابع لنفس السوال :::::
create a main program with array of object of size 366 . set each date to the days of the year starting with 1\1\2010
***print the Date of the first friday in every month.

وماتقصرون............
محد يقدر يشوف حلي صح لو لا:mellow:
ويوضح ليي اللي ماعرفته:smile:
 
:
مشكور يالطيب:rolleyes2:
جاري الانتظار:ongue:

حاول تحل أسئلة غير .. بيجي سيد حسين ..

- -

حاولت أحل السؤال في المرفق .. وهذي النتيجة ..
كود:
# include <iostream>
using namespace std;
class Rectangle
{
private :
float length;
float width;
private :
Rectangle ();
void setrectangle (float , float )
void getrectangle (float& , float&)
void findarea(float&,float&);
void display();
~Rectangle ();
};
int main ()
{
Rectangle myrectangle;
myrectangle.setrectangle(5,2);
myrectangle.findarea();
myrectangle.display();
}
return 0;
Rectabgle::Rectangle ( float len , float wid )
{
length=len;
width=wid;
}
void setrectangle::Rectangle (float len , float wid )
{
length=len;
width=wid;
}
void getrectangle::Rectangle (float& len , float&wid)
{
len=length;
wid=width;
}
void findarea::Rectangle(float& len , float&wid)
{
return length*width;
}
void display()
{
cout<<"The length of the rectangle="<<length<<"The width of the rectangle="<<width;
}
Rectangle::~Rectangle ()
{
cout << " Rectangle object Terminated ";
}
 

المرفقات

  • question5.gif
    question5.gif
    42.2 KB · المشاهدات: 48
عودة
أعلى أسفل