Assignment No. 03 Semester: FALL 2009 CS201: Introduction toProgramming Total Ma
ID: 3615315 • Letter: A
Question
Assignment No. 03
Semester: FALL 2009
CS201: Introduction toProgramming
Total Marks: 20
Due Date:25/11/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 along with both source and destinationfile (in .text format). Assignment in any other format (extension)will not be accepted. If you will submit code in .doc (Worddocument) you will get zero marks.
Objective
The objective of this assignment is to provide hands onexperience of using
§ Basicconcepts of C++ language and Programming
§ Functionin c language
§ Stringmanipulation in C++
§ FileHandling in C/C++
Guidelines
§ Codeshould be properly aligned and well commented.
§ Followc/c++ rules while writing variables names, function names etc
§ Use onlydev-C++ for this assignment.
Assignment
Problem Statement: File Handling in C/C++
On the basis of the given scenario create a file Expenses.txt,Open the file and copy into another Expenses2.txt, Also showoutput on screen
A college has announced the total budget of 50,000Rs.for eachgame. Games are done four times in a year. Take expenses as aninput from user.
Calculate the average expenses for a game:
Deadline
Your assignment must be uploaded/submitted on or beforeNovember 25, 2009
Assignment No. 03
Semester: FALL 2009
CS201: Introduction toProgramming
Total Marks: 20
Due Date:25/11/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 along with both source and destinationfile (in .text format). Assignment in any other format (extension)will not be accepted. If you will submit code in .doc (Worddocument) you will get zero marks.
Objective
The objective of this assignment is to provide hands onexperience of using
§ Basicconcepts of C++ language and Programming
§ Functionin c language
§ Stringmanipulation in C++
§ FileHandling in C/C++
Guidelines
§ Codeshould be properly aligned and well commented.
§ Followc/c++ rules while writing variables names, function names etc
§ Use onlydev-C++ for this assignment.
Assignment
Problem Statement: File Handling in C/C++
On the basis of the given scenario create a file Expenses.txt,Open the file and copy into another Expenses2.txt, Also showoutput on screen
A college has announced the total budget of 50,000Rs.for eachgame. Games are done four times in a year. Take expenses as aninput from user.
Calculate the average expenses for a game:
- If the expenses greater than 80% show as” VeryExpensive”.
- If the expenses are greater than 60% and less than 80%than show “Expensive ”
- If the expenses are greater than 50% and less than 60%than show “Less Expensive ”
- If the expenses are greater than 40% and less than 50% thanshow “Not Costly”.
- If the expenses are less than 40% than show“Best”.
Deadline
Your assignment must be uploaded/submitted on or beforeNovember 25, 2009
Explanation / Answer
#include #include #include using namespace std; double avgExpense(double *e) { double avg = 0; for(int i = 0; i < 4; i++) { avg = avg + e[i]; } avg = avg / 4; return avg; } void printRating(double e) { double perGameExpense = 50000; if(e >= perGameExpense * .80) { coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.