Jump to content
منتدى البحرين اليوم

ساعدوني في حل الاسايمنت 4


Recommended Posts

السلاااااااااااااااام

 

 

قوة وشخباركم وشمسويين وعساكم عالقوة انشالله

 

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

 

ممكن اتحلون لي الاسايمنت 4

 

بعد لازم اكتبه ....

 

بعد تستاهلون باكتبه هههههههه

 

 

problem1:

Design a program that prompts the user to enter three names separated by spaces. Using compound and nested if statements, display the names in alphabetical order.

 

SAMPLE OUTPUT:

Please enter 3 names: George Joe Adam

The alphabetical order of the names is:

Adam

George

Joe

 

 

هاي بروبلم 1 عاد بروبلم 2 اشطوله اذا عندكم اياه وتحلونه رحم الله والديكم : والله اذا بغيتو باكتبه

 

 

ومشكووووووورين ويعطيكم الف الف عااااااافية

 

 

 

 

تحيااااااااتي

Link to comment
Share on other sites

السلاااااااااااااااام

 

مشكووور اخوي على مرورك

 

واشكرك مقدما على المساعدة

 

واذا انه بعد عرفت احله راح احط الجواب

 

 

 

تحيااااااااتي

Link to comment
Share on other sites

 

 

السلاااااااااااااااااااام

 

 

هلا ومرحبا فيكم

 

بس ليش محد حل الاسايمنت ؟؟

خاصة بروبلم تو

 

انه مو عارفه اسويها عدل يطلع ايرور

 

وبيني وبينكم صراحة مو متفرغة اجوف شالسالفة لان عندي امتحانات هالاسبوع وللحين ماسلمت الاسايمنت

 

رحم الله والديكم ساعدوني في حله ويعطيكم الف الف عافية

 

 

 

تحياااااااااااتي

 

 

Link to comment
Share on other sites

مرحبا اختي شايمة الجامعة

 

هذي الحل حق problem1

 

#include <iostream>

#include <string>

using namespace std;

int main()

{

string str1,str2,str3;

string first,second,third;

 

cout<<"Please enter 3 names:";

cin>> str1>>str2>>str3;

 

if (str1<str2 && str1<str3)

{

first= str1;

if(str2<str3)

{

second=str2;

third=str3;

}

else

{

second=str3;

third=str2;

}

}

 

else if (str2<str1 && str2<str3)

{

first=str2;

if(str1<str2)

{

second=str1;

third=str3;

}

else

{

second=str3;

third=str1;

}

}

 

 

else

{

first=str3;

if(str1<str2)

{

second=str1;

third=str2;

}

else

{

second=str2;

third=str1;

}

}

 

cout<<"The alphabetical order of the names is:";

cout<<first<<endl;

cout<<second<<endl;

cout<<third<<endl;

 

system("pause");

return 0;

 

}

 

و بروبلم 2 للحين ما حليته

 

تمنياتي للجميع بالتوفيق

 

:)

 

 

Link to comment
Share on other sites

#include<iostream>

#include<string>

using namespace std;

int main()

{

 

string name1, name2, name3;

 

cout<<"Please enter 3 names:";

cin>>name1>>name2>>name3;

 

 

cout<<"The alphabetic order of the names is :"<<endl;

 

 

if((name1<name2)&&(name1<name3))

 

{

cout<<name1<<endl;

 

if(name2<name3)

{

cout<<name2<<endl;

cout<<name3<<endl;

}

 

else

{

cout<<name3<<endl;

cout<<name2<<endl;

}

 

 

}

 

 

if((name2<name1)&&(name2<name3))

{

cout<<name2<<endl;

 

if(name1<name3)

{

cout<<name1<<endl;

cout<<name3<<endl;

}

 

else

{

cout<<name3<<endl;

cout<<name1<<endl;

}

 

}

 

if((name3<name1)&&(name3<name2))

{

cout<<name3<<endl;

 

if(name1<name2)

{

cout<<name1<<endl;

cout<<name2<<endl;

}

 

else

{

cout<<name2<<endl;

cout<<name1<<endl;

}

 

}

 

return 0;

}

 

هذي بربلم ون بس بطريقه ثانيه يعني للي يبي

 

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

Link to comment
Share on other sites

 

وهذي حل بربلم توو

 

#include<iostream>

#include<string>

 

using namespace std;

 

int main()

{

int x;

 

cout<<" enter the model num of your choich"<<endl;

cout<<"model100:remote control,timer,and stereo for $1000"<<endl;

cout<<"model200:remote control,timer,plus picture-in picture,for $1200"<<endl;

cout<<"model300:remote control,timer,and stereo for $1000,picture-in-picture,for $1200,plus hdtv,flat screen,and a16×9 aspect ratio,for $2400"<<

endl;

 

cin>>x;

switch(x)

{

case 100:

{cout<<"you choose model 100 tv with these feature:remote control,timer,and stereo"<<endl;

cout<<"your price will be $1000"<<endl;

break;

}

case 200:

{cout<<"you choose model 200 tv with these feature:picture-in-picture,remote control,timer,and stereo sound"<<endl;

cout<<"your price will be $1200"<<endl;

break;

}

 

case 300:

{ cout<<"you choose model 300 tv with these feature:picture-in-picture,remote control,timer,and stereo sound,hdtv,flat screen,and a 16×9 aspect ratio"<<endl;

cout<<"your price will be $2400"<<endl;

break;

}

 

default: cout<< "invalid number"<<endl;

break;

}

//end switch

return 0;

 

}

 

 

Link to comment
Share on other sites

السلااااااااااام

 

مشكوريييييييين ويعطيكم الف الف الف عاااافية

 

مشكورة حبيبتي مهتاب

 

ومشكور ياخوي بوجسووم

 

والله ايوفقنه انشالله في امتحان المنتصف والنهائي

 

 

تحيااااتي

 

Link to comment
Share on other sites

ميرسي بوجسوم

 

ومشكوووووووووووووووووووووووور

 

وان شاء الله نسوي زين بالمد تيرم يارب

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
الرد على هذا الموضوع...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...