well the Thinking About Programming - A Guide for Beginners
I gain trough mail I try it out
well I could do alone all except to break the program if
Code:
(video1 && video2) < 1
or something like that
well problem occurs with days
I gave that lot if cuz if 1 day cannot be 1 days
so that if you say 1 day it musnt come out 1 days
and when I try to put in
Code:
(video1 && video2) < 1
it's problem cuz it doesn't look at all other if-s
how could I repair this problem???
I'm out of ideas
Code:
#include <iostream>
using namespace std;
int main ()
{
int x;
int y;
int video1;
int video2;
cout << "we have 2 available videos to rent\n\n";
cout << "1 - yes\n_____________________\n1. video costs 2.00$ |\n";
cout << "2. video costs 3.00$ |\n";
cout << "_____________________|\n";
cout << "\n\n\n\n2 - no\n_____________________\nexit |\n";
cout << "_____________________|\n\n\n\n\n";
cout << "would you like to rent any of videos?\n";
cin >> x;
if (x == 2)
{cout <<"good bye\n";}
else if (x == 1)
{
cout << "\n\nwould you like to rent video1?\n";
cout << "this video costs 2.00 $\n";
cout << "for how many days would you like to rent video 1\n";
cin >> video1;
cout << "\n\nwould you like to rent video 2?\n";
cout << "this video costs 3.00$";
cout << "for how many days would you like to rent video 2\n";
cin >> video2;
if (video1 > 1)
{cout << "\n\n\nvideo 1 is rented for: "<< video1 <<" days\n";}
else if (video1 == 1)
{cout << "\n\n\nvideo 1 is rented for: "<< video1 <<" day\n";}
else
{cout << "\n\n\nvideo 1 is not rented\n";}
if (video2 > 1)
{cout << "video 2 is rented for: "<< video2 <<" days\n\n";}
else if (video2 == 1)
{cout << "video 2 is rented for: "<< video2 <<" day\n\n";}
else
{cout << "video 2 is not rented\n";}
cout << "total cost of video 1 is: " << video1*2.00 << "$\ntotal cost of video 2 is: " << video2*3.00 << "$\n\n";
cout << "total cost is: " << video1*2.00 + video2*3.00 <<"$\n";
}
system ("pause");
return 0;
}