subject

1. implement a function double root(double a, double b, double c) which returns:
2. implement a function void root(double a, double b, double c, double& x1, double& x2) which assigns two solutions of quadratic equation to variables x1 and x2 . where a , b and c are real numbers. the 2 solutions are:
3. write the pre-condition and post-condition for two functions above (in questions 1 and 2).
4. implement a function void my_swap(int& a, int& b) . it swap two values of the actual parameters.
5. write a void function definition for a function called zero_both that has 2 reference parameters, both of which are variables of type int , and sets the values of both variables to 0 .
6. write a stub for function double totalprice(double single_price, int total_items) .
7. write a function int sum(int n) ; which will return the sum of 1+2+…+n where n is a positive integer.
8. write the pre-condition and post-condition of above function.
9. write an if statement to halt to program if the program fails to open a file. assume the file to be opened has name stats. dat .

ansver
Answers: 3

Another question on Computers and Technology

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 03:00
You install teamviewer on your workstation at home so that you can ac ess it when on the road. how can you be assured that unknown users cant access your computer through team viewer?
Answers: 2
question
Computers and Technology, 22.06.2019 15:30
In a compound condition, both conditions on either side of the logical operator and must be true for the overall condition to be true. a: true b: false
Answers: 1
question
Computers and Technology, 22.06.2019 20:40
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it
Answers: 2
You know the right answer?
1. implement a function double root(double a, double b, double c) which returns:
2. implemen...
Questions
question
Mathematics, 02.05.2021 19:10
question
Mathematics, 02.05.2021 19:10
question
Mathematics, 02.05.2021 19:10
question
Mathematics, 02.05.2021 19:10
question
Mathematics, 02.05.2021 19:10