Question: (b) Write a friend function to a class that will return true if a number x is a factor of a number y. (6

(b) Write a friend function to a class that will return true

(b) Write a friend function to a class that will return true if a number x is a factor of a number y. (6 Marks) (c) Write a program that defines a shape class with a constructor that gives value to width and height. Using inheritance, create two sub-classes triangle and rectangle that can calculate their corresponding areas. (5 Marks)

Step by Step Solution

3.43 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

b class A int x y public A x 10 y 20 global friend function f... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (2 attachments)

PDF file Icon

635e33dd090eb_182320.pdf

180 KBs PDF File

Word file Icon

635e33dd090eb_182320.docx

120 KBs Word File

Students Have Also Explored These Related Programming Questions!