CS201 Assignment No. 3
Page 1 of 1 • Share
CS201 Assignment No. 3
Assignment No. 3
Semester: Spring 2011
CS201: Introduction to Programming
Total Marks: 20Semester: Spring 2011
CS201: Introduction to Programming
Due Date:13 June, 2011
Instructions:
Please read the following instructions carefully before submitting your assignment:
It should be clear that your assignment will not get any credit if:
§ The assignment is submitted after due date.
§ The submitted assignment does not open or file is corrupt.
All types of plagiarism are strictly prohibited.
Note: You have to upload only .cpp file. Assignment in any other format (extension) will not be accepted. If you will submit code in any other file format like .doc or .txt etc. you will get zero marks.
Objective
The objective of this assignment is to provide hands on experience of using
§ Macros in C/C++
§ Classes in C/C++
§ Creating Default constructors and User-defined constructors
§ Creating and manipulating objects.
Guidelines
§ Code should be properly aligned and well commented.
§ Follow C/C++ rules while writing variables names, function names etc.
§ Use only Dev-C++ IDE for this assignment.
Assignment:
Problem Statement: Circle Area & Circumference Calculation
You are required to write a program which will calculate the area and circumference of the circle by declaring a class. You must declare a class named Circle whose only data member will be radius which should be declared as public. You need to define a macro for the value of PI which will be used while calculating the area of the circle.
Detailed Description:
Data member radius should be of type double and it should be declared under public scope.
Value for PI should be defined using #define macro.
Your class should have two type of constructors:
1. Default Constructor which should initialize radius of the circle with value 0.
2. User Defined Constructor which takes class data memberradius as its parameter.
Declare a public member function named CalculateArea() which calculates the area of the circle. The formula for calculating the area is.
Declare a public member function named CalculateCircum() which calculates the circumference of the circle. The formula for calculating the circumference is.
Declare a public member function named Display which will display the calculated area and circumference of the circle on the output screen.
In the main() function, declare two objects of type Circle:
> One using default constructor
> Second using user-defined constructor.
It should be Display the area and circumference of the circle on the screen like the sample output.
Sample Output:
Radius of the Circle = 0
Area of the Circle = 0
Circumference of the Circle is = 0
Radius of the Circle = 3.5
Area of the Circle = 38.465
Circumference of the Circle is = 21.98
Deadline:
Your Assignment solution must be submitted on or before June 13, 2011. You have to upload only .cpp file. Assignment in any other format (extension) will not be accepted. Assignment submitted in any other file format like .doc or .txt etc. you will get zero marks.
kamran- Monstars
-
Posts : 301
Join date : 2011-02-11
Age : 37
Re: CS201 Assignment No. 3
[You must be registered and logged in to see this image.]
good luck- Monstars
- Posts : 29
Join date : 2011-02-11
Similar topics
» CS201 Assignment No. 4
» CS201 Assignment No.2 Solution
» CS201 GDB solution
» MGT504 Assignment
» MGT 431 Assignment No. 1 Solution
» CS201 Assignment No.2 Solution
» CS201 GDB solution
» MGT504 Assignment
» MGT 431 Assignment No. 1 Solution
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Yesterday at 12:21 pm by ali001
» Hemangiom'App
Tue Nov 05, 2024 11:25 am by ali001
» MindfulMe - Mental Health App
Mon Nov 04, 2024 10:50 am by ali001
» Learn Candlestick Patterns
Tue Oct 15, 2024 5:51 am by ali001
» Woh Pagal Si Episode 52 to 62 - Top Pakistani Drama
Sat Sep 21, 2024 6:26 pm by Mir Emmad Ali Khan Domki
» Nearu - share your socials
Sat Sep 21, 2024 1:12 pm by ali001
» Nightclub Tycoon: Idle Empire
Thu Sep 19, 2024 9:16 pm by ali001
» Carnivore - Meat Diet Recipes
Wed Sep 18, 2024 2:37 pm by ali001
» Eid Milad un Nabi Mubarak 2024 (Rabiʻ I 14, 1446 AH)
Tue Sep 17, 2024 3:44 pm by Mir Emmad Ali Khan Domki