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

سي بلس بلس

مغلق
بدأه مبتدئة سي ++ في 6 أبريل 2003 · 0 رد · 371 مشاهدة · في ارشيف قسم C/C++
مشاركة: واتساب X فيسبوك تيليجرام
#1

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

If you have this table

The Car Model Price

BMW 300.000.00 S.R

GMC 200.000.00 S.R

Honda 70.000.00 S.R

Nissan 50.000.00 S.R

Mazda 35.000.00 S.R

write a program to ask the customer

Ask the customer,if he wants to buy a car with a price not less than a given car price ? if the custome ranswer Yes,display the list of car names and it's price as shown in the table

?

After he selects a car with a given car price,ask the user of which

color "Red,Black,Blue,White"he wants

?

Display the result of the car model,prices and color

(e.g:you buy(BMW)car,with(300.000.00 S.R

(it's coloris (Black

في بداية البرنامج يوجد شرط اذاكان يبغى يشترى سيارة أم لاولابد أن نسأل المستخدم عن المبلغ الذي في جيبه اذا كان لايناسب اسعار السيارات يخرج من البرنامج واذا كان يناسبها نسأله عن نوع السيارة ثم أعطيه قائمةبأنواع السيارات(switch)عند اختيار أي سيارة يقارن المبلغ يكفي أولايكفي اذا كان يكفي يرى لون السيارة.

مع ملاحظة لابد من استخدامswitch, if, Bolean.

#include

void main()

{

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

double price;

int car,want;

cin>>want;

if(want!=0);

{

cin>>price;

if((price>35.000.00);

{

cout<<"n1=BMWn";

cout<<"n2=GMCn";

cout<<"n3=Hondan";

cout<<"n4=Nissann";

cout<<"n5=Mazdan";

switch(car)

{

case 1:cout<<"BMW 3n";

break;

case 2:

cout<<"GMC 2";

break;

case 3:

cout<<"zhonda 7n";

break;

case 4:

cout<<"Nisan 5n";

break;

case 5:

cout<<"Mazda35n";

break;

cout<<"nR=Redn";

cout<<"nb=blackn";

cout<<"nB=bluen";

cout<<"nW=whiten";

}

switch(color)

{

case'R':cout<<"nRedn";

break;

case 'b':cout<<"nblackn";

break;

case'B':cout<<"nbluen";

break;

case 'w':cout<<"nWhiten";

}

cout<<"you buy"<

}

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

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