0% found this document useful (0 votes)
5 views1 page

QP - E - 1 - Func Overloading

The document contains two programming tasks in C++. The first task involves writing functions to calculate the perimeter and surface area of various geometric shapes using function overloading. The second task requires creating a program to store and retrieve a student's information, including their grade based on marks, in a file named 'student.txt'.

Uploaded by

Palak Gandhi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

QP - E - 1 - Func Overloading

The document contains two programming tasks in C++. The first task involves writing functions to calculate the perimeter and surface area of various geometric shapes using function overloading. The second task requires creating a program to store and retrieve a student's information, including their grade based on marks, in a file named 'student.txt'.

Uploaded by

Palak Gandhi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

C-TAG

Coding And Training Academy By Gandhis


C++

Question 1: (20)
Write a C++ program to calculate the perimeter/circumference of different
geometrical shapes as mentioned.
Write a function calculate() which receives different types of parameters and as per
the parameter, use function overloading to attain the required task.
calculate(10,20) - perimeter of rectangle with given length and breadth
calculate(10) - perimeter of square with given length
calculate(1.5) - circumference of circle with given radius
calculate(4,7,3) - perimeter of cuboid with the given length breadth and height.

Do the entire same process for surface area of all the 5 shapes with the function
name as area() and different parameters.
area(10,20) - area of rectangle with given length and breadth
area(10) - area of square with given length
area(1.5) - area of circle with given radius
area(4,7,3) - surface area of cuboid with the given length breadth and height.

Question 2: (10)
Write a C++ program to store a user’s email address, name, enrolment number,
marks, grade in a file “student.txt”.
The grade should be calculated as per the marks as:
A 80 and above
B 65 – 79
C 55 – 64
D 40 – 54
F 0 – 39

Input all the values from the user, store them in the file and print them in a proper
format after retrieving from the file.

www.c-tag.online Contact: 9824502039 Page no 1

You might also like