الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

سؤال عاجل جداا؟؟؟؟؟؟؟؟؟؟؟؟؟؟ظ

مغلق
بدأه مبتدئة سي ++ في 11 أبريل 2003 · 3 رد · 569 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله وبركاته

الربامج التالي يطبع السيارة وسعرها ولونها

لكن في جملة cout أريده أن يطبع بدلا من x نوع السيارة وبدلا من y فما الطريق؟

#include<iostream.h>



void main()



{

//y=color



int y; 



char x;//x=car

double money;

int want;



//want رغبة المستخدم

cout<<"n Do you want to buy a car (1=Yes,No=0)?";

cin>>want;

if(want==0)

cout<<"n Do not forget us visit againn";



else

{

cout<<"nBMW ****** its price 300.000.00 S.R";

cout<<"nGMC ****** its price 200.000.00 S.R";

cout<<"nHonda ****** its price 70.000.00 S.R";

cout<<"nNissan ****** its price 50.000.00 S.R";

cout<<"nMazda ****** its price 35.000.00 S.R"; 

cout<<"nHow much cash do you have ?";

cin>>money;

if(money>=30000000)

{

cout<<"n B=BMW";

cout<<"n G=GMC";

cout<<"n H=Honda";

cout<<"n N=Nissan";

cout<<"n M=Mazda";

cout<<"n choose the car model?";

cin>>x; 

switch(x)

{

case 'B':

case 'b':cout<<"n (BMW) car ,with(300.000.00 S.R)n";

break;

case 'G':

case 'g':cout<<"n(GMC) car,with(200.000.00 S.R) n";

break;

case 'H':

case 'h':cout<<"n(Honda)car,with(70.000.00 S.R)n";

break;

case 'N':

case 'n':cout<<"n(Nissan)car,with(50.000.00 S.R)n";

break;

case 'M':

case 'm':cout<<"n(Mazda)car,with(35.000.00 S.R)n";

break;

}

cout<<"n1=Red";

cout<<"n2=Black";

cout<<"n3=Blue";

cout<<"n4=White";

cout<<"nEnter your choose(1-4)?";

cin>>y;

switch(y)

{

case 1:cout<<"Redn";

break;

case 2:cout<<"Blackn";

break;

case 3:cout<<"Bluen";

break;

case 4:cout<<"Whiten";

break;

}

cout<<"nyou buy a "<< x <<" "<<",with "<<

"its color is "<<y; 

}

else

if(money<=20000000)

{

cout<<"n G=GMC";

cout<<"n H=Honda";

cout<<"n N=Nissan";

cout<<"n M=Mazda";

cout<<"n choose the car model ?";

cin>>x;

switch(x)

{

case 'G':

case 'g':cout<<"n(GMC) car,with(200.000.00 S.R) n";

break;

case 'H':

case 'h':cout<<"n(Honda)car,with(70.000.00 S.R)n";

break;

case 'N':

case 'n':cout<<"n(Nissan)car,with(50.000.00 S.R)n";

break;

case 'M':

case 'm':cout<<"n(Mazda)car,with(35.000.00S.R)n";

break;

}

cout<<"n1=Red";

cout<<"n2=Black";

cout<<"n3=Blue";

cout<<"n4=White";

cout<<"nEnter your choose(1-4)?";

cin>>y;

switch(y)

{

case 1:cout<<"Redn";

break;

case 2:cout<<"Blackn";

break;

case 3:cout<<"Bluen";

break;

case 4:cout<<"Whiten";

break;

}

cout<<"nyou buy a "<<x <<" "<<",with "<<

" its color is "<<y;

} 

else

if(money<=7000000)

{

cout<<"n H=Honda";

cout<<"n N=Nissan";

cout<<"n M=Mazda";

cout<<"n choose the car model ?";

cin>>x;

switch(x)

{

case 'H':

case 'h':cout<<"n(Honda)car,with(70.000.00 S.R)n";

break;

case 'N':

case 'n':cout<<"n(Nissan)car,with(50.000.00 S.R)n";

break;

case 'M':

case 'm':cout<<"n(Mazda)car,with(35.000.00S.R)n";

break;

}

cout<<"n1=Red";

cout<<"n2=Black";

cout<<"n3=Blue";

cout<<"n4=White";

cout<<"nEnter your choose(1-4)?";

cin>>y;

switch(y)

{

case 1:cout<<"Redn";

break;

case 2:cout<<"Blackn";

break;

case 3:cout<<"Bluen";

break;

case 4:cout<<"Whiten";

break;

}

cout<<"nyou buy a "<<x<<" "<<",with "<<

" its color is "<<y; 

}

else

if(money<=5000000)

{

cout<<"n N=Nissan";

cout<<"n M=Mazda";

cout<<"n choose the car model ?";

cin>>x;

switch(x)

{

case 'N':

case 'n':cout<<"n(Nissan)car,with(50.000.00 S.R)n";

break;

case 'M':

case 'm':cout<<"n(Mazda)car,with(35.000.00S.R)n";

break;

}

cout<<"n1=Red";

cout<<"n2=Black";

cout<<"n3=Blue";

cout<<"n4=White";

cout<<"nEnter your choose(1-4)?";

cin>>y;

switch(y)

{

case 1:cout<<"Redn";

break;

case 2:cout<<"Blackn";

break;

case 3:cout<<"Bluen";

break;

case 4:cout<<"Whiten";

break;

}

cout<<"nyou buy a "<<x <<" "<<",with "<<

" its color is "<<y; 

}

else if(money==3500000)

cout<<"n M=Mazda";

cin>>x;

switch(x)

{

case 'M':

case 'm':cout<<"n(Mazda)car,with(35.000.00S.R)n";

break;

}

cout<<"n1=Red";

cout<<"n2=Black";

cout<<"n3=Blue";

cout<<"n4=White";

cout<<"nEnter your choose(1-4)?";

cin>>y;

switch(y)

{

case 1:cout<<"Redn";

break;

case 2:cout<<"Blackn";

break;

case 3:cout<<"Bluen";

break;

case 4:cout<<"Whiten";

break;

}



cout<<"nyou buy a "<<x <<" "<<",with "<<

" its color is "<<y;

}











}
#2

اختي البرنامج غير واضح ارجو منك وضعه كمرفق على تكست او برنامج editor اخر

#3

لم أفهم السؤال ....:(

#4

اختي المبتدئه ممكن توضحي اكثر السوال ونحن نساعدك بما قدر الله لنا

يا رسول الله عفوا

اهل فلسطين يحاربون ونحن نيام

ليقم كل منا بواجبه تجاه فلسطين وارض الاسراء والمعراج

يا امة المليار شعب باكمله يباد وانتم تنظرون الى متى تنتظرون

واعلموا ان التاريخ لا يرحم ولن يغفر ولن ينسى

1141244387.gif

1141129327.gif

هذا الموضوع مغلق.

مواضيع مشابهة