Abdulrahman Bin Humood ECE 2552 Soft/Hardware Integration DVD Rental.

Slides:



Advertisements
Similar presentations
Lecture Computer Science I - Martin Hardwick Strings #include using namespace std; int main () { string word; cout
Advertisements

1 Lecture 16:User-Definded function I Introduction to Computer Science Spring 2006.
Problem You require an algorithm that will receive the length of the hypotenuse and one of the sides of a right triangle, and calculate the length of the.
Revision.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 5 Functions for All Subtasks.
C++ Basics March 10th. A C++ program //if necessary include headers //#include void main() { //variable declaration //read values input from user //computation.
04 WeightLoss program1May WeightLoss program CE : Fundamental Programming Techniques.
Algorithms Series of mathematical or variable manipulations Integer a,b,c a = 12 b = 22 c = a * b (what is c?) 12 * 22 = 264.
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
1 Lab Session-XIV CSIT121 Spring 2002 b Namespaces b First Class Travel b Lab Exercise 14 (Demo) b Lab Exercise b Practice Problem.
Computer Programming 1 Functions. Computer Programming 2 Objectives Take a first look at building functions Study how a function is called Investigate.
Computer Science 1620 Programming & Problem Solving.
Chapter Objectives You should be able to describe: Object-Based Programming Classes Constructors Examples Common Programming Errors.
General Computer Science for Engineers CISC 106 Lecture 26 Dr. John Cavazos Computer and Information Sciences 04/24/2009.
Templates Overload function: define more than one function With same function name Different parameter type Different type Different number of parameter.
Program Input and the Software Design Process ROBERT REAVES.
Basic Elements of C++ Chapter 2.
C++ Functions. 2 Agenda What is a function? What is a function? Types of C++ functions: Types of C++ functions: Standard functions Standard functions.
Software Engineering 1 (Chap. 1) Object-Centered Design.
The switch Statement Selection Revisited. Problem Using OCD, design and implement a program that allows the user to perform an arbitrary temperature conversion.
11 Introduction to Object Oriented Programming (Continued) Cats II.
Functions Parameters & Variable Scope Chapter 6. 2 Overview  Using Function Arguments and Parameters  Differences between Value Parameters and Reference.
ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Fall 2012 Lecture 4: Continuing with C++ I/O Basics.
ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Fall 2012 Lecture 3: Requirements Specification, C++ Basics.
CSC 221: Computer Programming I Fall 2001  top-down design  approach to problem solving, program design  focus on tasks, subtasks, …  reference parameters.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
CS 114 – Class 02 Topics  Computer programs  Using the compiler Assignments  Read pages for Thursday.  We will go to the lab on Thursday.
1 Chapter 3 Numeric Types, Expressions, and Output Dale/Weems/Headington.
CSC1201: Programming Language 2 Lecture 1 Level 2 Course Nouf Aljaffan Snd Term Nouf Aljaffan (C) CSC 1201 Course at KSU1.
Current Assignments Homework 3 is due tonight. Iteration and basic functions. Exam 1 on Monday.
Copyright  Hannu Laine C++-programming Part 1 Hannu Laine.
C++ Programming: Basic Elements of C++.
C++ Functions. Objectives 1. Be able to implement C++ functions 2. Be able to share data among functions 2.
Previously Repetition Structures While, Do-While, For.
CSE 232: C++ debugging in Visual Studio and emacs C++ Debugging (in Visual Studio and emacs) We’ve looked at programs from a text-based mode –Shell commands.
11 Introduction to Object Oriented Programming (Continued) Cats.
Input/Output Sujana Jyothi C++ Workshop Day 2. C++ I/O Basics 2 I/O - Input/Output is one of the first aspects of programming that needs to be mastered:
Chapter 7 Pointers: Java does not have pointers. Used for dynamic memory allocation.
Control Structures (B) Topics to cover here: Sequencing in C++ language.
ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Spring 2013 Lecture 5: Continuing with C++ I/O Basics.
A first program 1. #include 2. using namespace std; 3. int main() { 4. cout
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 05, 2005 Lecture Number: 4.
1 COMS 261 Computer Science I Title: Functions Date: October 12, 2005 Lecture Number: 17.
1 Debugging and Syntax Errors in C++. 2 Debugging – a process of finding and fixing bugs (errors or mistakes) in a computer program.
Chapter 3 Functions. 2 Overview u 3.2 Using C++ functions  Passing arguments  Header files & libraries u Writing C++ functions  Prototype  Definition.
Simple Functions Writing Reuseable Formulas. Problem Using OCD, design and implement a program that computes the area and circumference of an Australian.
FUNCTIONS - What Is A Function? - Advantages Function Declaration
General Computer Science for Engineers CISC 106 Lecture 12 James Atlas Computer and Information Sciences 08/03/2009.
April 11, 2005 More about Functions. 1.Is the following a function call or a function header? calcTotal(); 2.Is the following a function call or a function.
Think First, Code Second Understand the problem Work out step by step procedure for solving the problem (algorithm) top down design and stepwise refinement.
11 Introduction to Object Oriented Programming (Continued) Cats.
InterestRate Create an InterestRate class and InterestRateViewer client class to do the following: A person is purchasing an item with their credit card.
Fundamental Programming Fundamental Programming Introduction to Functions.
1 1 Chapter 2 Elementary Programming. 2 2 Motivations In the preceding chapter, you learned how to create, compile, and run a Java program. Starting from.
FUNCTIONS (C) KHAERONI, M.SI. OBJECTIVE After this topic, students will be able to understand basic concept of user defined function in C++ to declare.
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
Introduction to C++ programming Recap- session 1 Structure of C++ program Keywords Operators – Arithmetic – Relational – Logical Data types Classes and.
Looping I (while statement). CSCE 1062 Outline  Looping/repetition construct  while statement (section 5.1)
Chapter Topics The Basics of a C++ Program Data Types
Basic Elements of C++.
Objectives Identify the built-in data types in C++
solve the following problem...
Basic Elements of C++ Chapter 2.
Variables with Memory Diagram
Screen output // Definition and use of variables
Starting Out with C++: From Control Structures through Objects
Chapter 6: User-Defined Functions I
Java for Beginners University Greenwich Computing At School DASCO
Presentation transcript:

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 :  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. O BJECTIVE :

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 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 > 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 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) qid= AA3xrcH qid= AA3xrcH 2)

Questions? Questions?