Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you please do it in C++? 1. Create a class named 'Student' with a string variable 'name' and an integer variable 'roll_no'. Assign the

image text in transcribed

Can you please do it in C++?

1. Create a class named 'Student' with a string variable 'name' and an integer variable 'roll_no'. Assign the value of roll_no as ' 2 ' and that of name as "John" by creating an object of the class Student. 2. Assign and print the roll number, phone number and address of two students having names "Sam" and "John" respectively by creating two objects of the class 'Student'. 3. Write a program to print the area and perimeter of a triangle having sides of 3,4 and 5 units by creating a class named 'Triangle' with a function to print the area and perimeter. 4. Write a program to print the area and perimeter of a triangle having sides of 3,4 and 5 units by creating a class named 'Triangle' with the constructor having the three sides as its parameters. 5. Write a program to print the area of two rectangles having sides (4,5) and (5,8) respectively by creating a class named 'Rectangle' with a function named 'Area' which returns the area. Length and breadth are passed as parameters to its constructor

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Multimedia Database Systems

Authors: V.S. Subrahmanian

1st Edition

1558604669, 978-1558604667

More Books

Students also viewed these Databases questions

Question

=+c. What is the probability that x exceeds 3?

Answered: 1 week ago

Question

e. What difficulties did they encounter?

Answered: 1 week ago