Assignment No. 01 Semester: Fall 2009 CS201: Introduction toProgramming Total Ma
ID: 3614251 • Letter: A
Question
Assignment No. 01
Semester: Fall 2009
CS201: Introduction toProgramming
Total Marks: 20
Due Date:22/10/2009
Instructions
Please read the following instructions carefully beforesubmitting assignment:
It should be clear that your assignment will not get anycredit if:
§ The assignment is submitted after due date.
§ The submitted assignment does not open or file iscorrupt.
§ All types of plagiarism are strictlyprohibited.
Note: You have to upload only.cpp file. Assignment in any other format(extension) will not be accepted. If you will submit codein .doc (Word document) you will get zero marks.
Objective
The objective of this assignment is to provide hands onexperience of using
§ Basicconcepts of C++ language and Programming
§ Conditional statements of C language
§ Functionin c language
§ Writingand editing a C program
§ Saving aC program
§ Compilinga C program
§ Executingthe program
Guidelines
§ Codeshould be properly aligned and well commented.
§ Followc/c++ rules while writing variables names, function names etc
§ Use onlydev-C++ for this assignment.
§ Useappropriate c/c++ structure i.e. if-else, switch statement etc toget inputs from user.(Marks will be deducted if inappropriatestructure will be used).
Assignment
Problem Statement: Movie Rental Store
You are required to write a program for Movie Rental Store. Thebasic idea is that user/reader will provide customer information,movie name, and number of days. Upon this information your programwill calculate the charged amount for that movie.
Detailed Description:
1. The program should display
Please provide customer Name:
Please provide Movie Description.
Enter ‘R’for Regular Movie.
Enter ‘C’for children Movie.
Enter ‘N’for New Released Movie.
Enter ‘E’for English Movie.
Then your program should take these inputs,
2. Depending upon the choices that userhas entered, your program will further display the prompt
3. If user has entered Movie description,then your program should prompt the user to enter the Movie Nameand Number of days.
-----------------------------------------------------------------
MovieName:
Number ofday’s:
-----------------------------------------------------------------
4. After getting all this information, nowwrite a function which will calculate rental/charged amount on thebasis of this information.
To calculate rental/charged amount we will use thisformula:
Rental amount = charged amount * number ofdays
Charged amount will be different for different movies accordingto following description:
Regular Movie: 40 RS
ChildrenMovie: 30 RS
English Movie: 50 RS
New release: 100 RS
After calculating charged amount for this movie and display iton the screen.
Sample Output
Please provide customer Name: Aftab
Please provide Movie Description:
Enter ‘R’for Regular Movie:
Enter ‘C’for children Movie:
Enter ‘N’for New Released Movie:
Enter ‘E’for English Movie:
R
Please provide following information:
Movie Name: Jinnah
Number ofday’s: 3
Final output:
-----------------------------------------------------------------
CustomerName: Aftab
MovieType : Regular
MovieName : Jinah
Number ofday’s: 3
YourRental Amount is: 120 Rs
-----------------------------------------------------------------
Deadline
Assignment No. 01
Semester: Fall 2009
CS201: Introduction toProgramming
Total Marks: 20
Due Date:22/10/2009
Instructions
Please read the following instructions carefully beforesubmitting assignment:
It should be clear that your assignment will not get anycredit if:
§ The assignment is submitted after due date.
§ The submitted assignment does not open or file iscorrupt.
§ All types of plagiarism are strictlyprohibited.
Note: You have to upload only.cpp file. Assignment in any other format(extension) will not be accepted. If you will submit codein .doc (Word document) you will get zero marks.
Objective
The objective of this assignment is to provide hands onexperience of using
§ Basicconcepts of C++ language and Programming
§ Conditional statements of C language
§ Functionin c language
§ Writingand editing a C program
§ Saving aC program
§ Compilinga C program
§ Executingthe program
Guidelines
§ Codeshould be properly aligned and well commented.
§ Followc/c++ rules while writing variables names, function names etc
§ Use onlydev-C++ for this assignment.
§ Useappropriate c/c++ structure i.e. if-else, switch statement etc toget inputs from user.(Marks will be deducted if inappropriatestructure will be used).
Assignment
Problem Statement: Movie Rental Store
You are required to write a program for Movie Rental Store. Thebasic idea is that user/reader will provide customer information,movie name, and number of days. Upon this information your programwill calculate the charged amount for that movie.
Detailed Description:
1. The program should display
Please provide customer Name:
Please provide Movie Description.
Enter ‘R’for Regular Movie.
Enter ‘C’for children Movie.
Enter ‘N’for New Released Movie.
Enter ‘E’for English Movie.
Then your program should take these inputs,
2. Depending upon the choices that userhas entered, your program will further display the prompt
3. If user has entered Movie description,then your program should prompt the user to enter the Movie Nameand Number of days.
-----------------------------------------------------------------
MovieName:
Number ofday’s:
-----------------------------------------------------------------
4. After getting all this information, nowwrite a function which will calculate rental/charged amount on thebasis of this information.
To calculate rental/charged amount we will use thisformula:
Rental amount = charged amount * number ofdays
Charged amount will be different for different movies accordingto following description:
Regular Movie: 40 RS
ChildrenMovie: 30 RS
English Movie: 50 RS
New release: 100 RS
After calculating charged amount for this movie and display iton the screen.
Sample Output
Please provide customer Name: Aftab
Please provide Movie Description:
Enter ‘R’for Regular Movie:
Enter ‘C’for children Movie:
Enter ‘N’for New Released Movie:
Enter ‘E’for English Movie:
R
Please provide following information:
Movie Name: Jinnah
Number ofday’s: 3
Final output:
-----------------------------------------------------------------
CustomerName: Aftab
MovieType : Regular
MovieName : Jinah
Number ofday’s: 3
YourRental Amount is: 120 Rs
-----------------------------------------------------------------
Deadline
Explanation / Answer
please rate - thanks #include using namespace std; int rentalamount(int,int); int main() {char choice; string name,movie,type; int days,rate; coutname; coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.