Homework Answers

Math 51397 50414
Physics 44335 44333
Chemistry 40988 40988
Economics 30646 30644
Programming & Computer Science 26878 26876
English 10084 10084
Biology 8111 8109
Management 6239 6239
Engineering 6056 6056
History 3490 3489
Psychology 2129 2129
Sociology 1858 1858
Geography 1574 1574
Marketing 1443 1443
Philosophy 1001 1001
Political Science 892 891
Law 876 876
French 438 438
Other 199 199

Questions: 238 634

Answers by our Experts: 237 641

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

One of the reactions used to inflate automobile air bags involves sodium azide



(NaN3). The balanced equation will be: 2NaN3(s) → 2Na(s) + 3N2(g). Determine the mass of N2



produced from the decomposition of 100.0 g of NaN3.

(iv) Write a function, computePrice that receives two parameters: the first one is a character variable indicating the size of the pizza (S, M or L) and the second an integer variable indicating the number of toppings on the pizza. It then computes the cost of the pizza and returns the cost as a floating point number according to the rules:

Small pizza = R50 + R5.50 per topping

Medium pizza = R70 + R6.50 per topping

Large pizza = R90 + R7.50 per topping


The post office needs a program that reads in postal address data and then displays the data in a neat format. • Declare four string variables name, addr1, addr2 and postalCode. • First, the main function of the program must input the data by means of a function called inputData. • Second, the main function calls the function displayData to display the name and address as follows: Mr R.S. Bopape P.O. Box 50741 Sandton 2146


(iii) Write a function void rectangle(int w, int h) to print an open rectangle of asterisks (*). The parameters w and h are the width and the height of the rectangle, expressed in number of asterisks


(ii) Write a void function that receives four int parameters: the first two by value and the last two by reference. Name the formal parameters n1, n2, sum and diff. The function should calculate the sum of the two parameters passed by value and then store the result in the first variable passed by reference. It should calculate the difference between the two parameters passed by value and then store the result in the second parameter passed by reference. When calculating the difference, subtract the larger value from the smaller value. Name the function calcSumAndDiff.


(i) Write a function that returns the cube of the integer passed to it. For example cube(2) will

return 8 and

cube(3) will return 27.


Find the error(s) in each of the following program segments and explain how the error(s) can be corrected:

vi) float calculateSquare(float number) { return number * number; }


Find the error(s) in each of the following program segments and explain how the error(s) can be corrected:

(v) void theProduct() { int a; int b; int c; int result; cout << “Enter three integers “ << endl; cin >> a >> b >> c; result = a * b * c; cout << “Result is “ << result << endl; return result; }


Find the error(s) in each of the following program segments and explain how the error(s) can be corrected: 

(iv) void aFunction(float a) { float a; cout << a << endl; }


Find the error(s) in each of the following program segments and explain how the error(s) can be corrected: 

(iii) int computeProd(int n) { if (n == 0) return 0; else } n * computeProd(n – 1)


LATEST TUTORIALS
APPROVED BY CLIENTS