Abdulrahman Bin Humood ECE 2552 Soft/Hardware Integration DVD Rental.
-
Upload
allison-bell -
Category
Documents
-
view
212 -
download
0
Transcript of Abdulrahman Bin Humood ECE 2552 Soft/Hardware Integration DVD Rental.
Abdulrahman Bin Humood
ECE 2552 Soft/Hardware Integration
DVD Rental
A DVD rental is a machine provides a collection of movies , which is new, old, international, and a lot of movies with out any cashier .
A DVD rental machine can accept cash, or credit card, by giving your information , and be a customer there.
What is a DVD Rental?
To be able to use some information from :
http://www.cplusplus.com/doc/tutorial/To be able to able to formulate an
algorithm.To be able to create a DVD Rental
programs in C++ which I can use the subjects we covered and some information from website.
Create a program which makes it easy for people to rent movie without cashier in the real life.
OBJECTIVE :
Description:
The basic idea is to provide a customer or the user
information about movie name, how many days, and the member s (he) wants.
So, there are a few steps we need to follow:
Create a C++ project called DVD Rental. Using class definition from its implementation, called DVD. Using Access specifies Create a function after main Display some input then the program will further display the
prompt write a function which will calculate rental/charged amount
on the basis of this information run the program getting the output
The Code:#include <iostream>
#include <fstream>
#include <string>
using namespace std;
class dvd
{
public:
double days;
double amount;
double prise;
void count(double, double);
};
void dvd:: count(double d, double pri)
{
days=d;
prise=pri;
amount = days*prise;//type casting variable
cout<<"\nYour total amount is:"<<amount<<" Dollers\n";
}
int main(){
char op;string op2,op3,op4,op5,op6,op7,op8;int op1,op11;double op10,op9;cout<<"Welcome To Walmart movie rental\n";cout<<"-------------------------------\n";cout<<"-------------------------------\n\n";
cout<<"Please Enter Movie Options:\n"; cout<<"Enter 'L' for Legend Movies\n"; cout<<"Enter 'N' for New Movies\n";
cout<<"Enter 'C' New Childrean Movies\n"; cout<<"Enter 'E' for English Movies\n";
cin >> op;
switch(toupper(op)){
case 'L':
cout << " Movie Legends...\n"; cout <<" 1)Rocky\n"; cout <<" 2)Good Father\n"; cout <<" 3)Good Fellas\n"; cout <<" 4)Titanic\n";
The output:
This output appears when you select the right option.
The output:
This output appears when you select the wrong option.
Conclusion:
The project works successfully. try to make it more interesting by selecting 2 movies at the same time. the project is easy, simple, and not that complicated. the project covers some of the material in the class.
Improvement:
Able to use <ctime> function prototypes and types for manipulating the time and date which makes it easy to know what time the person has come and rent the movie .
Reference:
1) http://answers.yahoo.com/question/index?qid=20091016105846AA3xrcH
2) http://www.cplusplus.com/doc/tutorial/
Questions?