subject

2. Write these functions definitions: d) Function div2Numbers () that divides 2 integers.
Compile and test your function with the following main function:
int main()
1
char op;
cout<<"Enter + to add 2 integers\n";
cout<<"Enter - to subtract 2 integers\n";
cout<<"Enter x to multiply 2 integers\n";
cout<<"Enter / to divide 2 integers\n";
cout<<"Enter the operator required: ";
cin>>op;
switch (op)
{
case '+': add2 Numbers (); break;
case '-': sub2 Numbers (); break;
case 'x' : mul2 Numbers (); break;
case '/': div2 Numbers (); break;
default: cout<<"Invalid operator entered\n";
break;
}
a) Function add2 Numbers () that adds 2 integers.
b) Function sub2 Numbers () that subtracts 2 integers.
c) Function mul2Numbers () that multiplies 2 integers.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:10
For each of the following claims, determine whether they are true or false. justify your determination (show your work). if the claim is false, state the correct asymptotic relationship as o, θ, or ω. unless otherwise specified, lg is log2.(a) (b) (c) (d) (e) (f) (g) (h) (i) (j)n+1 =22n =2n =1 =ln2 n =n2 +2n−4 =33n = 2n+1 =√n = 10100 =o(n4) o(2n)θ(2n+7 ) o(1/n)θ(lg2 n) ω(n2 )θ(9n ) θ(2n lg n )o(lg n) θ(1)
Answers: 1
question
Computers and Technology, 21.06.2019 18:20
Write a method replacekey in the minheap class with the following signature: public void replacekey(integer oldkey, integer newkey) the method will replace the first occurrence of oldkey with the newkey, and restore the min-heap property after the change. if the oldkey does not exist in the heap, the method prints an appropriate message and returns without changing the heap. example: suppose our binary heap object (bh) has the following keys: *** 4 6 7 32 19 64 26 99 42 54 28 then the method call: bh.replacekey (oldkey integer(54), newkey integer(2))
Answers: 1
question
Computers and Technology, 22.06.2019 08:00
Apex q: what does a low employment rate indicate? a. not many people are earning high salaries b. not many people are going to college c. not many people are renting their homes d. not many people have jobs
Answers: 2
question
Computers and Technology, 23.06.2019 06:00
Respond to the following in three to five sentences. select the workplace skill, habit, or attitude described in this chapter that you believe is most important for being a successful employee.
Answers: 1
You know the right answer?
2. Write these functions definitions: d) Function div2Numbers () that divides 2 integers.
Comp...
Questions
Questions on the website: 13722361