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 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
b class A int x y public A x 10 y 20 global friend function f... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
635e33dd090eb_182320.pdf
180 KBs PDF File
635e33dd090eb_182320.docx
120 KBs Word File
