Begin5. The length of the edge of the cube \(a\) is given. Find the volume of the cube \(V = a^3\) and the area of its surface \(S = 6 \cdot a^2\).

Solution in Python 3:

import random

a = random.randrange(1,10)
print("Edge of the cube: ", a)
V = a**3
print("Volume: ", V)
S = 6 * a**2
print("area of the surface: ", S)

Solution in C++:

#include<iostream>
using namespace std;
int main(){
double a, v, s;
cout << "Enter the edge of the cube: ";
cin >> a;
v = a*a*a;
s = 6*a*a;
cout << "Volume of the cube: " << v << endl;
cout << "area of the surface of the cube: " << s;
return 0;
}