Below is one way to fix the program. C++ doesnβt use the ^ operator for exponents. We can get the square of r by multiplying it by itself. We call the function with an argument of 5.
Below is one way to fix the program. Itβs crucial that you input your arguments in the correct order so as to avoid a semantic error. Also, itβs important that you understand that when you divide two integers you will get an integer as a result.
#include <iostream>
using namespace std;
void divide(double a, double b) {
cout << a / b;
}
int main() {
int a = 8;
int b = 12;
cout << b << " / " << a << " = ";
divide (b, a);
}
Finish the code below so that it calculates the common log of a minus the natural log of a and prints the difference. You will need to use cmath functions.
Finish the code below so that it calculates the common log of a minus the natural log of a and prints the difference. You will need to use cmath functions. Use the lines to construct the code, then go back to complete the Activecode.
Write a function called intDivision that takes two doubles as parameters and prints the quotient of the integer division of the first number divided by the second. Be sure to include any necessary headers.
Write a function called intDivision that takes two doubles as parameters and prints the quotient of the integer division of the first number divided by the second. Use the lines to construct the code, then go back to complete the Activecode.
Write a function called gpaBoost that prints your GPA rounded up to the nearest point. If your GPA is already at the nearest point, there is no rounding. Be sure to include any necessary headers.
Below is one way to complete the program. I used the ceil function from the cmath library, but you could have solved this problem without using any functions from cmath.
Write a function called volumePrism that takes three double sidelengths as parameters, and calculates and prints the volume of a the rectangular prism. Be sure to include any necessary headers.
Write a function called volumePrism that takes three double sidelengths as parameters, and calculates and prints the volume of a the rectangular prism. Use the lines to construct the code, then go back to complete the Activecode.
Write a function called tanD that prints the tangent of an angle given as a double in degrees. Use 3.14 for pi. Be sure to include any necessary headers.
Below is one way to complete the program. You need to make sure to convert your angle to radians before doing any calculations with sinusoidal functions.
Write a function called volumeSphere that takes a double radius as a parameter, and calculates and prints the volume of a sphere with that radius. Use 3.14 for pi. Be sure to include any necessary headers.
Write a function called volumeSphere that takes a double radius as a parameter, and calculates and prints the volume of a sphere with that radius. Use 3.14 for pi. Use the lines to construct the code, then go back to complete the Activecode.