471,874 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,874 software developers and data experts.

I Need Help Asap!!!!! Please Help Me

I need help with my problem I am stuck and I don't know what to do!!! The problem is:
This program calculates the charges for DVD rentals where current releases cost $3.5 and all others cast $2.50. If a customer rents several DVDs, every third one of each type is free. You need to tell the user what their total cost of rental whould be based on the amount of Dvds the user enters(decides to rent).

Based on the following input:
3 current 3 others...total cost is 12.00
2 current 2 others...total cost is 12.00
4 current 4 others.....totak cost is 18.00

I started to work it out but now i'm stuck and I don't know how to calculate the formula for the current releases and old dvds with the 3rd one free. Also I don't know how to calculate the 3rd dvd of every kind. This is what I have so far

#include<iostream>
using namespace std;
int main()
{
double total_cost;
int dvds;
new_dvds=3.50;
old_dvds=2.50;
int user_choice;

cout<<"How many DVD's would you like to rent"<<endl;
cin>>dvds;
for(user_choice=dvds;user_choice>=3;user_choice++)
{
if((dvds<3)&&(dvds=old_dvds))
{
total_cost=(2.50*dvds);
}
else if((dvds<3)&&(dvds=new_dvds))
{
total_cost=(3.50*dvds);
}
if((dvds>=3)&&(dvds=new_dvds))
{
user_choice=user_choice+1;
total_cost=3.50*
}
else if((dvds>=3)&&(dvds=old_dvds))
{
user_choice=user_choice+1;
total_cost=2.50*
}



cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);

cout<<"Your Total cost is"<<total_cost<<endl;

system("pause");
return 0;
}

please help me out its due 11:59 to night. I need some free advice I can't afford to pay. thank you
Oct 6 '06 #1
0 1434

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by mike | last post: by
2 posts views Thread by bryan | last post: by
reply views Thread by alaa123 | last post: by
reply views Thread by [Cool staff!||Hi! I think this need for || Help me | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.