subject

Given problemsolution class. use a pointer to object of "problemsolution" class to invoke the "calculatesum" and "print" methods of "problemsolution".

write a function:
void solution(int n1, int n2)

that accepts two integers n1 and n2. the function should instantiate "problemsolution" object with n1 and n2 values and call "calculatesum" and "print" method by creating a pointer to the object of "problemsolution".

input
12 5

output
17
assume that,

n1, n2 and sum are integers within the range [-1,000,000,000 to 1,000,000,000].
given code to work with:

#include
#include
#include
using namespace std;

class problemsolution{
int n1,n2,result;
public:
problemsolution(int n1, int n2){

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:20
The reset circuit used on the four 3-bit counters analyzed in this activity reset the counts to zero (000). it makes sense for the up-counters to start at zero (000), but the down-counters should start at seven (111). what would you need to change so that the 3-bit binary down counter with j/k flip-flops you just created would reset to seven (111)?
Answers: 1
question
Computers and Technology, 23.06.2019 22:40
22. sata3 allows for data transfer rates of 600 mb/s. explain why you would likely not be able to copy data from one hard drive to another at anywhere close to this speed. also, what could be upgraded on the computer to achieve transfer speeds closer to 600 mb/s
Answers: 1
question
Computers and Technology, 24.06.2019 03:00
With editing, word automatically displays a paste options button near the pasted or moved text. a. cut-and-paste b. drag-and-drop c. inline d. copy-and-carry
Answers: 1
question
Computers and Technology, 24.06.2019 17:40
The value of sin(x) (in radians) can be approximated by the alternating infinite series create a function (prob3_2) that takes inputs of a scalar angle measure (in radians) and the number of approximation terms, n, and estimates sin(x). do not use the sin function in your solution. you may use the factorial function. though this can be done without a loop (more efficiently), your program must use (at least) one. you may find the mod() function useful in solving the problem.
Answers: 1
You know the right answer?
Given problemsolution class. use a pointer to object of "problemsolution" class to invoke the "calcu...
Questions
question
Mathematics, 11.01.2021 22:20
question
Mathematics, 11.01.2021 22:20
question
Mathematics, 11.01.2021 22:20
Questions on the website: 13722367