Question

In: Computer Science

You have been instructed to use C++ to develop, test, document, and submit a simple program...

You have been instructed to use C++ to develop, test, document, and submit a simple program with the following specifications. The program maintains a short data base of DVDs for rent with their name, daily rental charge, genre, and a a short description . The program will welcomes the user, user will enter the name of the movie from a displayed list of all movies that are available, the user will enter the number next to the movie's name, number of days to rent. The program will display all the information in the data base, number of rental days, and total charges. No tax is charged. The maximum number of days a movie can be rented is 7.

Solutions

Expert Solution

#include<iostream>
using namespace std;
int main(){
   string dvd[]={"Zorawar","King","Dangal","Pagalpanti","Race"};
   int price[]={40,20,50,30,10};
   string genre[]={"Comedy","horor","drama","comedy","romantic"};
   string desc[]={"This is comedy movie","This is horor movie","This is drama movie","This is comedy movie","This is romantic movie"};
   for(int i=0;i<5;i++)
       cout<<i+1<<" "<<dvd[i]<<endl;
   cout<<"Choose the dvd"<<endl;
   int c, n;
   cin>>c;
   while(c>5){
       cout<<"Invalid option"<<endl;
       cout<<"Choose the dvd"<<endl;
       cin>>c;
   }
   cout<<"Enter no. of rent days"<<endl;
   cin>>n;
   while(n>7){
       cout<<"Maximum days rent is 7"<<endl;
       cout<<"Enter no. of rent days"<<endl;
       cin>>n;  
   }
   cout<<"DVD\tPrice\tGenre\tDescription\tRent_Days\tTotal_Price"<<endl;
   cout<<dvd[c-1]<<"\t"<<price[c-1]<<"\t"<<genre[c-1]<<"\t"<<desc[c-1]<<"\t"<<n<<"\t"<<(n*price[c-1])<<endl;
   return 0;
}


Related Solutions

You are at a wetland site. You have been instructed to test for chromium contamination. Suppose...
You are at a wetland site. You have been instructed to test for chromium contamination. Suppose that a regulatory agency has determined that a population mean chromium concentration equal to 7 mg/kg characterizes the no-contamination state. Likewise, a population mean chromium concentration significantly greater than 7 mg/kg characterizes the contamination state. Suppose that 12 soil tests were conducted around different areas around the wetland site. Their chromium concentration analyzed with the following results. Use this information for the 9 problems....
You are at a wetland site. You have been instructed to test for chromium contamination. Suppose...
You are at a wetland site. You have been instructed to test for chromium contamination. Suppose that a regulatory agency has determined that a population mean chromium concentration equal to 7 mg/kg characterizes the no-contamination state. Likewise, a population mean chromium concentration significantly greater than 7 mg/kg characterizes the contamination state. Suppose that 12 soil tests were conducted around different areas around the wetland site. Their chromium concentration analyzed with the following results. Use this information for the first 9...
This document describes a computer program you must write in Python and submit to Gradescope. For...
This document describes a computer program you must write in Python and submit to Gradescope. For this project, the program will simulate the operation of a vending machine that sells snacks, accepting coins and dispensing products and change. In an actual vending machine, a program running on an embedded computer accepts input from buttons (e.g. a numeric keypad) and devices such as coin acceptors, and its output consists of signals that control a display, actuate motors to dispense products, etc.....
Suppose you have been asked to develop a simple model for the movement of ants in...
Suppose you have been asked to develop a simple model for the movement of ants in the presence of a food source. Discuss how you could simulate this model. Your answer should include any simplifying assumptions, some parameters that you’d need, and the interaction rules you would set up.
C++ Programming Develop and submit an original implementation of a menu-driven program performing a number of...
C++ Programming Develop and submit an original implementation of a menu-driven program performing a number of tasks relating to student marks scored in a number of assessments including: displaying all marks, adding new student marks, calculating the mean score, median score, finding the minimum and maximum scores as well as displaying the average mark of a given student. The problem: Student marks are kept in a text file as a single column. Each student may have a different number of...
Q) You have been asked to develop a program which processes C++ null-terminated strings to extract...
Q) You have been asked to develop a program which processes C++ null-terminated strings to extract character and numerical data separately. Assume that the users runs the application (examTest.exe) from the command line as follows: examTest.exe X-Axis:10,Y-Axis:17,Z-Axis:-6 Your application should step through the input arguments and extract the values of the XAxis, Y-Axis and Z-Axis commands. The user must always enter the arguments in the specified order, however your application should check they are correct. At the end of your...
In order to submit this assignment, you will use this webform to upload a document file...
In order to submit this assignment, you will use this webform to upload a document file (.doc) or (.docx) with your answers. If you need to make a graph you may use a drawing program or sketch by hand. Report your source in APA or MLA format. Be sure that your responses model clear economic reasoning and addresses each of the following: What are the advantages and disadvantages of a fixed exchange rate? What are the advantages and disadvantages of...
In order to submit this assignment, you will use this webform to upload a document file...
In order to submit this assignment, you will use this webform to upload a document file (.doc) or (.docx) with your answers. If you need to make a graph you may use a drawing program or sketch by hand. Report your source in APA or MLA format. Be sure that your responses model clear economic reasoning and addresses each of the following: What is the effect of expansionary fiscal policy on unemployment and inflation? Go online and find an article...
In order to submit this assignment, you will use this webform to upload a document file...
In order to submit this assignment, you will use this webform to upload a document file (.doc) or (.docx) with your answers. You may use a drawing program or sketch by hand. Be sure that your responses model clear economic reasoning and addresses each of the following: 1.) Suppose if the price of a good is $12, the quantity demanded is 50 units; when the price is $10, the quantity demanded is 100 units. Use the midpoint approach to compute...
Develop and test an HTML document to use the DOM 2 event model that has text...
Develop and test an HTML document to use the DOM 2 event model that has text boxes for apple (59 cents each), orange (49 cents each), and banana (39 cents each), along with a Submit button. These text boxes take a number, which is the purchased number of the particular fruit. Add reality checks to the text boxes of the document to ensure that the input values are numbers in the range from 0 to 99. Each of the text...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT