Now it might be a bit anoying but i waz looking at Sample code and found out that the code posted above give wrong calculations, so i edited code and here it is:
Screenshot:
Code:
#include <iostream>
#include <String>
using namespace std;
int rental(int,int);
main()
{
string name, movie;
char type;
int days, cost, rentalamount;
cout << "Please Provide Customer Name:\n";
cin >> name;
cout << "Please Provide Movie Description:\n\n";
cout << "Enter 'R' for Regular Movie\n";
cout << "Enter 'C' for Children Movie\n";
cout << "Enter 'N' for New Released Movie\n";
cout << "Enter 'E' for English Movie\n";
cin >> type;
cout << "Movie Name:\n";
cin >> movie;
cout << "Number of day's:\n";
cin >> days;
switch (type)
{
case 'R': cost = 40;
break;
case 'E': cost = 50;
break;
case 'N': cost = 100;
break;
case 'C': cost = 30;
break;
default: cout << "Bad Selection\n";
cost = 0;
}
rentalamount = rental(cost, days);
cout << "Total Rental = " << rentalamount << "RS" << endl;
system ("PAUSE");
return 0;
}
int rental(int cost, int days)
{
int total;
total = cost * days;
return total;
}
Off Topic:
Total Cost: $200 only
but for u i will only cost $ 100
so yea send me $100 on my paypal,
email is: xxx@xxx.xxx.
[ hehe]
Thnx
Bookmarks