www.vustudents.ning.com

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

# Solution of CS201 Assignment #1 (Spring 2010)

Solution of CS201 Assignment #1 (Spring 2010)

Please don't copy & Paste this assignment otherwise u will be get zero marks just take the idea & make ur own assignment solution Thanks

Assignment.cpp

For Important Helping Material related to the subject (Solved MCQs, Short Notes, Solved past Papers, E-Books, FAQ, Short Questions Answers & more). You must view all the featured Discussion in this subject group.

Views: 413

Attachments:

### Replies to This Discussion

can i upload after sume changing?
yeh buddy please uploa so that we can tele both the programes....
Solution:-

//SZ
//Currency Exchange Program
#include
using namespace std;
/*
1 Euro = 112 Rupees.

1 Dollar = 84 Rupees.

1 Euro = 1.33 Dollars

1 Dollar = 0.75 EUR*/

int main()
{
char myCur, convCur;
double myRupees(0), myEuros(0), myDollars(0);
double convertedAmount(0);
bool flag = false;
while(flag == false)
{
cout "Welcome to the Currency Exchange Rate Program!" endl endl endl;
cout "Key Description\n" endl;
cout "R Pakistani Rupees" endl;
cout "E European Euro" endl;
cout "D American Dollar" endl endl;
while( myCur != 'R' && myCur != 'E' && myCur != 'D')
{
cout "Please select the key for the currency you have: ";
cin >> myCur;
myCur = toupper(myCur);
if(myCur == 'R' )
{
cout "Please enter the amount of Rupees you have: ";
cin >> myRupees;
}
else if(myCur == 'E')
{
cout " Please enter the amount of Euros you have: ";
cin >> myEuros;
}
else if(myCur == 'D')
{
cout "Please enter the amount of Dollars you have: ";
cin >> myDollars;
}
else
{
cout "Please enter a valid key" endl;
}
}

do{
cout "Please select the key for the currency you want to convert to: ";
cin >> convCur;
convCur = toupper(convCur);
}while(myCur == convCur);

if (myCur == 'R' && convCur == 'E')
{
// 1 Euro = 112 Rupees.
convertedAmount = myRupees / 112;
}
if (myCur == 'R' && convCur == 'D')
{
//1 Dollar = 84 Rupees.
convertedAmount = myRupees / 84;
}
if (myCur == 'E' && convCur == 'R')
{
// 1 Euro = 112 Rupees.
convertedAmount = myEuros * 112;
}
if (myCur == 'E' && convCur == 'D')
{
// 1 Euro = 1.33 Dollars
convertedAmount = myEuros * 1.33;
}
if (myCur == 'D' && convCur == 'R')
{
//1 Dollar = 84 Rupees.
convertedAmount = myDollars * 84;
}
if(myCur == 'D' && convCur == 'E')
{
// 1 Euro = 1.33 Dollars
convertedAmount = myDollars / 1.33;
}

if(myCur == 'R')
{
cout myRupees " Rupees converted into ";
}
if(myCur == 'E')
{
cout myEuros " Euros converted into ";
}
if(myCur == 'D')
{
cout myDollars " Dollars converted into ";
}

if( convCur == 'R')
{
cout convertedAmount " Rupees" endl;
}
if(convCur == 'E')
{
cout convertedAmount " Euros" endl;
}
if(convCur == 'D')
{
cout convertedAmount " Dollars" endl;
}

cout "\nWould you like to run another conversion? (y/n)" endl;
{
flag = true;
}
system("CLS");
myCur = '\0';
}
system("Pause");
return 0;
}
tariq bhai aap nay go file upload kis ha woh compile to ho rahi ha but iski out put sahi nahi aa rahi aur na hi is programe main yeh user say amount pooch raha ha khud hi out put day data ha woh b eng ar mth k words mix.....aur some time to jub run hota ha to bas run hi rehta ha mean keep loading and so on so can you please help me to solve this???
tariq bhai yeh go aapnay comments main programe likha hua ha is main bhi error day raha ha compiler mughay to samagh nai aae k kis cheez ka error ha line yeh ha...

cout "Welcome to the Currency Exchange Rate Program!" endl endl endl;
yaar still same error aa raha ha
programe compile hi nahi ho raha....
cout "Welcome to the Currency Exchange Rate Program!" endl endl endl;

ishi line main pob aa rahi ha isko red kar daita ha compiler.....:-(
thanks
but i think so that the assignment is from lectures 1 to 7 and some of the elements you
put in the assignment program are not in the lectures. so wlll they create problem???bcoz we have not studied them in lecture 1 to 7 for example you have used #include and getch(); these both are not yet studied in the above mentioned lectures so will they create problem ?????
yar getch(); k bager to ap is ko run hi nai kar sakty keya ap nay submit kara di hai,Muhammad Ali Khan
plz assi assignmnet upload kre jis mian mistakes na hoo . jo sir Tariq ap na upload ki ha os mian 8 errors a rahe hain .
Salam
thanks for helping, i got the idea from the code, no problem if there are mistake , the main idea is to get the concept. Thanks again.

1

2

3

4

5

## VIP Member Badge & Others

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

## Latest Activity

Dream♥Girl joined + M.Tariq Malik's group

### CS606 Compiler Construction

6 hours ago
6 hours ago
Asad waqas added a discussion to the group PSY101 Introduction to Psychology

### PSY101 Final Term Important Topic & Past Papers 2018 to 2021 || psy101 final term important topic

8 hours ago
10 hours ago
10 hours ago
Meera ch and + Ḱẚảḿḯ are now friends
10 hours ago
Sɩɗɗo Rʌjpoot is now friends with Mr Siren Head, Golden Eye, Elegant and Ayaan more
10 hours ago
11 hours ago