Write a C++ program that calculates the monthly fee for the film system that rents different...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a C++ program that calculates the monthly fee for the film system that rents different types of films. In your program, Create a class called Film containing the following data members: name (string) ► type (string) ► film_registration_fee (double): the monthly fee of the system and the following member functions: getName(): returns the name of the film. setFee(): sets the daily fee of the film.. ➤ getType(): returns the type of the film. getFee(): returns the monthly fee of the film rent. ➤ add(): if the user enters 'a' for adding the film to the system, call this function in the main and add the film. ➤ A friend function named calculateMonthlyFee (Film f). This function first sets the daily rental fee for each film. If the film type is "Animation" the daily fee is 11.0; if the film type is "Action" the daily fee is 17.0. Otherwise, the fee is equal to 15.0. Then, this function calculates the monthly fee by multiplying the fee by 30. The calculated monthly fee is then returned. The Film class also has a constructor that receives two parameters to initialize the film name and type of the film. (Hint: You should use the setFee() function to set the film fee in the calculateMonthlyFee function.) In the main function, ➤ Create an array of objects from the Film class. (the size can be two) ➤Your program should ask the user to enter the selection type: (a) for adding film to the system or (w) for watching the film from the system, or the user can cancel the system by entering (C). > If the user enters (a), add the film to your archive by using the add() function. ➤ If the user enters (w), the number of the movie will be entered, accordingly, your program will get the name and type of the movie, and type of the movie, and calculate the fee using the friend function calculateMonthlyFee(Film f). If the user enters (C), print out "Exit the program". Consider the sample runs given below. Sample Run 1: Do you want to add or watch a film (a/w), or enter (C) for exit the system: a Enter the name of the film to be added: Witcher The film name: Witcher is added. Enter the type: Animation The type of the film: Animation Enter the name of the film to be added: Leon The film name: Leon is added. Enter the type: Action The type of the film: Action Do you want to add or watch a film (a/w), or enter (C) for exit the system: w Enter the number of films: 1 Enter 1 film names: Enter the name of the movie: Leon Enter the type of the movie: Action You've watched film, and type of the film is Action Film Archive Fee Details: Monthly rent fee: 510 TL Do you wa to add or watch a film (a/w), or enter (C) for exit the system: C Exit the system. Sample Run 2: Do you want to add or watch a film (a/w), or enter (C) for exit the system:w Enter the number of films: 2 Enter 2 film names: Enter the name of the movie: ToyStory Enter the type of the movie: Animation You've watched film, and type of the film is Animation Film Archive Fee Details: Monthly rent fee: 330 TL Enter the name of the movie: Avatar Enter the type of the movie: Sci-Fi You've watched film, and type of the film is Sci-Fi Film Archive Fee Details: Monthly rent fee: 450TL Do you want to add or watch a film (a/w), or enter (C) for exit the system: C Exit the system. Write a C++ program that calculates the monthly fee for the film system that rents different types of films. In your program, Create a class called Film containing the following data members: name (string) ► type (string) ► film_registration_fee (double): the monthly fee of the system and the following member functions: getName(): returns the name of the film. setFee(): sets the daily fee of the film.. ➤ getType(): returns the type of the film. getFee(): returns the monthly fee of the film rent. ➤ add(): if the user enters 'a' for adding the film to the system, call this function in the main and add the film. ➤ A friend function named calculateMonthlyFee (Film f). This function first sets the daily rental fee for each film. If the film type is "Animation" the daily fee is 11.0; if the film type is "Action" the daily fee is 17.0. Otherwise, the fee is equal to 15.0. Then, this function calculates the monthly fee by multiplying the fee by 30. The calculated monthly fee is then returned. The Film class also has a constructor that receives two parameters to initialize the film name and type of the film. (Hint: You should use the setFee() function to set the film fee in the calculateMonthlyFee function.) In the main function, ➤ Create an array of objects from the Film class. (the size can be two) ➤Your program should ask the user to enter the selection type: (a) for adding film to the system or (w) for watching the film from the system, or the user can cancel the system by entering (C). > If the user enters (a), add the film to your archive by using the add() function. ➤ If the user enters (w), the number of the movie will be entered, accordingly, your program will get the name and type of the movie, and type of the movie, and calculate the fee using the friend function calculateMonthlyFee(Film f). If the user enters (C), print out "Exit the program". Consider the sample runs given below. Sample Run 1: Do you want to add or watch a film (a/w), or enter (C) for exit the system: a Enter the name of the film to be added: Witcher The film name: Witcher is added. Enter the type: Animation The type of the film: Animation Enter the name of the film to be added: Leon The film name: Leon is added. Enter the type: Action The type of the film: Action Do you want to add or watch a film (a/w), or enter (C) for exit the system: w Enter the number of films: 1 Enter 1 film names: Enter the name of the movie: Leon Enter the type of the movie: Action You've watched film, and type of the film is Action Film Archive Fee Details: Monthly rent fee: 510 TL Do you wa to add or watch a film (a/w), or enter (C) for exit the system: C Exit the system. Sample Run 2: Do you want to add or watch a film (a/w), or enter (C) for exit the system:w Enter the number of films: 2 Enter 2 film names: Enter the name of the movie: ToyStory Enter the type of the movie: Animation You've watched film, and type of the film is Animation Film Archive Fee Details: Monthly rent fee: 330 TL Enter the name of the movie: Avatar Enter the type of the movie: Sci-Fi You've watched film, and type of the film is Sci-Fi Film Archive Fee Details: Monthly rent fee: 450TL Do you want to add or watch a film (a/w), or enter (C) for exit the system: C Exit the system.
Expert Answer:
Answer rating: 100% (QA)
include include class Film private stdstring name stdstring type double filmregistrationfee public F... View the full answer
Related Book For
Modern Systems Analysis And Design
ISBN: 9780134204925
8th Edition
Authors: Joseph Valacich, Joey George
Posted Date:
Students also viewed these programming questions
-
Magnification and Similarity FIGURE 8.8 .0 FIGURE 8.9 B B Q "P D .0 A FIGURE 8.10 B 2 2 K 5 2 5 O 2 2 D 2 B FIGURE 8.11 H 241 EXERCISE SET 8.1 Use dot paper or graph paper for these exercises when it...
-
Goodwill impairment tests are carried out annually. During 2014, goodwill impairment was determined to be $26,000 on the parents share of goodwill and $5,000 on the NCI share. In 2016, impairment in...
-
+3 NE + .. 4 b) A Spade or Club? .. +4 As shown above, a classic deck of cards is made up of 52 cards, 26 are black, 26 are red. Each color is split into two sults of 13 cards each (clubs and...
-
Need assistance on adding accounting info to the excel worksheet posted. A.) would 97,400 go under cash or fixed assets ? Number Styles Cells Editing Ideas g Cash Balance B. C D E H. K M T. 0,1,F...
-
Show that the lines with equations 2x - 3y = 1 and 3x + 2y = 4 are perpendicular.
-
Ricardo Construction began operations on December 1. In setting up its accounting procedures, the company decided to debit expense accounts when it prepays its expenses and to credit revenue accounts...
-
Fill in the Blank. A drumhead can be considered as \(\mathrm{a}(\mathrm{n})\) ____________ .
-
On December 31, after adjustments, Gomez Companys ledger contains the following account balances: 101 Cash .................$47,200 Dr. 111 Accounts Receivable .......... 17,800 Dr. 121 Supplies...
-
Outdoor Luggage, Incorporated, makes high-end hard-sided luggage for sports equipment. Data concerning three of the company's most popular models appear below. Ski Guard Golf Guard Fishing Guard...
-
The following relate to auditors independence: a. Why is independence so essential for auditors? b. Compare the importance of independence of CPAs with that of other professionals, such as attorneys....
-
Coral Divers Resort Jonathon Greywell locked the door on the equipment shed and began walking back along the boat dock to his office. He was thinking about the matters that had weighed heavily on his...
-
Two parties enter into a valid and enforceable business contract that includes an arbitration clause and the name of the arbitrator. Consider two situations: (a) A dispute takes place between the...
-
What are the two situations in which businesspeople are concerned with the transnational aspects of product liability law?
-
According to the United Nations, what are the four objectives that should be included in codes of conduct of international corporations?
-
Explain the questions one would need to consider before changing a domestic company into an international one.
-
Before deciding to conduct business in another nation-state, a business manager should prepare a country analysis. What variables should go into this analysis?
-
Evaluate the following integral x+1 dx
-
What did Lennox gain by integrating their WMS, TMS, and labor management systems?
-
Use a tool for generating wireframe screen designs, such as Visio or Axure, to create a wireframe of some popular homepage.
-
For the system you chose for Problem and Exercise 5-35, complete section 4.0, AC, Management Issues, of the BPP Report. Why might people sometimes feel that these additional steps in the project plan...
-
How are automated tools used in the maintenance of information systems?
-
The concrete block weighing \(644 \mathrm{lb}\) is elevated by the hoisting mechanism shown, where the cables are securely wrapped around the respective drums. The drums, which are fastened together...
-
A metal hoop with a radius \(r=6\) in. is released from rest on the \(20^{\circ}\) incline. If the coefficients of static and kinetic friction are \(\mu_{s}=0.15\) and \(\mu_{k}=0.12\), determine the...
-
The pendulum has a mass of \(7.5 \mathrm{~kg}\) with center of mass at \(G\) and has a radius of gyration about the pivot \(O\) of \(295 \mathrm{~mm}\). If the pendulum is released from rest at...
Study smarter with the SolutionInn App