Begin6. The lengths of the edges \(a, b, c\) of a rectangular parallelepiped are given. Find its volume \(V = a \cdot b \cdot c \) and the surface area \(S = 2 \cdot (a \cdot b + b \cdot c + a \cdot c)\).

Solution in Python 3:

import random

a = random.randrange(1,10)
b = random.randrange(1,10)
c = random.randrange(1,10)

print("Rectangular parallelepiped")
print("Edge a: ", a)
print("Edge b: ", b)
print("Edge c: ", c)
V = a*b*c
print("Volume: ", V)
S = 2*(a*b + b*c + a*c)
print("Area of the surface: ", S)

Solution in C++:

#include<iostream>
using namespace std;
int main(){
double a,b,c,v,s;
cout << "Enter the edge A: ";
cin >> a;
cout << "Enter the edge B: ";
cin >> b;
cout << "Enter the edge C: ";
cin >> c;
v = a*b*c;
s = 2*(a*b + b*c + a*c);
cout << "Volume of the rectangular parallelepiped: " << v << endl;
cout << "Area of the surface: " << s;
return 0;
}