Answer:
The program in Python is as follows:
num = int(input())
for i in str(num):
print(int(i))
Explanation:
This gets input for the number
num = int(input())
This converts the number to string and iterates through each element of the string
for i in str(num):
This prints individual digits
print(int(i))
Answer:
The method in C++ is as follows:
double calcPyramidVolume(double baseLength, double baseWidth, double pyramidHeight){
double baseArea = calcBaseArea(baseLength, baseWidth);
double volume = baseArea * pyramidHeight;
return volume;
}
Explanation:
This defines the calcPyramidVolume method
double calcPyramidVolume(double baseLength, double baseWidth, double pyramidHeight){
This calls the calcBaseArea method to calculate the base area of the pyramid
double baseArea = calcBaseArea(baseLength, baseWidth);
This calculates the volume
double volume = baseArea * pyramidHeight;
This returns the volume
return volume;
}
<em>See attachment for complete program that include all methods that is required for the program to function.</em>
Option A. is the correct answer the other three are not professional behaviour if you would like an explanation as to why they are not just comment
<span>The modf() function will do this for you:
double x, y, d;
x = -14.876;
y = modf(x, &d);
printf("Fractional part = %lf\n", y);
</span>