Computer Science, asked by manojkmrnandi, 9 months ago

Design a class overloading a function calculate() as follows:i) void calculate(int m, char ch): with one integer argument and one character argument. It checks whether the integer argument is divisible by 7 or not, if ch is ‘s’ otherwise , it checks the last digit of the integer argument contains 7 or not. ii) void calculate(int a,int b,char ch): with two integer arguments and one character argument. It displays the greater of integer arguments if ch is ‘g’ otherwise, displays the smaller of integer arguments. ********************************************************

Answers

Answered by harnathyadav2907
5

Explanation:

Design a class to overload a function num_calc() as follows : (a) void num_calc (int num, char ch) with one integer argument and one character argument, computes the square of integer argument if choice ch is 's' otherwise finds its cube. else adds the integers.

Answered by rsahab613
3

Explanation:

Design a class overloading a function calculate() as follows:i) void calculate(int m, char ch): with one integer argument and one character argument. It checks whether the integer argument is divisible by 7 or not, if ch is ‘s’ otherwise , it checks the last digit of the integer argument contains 7 or not. ii) void calculate(int a,int b,char ch): with two integer arguments and one character argument. It displays the greater of integer arguments if ch is ‘g’ otherwise, displays the smaller of integer arguments

Similar questions
Math, 9 months ago