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
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
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
English,
4 months ago
Science,
9 months ago
Computer Science,
1 year ago
Physics,
1 year ago
Math,
1 year ago