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...
For this assignment you will develop pseudocode and write a C++ program for a simple calculator....
For this assignment you will develop pseudocode and write a C++ program for a simple calculator. You will create both files in Codio. Put your pseudocode and C++ code in the files below. PSEUDOCODE FILE NAME: Calculator.txt C++ SOURCE CODE FILE NAME : Calculator.cpp DESCRIPTION: Write a menu-driven program to perform arithmetic operations and computations on a list of integer input values. Present the user with the following menu. The user will choose a menu option. The program will prompt...
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.
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.....
Coding – You don’t have to submit the full html document only submit what should be...
Coding – You don’t have to submit the full html document only submit what should be in the <body> element. Be sure to name your form controls, classes and/or ids in a meaningful manor. 1. Create the HTML needed to have the largest heading with your name followed by an ordered list with your top favorite 5 bands, TV shows, movies or books. 2. Create a document that contains 3 hyperlinks. One hyperlink should contain an absolute path, another should...
Coding – You don’t have to submit the full html document only submit what should be...
Coding – You don’t have to submit the full html document only submit what should be in the <body> element. Be sure to name your form controls, classes and/or ids in a meaningful manor. 5. Create a form that submits to ‘myScript.php’ with a drop down (or select) list that has 3 of your favorite bands, TV shows, movies, or books for the user to select from. 6. Create a form that uses three of the new HTML5 from control...
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT