| | |
Please Help Me.
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Oct 2009
Posts: 13
Reputation:
Solved Threads: 0
Can someone give me the complete code of the following problem:
Problem Statement: Movie Rental Store
You are required to write a program for Movie Rental Store. The basic idea is that user/reader will provide customer information, movie name, and number of days. Upon this information your program will calculate the charged amount for that movie.
Detailed Description:
1. The program should display
Please provide customer Name:
Please provide Movie Description.
Enter ‘R’ for Regular Movie.
Enter ‘C’ for children Movie.
Enter ‘N’ for New Released Movie.
Enter ‘E’ for English Movie.
Then your program should take these inputs,
2. Depending upon the choices that user has entered, your program will further display the prompt
3. If user has entered Movie description, then your program should prompt the user to enter the Movie Name and Number of days.
-----------------------------------------------------------------
Movie Name :
Number of day’s:
-----------------------------------------------------------------
4. After getting all this information, now write a function which will calculate rental/charged amount on the basis of this information.
To calculate rental/charged amount we will use this formula:
Rental amount = charged amount * number of days
Charged amount will be different for different movies according to following description:
Regular Movie: 40 $
Children Movie: 30 $
English Movie: 50 $
New release: 100 $
After calculating charged amount for this movie and display it on the screen.
Sample Output
Please provide customer Name: John
Please provide Movie Description:
Enter ‘R’ for Regular Movie:
Enter ‘C’ for children Movie:
Enter ‘N’ for New Released Movie:
Enter ‘E’ for English Movie:
R
Please provide following information:
Movie Name : Troy
Number of day’s: 3
Final output:
-----------------------------------------------------------------
Customer Name: John
Movie Type : Regular
Movie Name : Troy
Number of day’s: 3
Your Rental Amount is: 120 $
-----------------------------------------------------------------
Problem Statement: Movie Rental Store
You are required to write a program for Movie Rental Store. The basic idea is that user/reader will provide customer information, movie name, and number of days. Upon this information your program will calculate the charged amount for that movie.
Detailed Description:
1. The program should display
Please provide customer Name:
Please provide Movie Description.
Enter ‘R’ for Regular Movie.
Enter ‘C’ for children Movie.
Enter ‘N’ for New Released Movie.
Enter ‘E’ for English Movie.
Then your program should take these inputs,
2. Depending upon the choices that user has entered, your program will further display the prompt
3. If user has entered Movie description, then your program should prompt the user to enter the Movie Name and Number of days.
-----------------------------------------------------------------
Movie Name :
Number of day’s:
-----------------------------------------------------------------
4. After getting all this information, now write a function which will calculate rental/charged amount on the basis of this information.
To calculate rental/charged amount we will use this formula:
Rental amount = charged amount * number of days
Charged amount will be different for different movies according to following description:
Regular Movie: 40 $
Children Movie: 30 $
English Movie: 50 $
New release: 100 $
After calculating charged amount for this movie and display it on the screen.
Sample Output
Please provide customer Name: John
Please provide Movie Description:
Enter ‘R’ for Regular Movie:
Enter ‘C’ for children Movie:
Enter ‘N’ for New Released Movie:
Enter ‘E’ for English Movie:
R
Please provide following information:
Movie Name : Troy
Number of day’s: 3
Final output:
-----------------------------------------------------------------
Customer Name: John
Movie Type : Regular
Movie Name : Troy
Number of day’s: 3
Your Rental Amount is: 120 $
-----------------------------------------------------------------
•
•
Join Date: Jan 2009
Posts: 151
Reputation:
Solved Threads: 3
-4
#3 Oct 17th, 2009
C++ Syntax (Toggle Plain Text)
#include <iostream.h> #include <windows.h> char customer_name[255]; char description; void output(char customer_name, char movie_name, char nights, char output); int main() { char movie_name[255]; const int regular = 40; const int children = 30; const int english = 50; const int new = 100; int nights; int total; cout << "Please enter the customer name: "; cin >> customer_name; cout << "\n Type of Movie: "; cout << "Enter ‘R’ for Regular Movie Enter ‘C’ for children Movie Enter ‘N’ foNew Released Movie.Enter ‘E’ forEnglish Movie. "; cin >> description; switch(description) { case 'r': case 'R': system("cls"); cout << "Please enter the movie name: "; cin >> movie_name; cout << "\nPlease enter the number of nights: "; cin >> nights; total = regular*nights; output(customer_name, movie_name, nights, total); break; // few more cases // few more cases default: cout << "Your option was unknown"; break; } return EXIT_SUCSESS; } void output(char customer_name, char movie_name, int nights, int total) { cout << "Customer Name: " << customer_name << endl; cout << "Movie Title: " << movie_name << endl; cout << "Nights: " << nights << endl; cout << "Total: " << output << endl; }
Should be OK. I haven't compiled it or anything, it's a start.. Some work for you to do though!!
•
•
Join Date: Feb 2009
Posts: 73
Reputation:
Solved Threads: 6
0
#6 Oct 17th, 2009
No, probably aimed at Zemly because of you.
@Zem: Daniweb isn't here to spoonfeed you. Its here to help you. You start with your code and scratch up anything you can. Then post your problem. You were lucky this time that Phil++ decided to make a program for you.
If you don't know C++ and have forced yourself to take it, it was a mistake.
@Zem: Daniweb isn't here to spoonfeed you. Its here to help you. You start with your code and scratch up anything you can. Then post your problem. You were lucky this time that Phil++ decided to make a program for you.
If you don't know C++ and have forced yourself to take it, it was a mistake.
Last edited by pspwxp fan; Oct 17th, 2009 at 2:17 pm.
•
•
Join Date: Mar 2008
Posts: 1,495
Reputation:
Solved Threads: 123
0
#8 Oct 17th, 2009
Last edited by William Hemsworth; Oct 17th, 2009 at 2:29 pm.
I need pageviews! most fun profile ever :)
•
•
Join Date: Mar 2008
Posts: 1,495
Reputation:
Solved Threads: 123
1
#10 Oct 17th, 2009
•
•
•
•
mmm, I'm getting bad rep now

It's a good thing you want to help, but to really help the OP you have to make him learn something, giving him the answer is ultimately making him dumber when he gets his next piece of homework.
I need pageviews! most fun profile ever :)
![]() |
Other Threads in the C++ Forum
- Previous Thread: gnu c++ int class
- Next Thread: getline function
Views: 1845 | Replies: 42
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll encryption error file forms fstream function functions game getline givemetehcodez google graph homeworkhelper iamthwee ifstream input int integer java lazy lib linkedlist linux loop looping loops map math matrix memory microsoft newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort string strings struct studio system template templates test text tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






Ahh, I bet it isn't even right anyway, I haven't even tried to compile it. xD 