Please Help Me.

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2009
Posts: 13
Reputation: zemly is an unknown quantity at this point 
Solved Threads: 0
zemly zemly is offline Offline
Newbie Poster

Please Help Me.

 
-4
  #1
Oct 17th, 2009
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 $
-----------------------------------------------------------------
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 18
Reputation: warbird43 is an unknown quantity at this point 
Solved Threads: 0
warbird43's Avatar
warbird43 warbird43 is offline Offline
Newbie Poster
 
-2
  #2
Oct 17th, 2009
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 151
Reputation: Phil++ is an unknown quantity at this point 
Solved Threads: 3
Phil++ Phil++ is offline Offline
Junior Poster
 
-4
  #3
Oct 17th, 2009
  1. #include <iostream.h>
  2. #include <windows.h>
  3.  
  4. char customer_name[255];
  5. char description;
  6.  
  7. void output(char customer_name, char movie_name, char nights, char output);
  8. int main()
  9. {
  10. char movie_name[255];
  11. const int regular = 40;
  12. const int children = 30;
  13. const int english = 50;
  14. const int new = 100;
  15. int nights;
  16. int total;
  17. cout << "Please enter the customer name: ";
  18. cin >> customer_name;
  19. cout << "\n Type of Movie: ";
  20. cout << "Enter ‘R’ for Regular Movie Enter ‘C’ for children Movie Enter ‘N’ foNew Released Movie.Enter ‘E’ forEnglish Movie. ";
  21. cin >> description;
  22. switch(description)
  23. {
  24.  
  25. case 'r': case 'R': system("cls");
  26. cout << "Please enter the movie name: ";
  27. cin >> movie_name;
  28. cout << "\nPlease enter the number of nights: ";
  29. cin >> nights;
  30. total = regular*nights;
  31. output(customer_name, movie_name, nights, total);
  32. break;
  33.  
  34. // few more cases
  35. // few more cases
  36.  
  37. default: cout << "Your option was unknown";
  38. break;
  39. }
  40.  
  41. return EXIT_SUCSESS;
  42. }
  43.  
  44. void output(char customer_name, char movie_name, int nights, int total)
  45. {
  46.  
  47. cout << "Customer Name: " << customer_name << endl;
  48. cout << "Movie Title: " << movie_name << endl;
  49. cout << "Nights: " << nights << endl;
  50. cout << "Total: " << output << endl;
  51. }

Should be OK. I haven't compiled it or anything, it's a start.. Some work for you to do though!!
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 18
Reputation: warbird43 is an unknown quantity at this point 
Solved Threads: 0
warbird43's Avatar
warbird43 warbird43 is offline Offline
Newbie Poster
 
0
  #4
Oct 17th, 2009
this is not the way to be a programmer. dont copy paste somebody else code if u dont know what is going on inside it.
do u know what windows.h do? Bad learning approach
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 151
Reputation: Phil++ is an unknown quantity at this point 
Solved Threads: 3
Phil++ Phil++ is offline Offline
Junior Poster
 
0
  #5
Oct 17th, 2009
Originally Posted by warbird43 View Post
this is not the way to be a programmer. dont copy paste somebody else code if u dont know what is going on inside it.
do u know what windows.h do? Bad learning approach
Sorry, is that aimed at me or...?
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 73
Reputation: pspwxp fan is an unknown quantity at this point 
Solved Threads: 6
pspwxp fan pspwxp fan is offline Offline
Junior Poster in Training
 
0
  #6
Oct 17th, 2009
Originally Posted by Phil++ View Post
Sorry, is that aimed at me or...?
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.
Last edited by pspwxp fan; Oct 17th, 2009 at 2:17 pm.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 151
Reputation: Phil++ is an unknown quantity at this point 
Solved Threads: 3
Phil++ Phil++ is offline Offline
Junior Poster
 
0
  #7
Oct 17th, 2009
My bad Ahh, I bet it isn't even right anyway, I haven't even tried to compile it. xD
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 1,495
Reputation: William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of 
Solved Threads: 123
Sponsor
William Hemsworth William Hemsworth is online now Online
Nearly a Posting Virtuoso
 
0
  #8
Oct 17th, 2009
Originally Posted by Phil++ View Post
My bad Ahh, I bet it isn't even right anyway, I haven't even tried to compile it. xD
Never give code to anyone who doesn't show effort, you're just helping him cheat.
Last edited by William Hemsworth; Oct 17th, 2009 at 2:29 pm.
I need pageviews! most fun profile ever :)
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 151
Reputation: Phil++ is an unknown quantity at this point 
Solved Threads: 3
Phil++ Phil++ is offline Offline
Junior Poster
 
0
  #9
Oct 17th, 2009
mmm, I'm getting bad rep now
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 1,495
Reputation: William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of 
Solved Threads: 123
Sponsor
William Hemsworth William Hemsworth is online now Online
Nearly a Posting Virtuoso
 
1
  #10
Oct 17th, 2009
mmm, I'm getting bad rep now
You can expect it
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 :)
Reply With Quote Quick reply to this message  
Reply

Message:



Other Threads in the C++ Forum


Views: 1845 | Replies: 42
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC