Answer:
Step-by-step explanation:
alaminru2020
Ambitious
74 answers
617 people helped
Answer:
Since you did not mention any programming languages, I use C++.
Step-by-step explanation:
#include <iostream>
using namespace std;
double calculate_perimeter(double length, double width) {
double perimeter = 2 * (length + width);
return perimeter;
}
int main() {
double length, width;
cout << "Enter the length of the rectangle: ";
cin >> length;
cout << "Enter the width of the rectangle: ";
cin >> width;
double perimeter = calculate_perimeter(length, width);
cout << "The perimeter of the rectangle is: " << perimeter << endl;
return 0;
}