oop

on Friday, January 8, 2010

introduced by: yasmen fayez ali
another full model answer for the final practical exam 2008/2009
7al sahl we mashroo7 kwayes

13 comments:

Azzurri said...

totaly good.(Y)..
----
bs nfs al klam brdo point c fi test 4...
maynfa3sh ne3mel al number static...3shan kda haytgher m3 kol rakm gded...
ya3ni awl wa7ed hayb2a rakmo 100001 wel tany hayb2a 100002 hoa wel awl..
3shan kda e7na n5aly al number non-static 3ady...w nem3l counter static..maslan i...ne3mlo add le kol new number fil contractor
as following..
----
public string model;
private int number = 100000;
public static int i = 1;

public Mobile(string model)
{
this.model = model;
number = number + i;
i++;

}
-----
Good Luck
w 3la fkra al linken office 2007..fix it

Anonymous said...

al amt7an bokra al sa3a 2?

Anonymous said...

la2 hwa 3yez el company hya ely t5tar el arkam w fe nafs el wa2t maykonsh fe rakam unused fe ablo rakam used (3ashan y2daro ya5do akbar 3adad mn el arkm)3ashan keda el number lazem ykon static 3shan ykon serial w mykonsh fe rkan unused

Azzurri said...

isA..

Anonymous said...

Azzurri's code is right and it creates a unique number for each object created, hence for each Mobile Account.

And the idea of making the number directly static not only it would make the number a characteristic info for every Mobile anymore because it will changes every time you create an object and you won't be able to recall the value of the previous numbers but also number will be a shared information between all the accounts, for example if u created five Accounts that means u have 5 numbers : 100001,100002,100003,100004,100005...If u checked all numbers will have the same value which is 100005!!!!!!!

Anonymous said...

And btw he didn't ask you to make the company choose, he just asked that customers can't choose their own numbers.

Azzurri said...

yep, right that's i mean..thx(Y)

Azzurri said...

3la fkra bil nesba lel nas ely kant msh 3arfa lazmt bernameg Test 1 fil exam 2009..al pernameg da by7awel mn al decimal le hexadecimal..
3shan kda al second point ely hya 'b'..lma kan bysa2al 3n al output eza kan al input ay rakm positive
de hatb2a egabtha eno hay3mel convert le its hexa number..
:D:D

Azzurri said...

w da lw 3awzen maslan y7awel binary
static void Main(string[] args)
{
Console.WriteLine("Plz enter your Number:");
mystery(int.Parse(Console.ReadLine()));
}



public static void mystery(int x)
{
if (x>= 2)
mystery(x/2);

Console.Write(x%2);

}

-----------------

w brdi lw 3awzeno octal

static void Main(string[] args)
{
Console.WriteLine("Plz enter your Number:");
mystery(int.Parse(Console.ReadLine()));
}



public static void mystery(int x)
{
if (x>= 8)
mystery(x/8);

Console.Write(x%8);

}

-----------
nafs al fkra wa7da...(Y)

TheDrkFR_91 said...

allah 3aleek

mohanad mohamad said...

msa 3alek ya azuri thx alot

Anonymous said...

thanks

Anonymous said...

يا جماعة حد يقولى الدكتور بتاع مادة الداتا بيقول ان الافكار الجديدة من شيت المراجعة احنا عايزيين حلة لو سمحتوا
وجزاكم اللة خيرا

Post a Comment