Hello guys! As you can tell its about standard libraries. I need to turn it in soon, but can not get a hold of the teacher.
This is the code it's based on.
Code:
#include <iostream>
using namespace std;
#include "C:\\Dev-Cpp\\user_area\\udst_monitor.h"
// Function Prototypes
double area_square(double side);
double area_rectangle(double side1, double side2);
double area_circle(double radius);
double area_trapezoid(double base, double top, double height);
// Variables
double square_room_size;
double driveway_length;
double driveway_width;
double swimming_pool_diameter;
double trap_bottom;
double trap_top;
double trap_height;
//******************************************************
// main
//******************************************************
int main(void)
{
// *************************** square
// Input Test Data - 4.5
cout << "\nWhat is the length of one of the walls in your square bedroom? -->: ";
cin >> square_room_size;
// Output Test Results - 20.25
cout << "\nYour room is " << area_square(square_room_size) << " square whatevers.\n";
pause_m();
clear_m();
// *************************** rectangle
// Input Test Data - 4.5
cout << "\nWhat is the length of your driveway? -->: ";
cin >> driveway_length;
// Input Test Data - 6.6
cout << "\nWhat is the width of your driveway? --->: ";
cin >> driveway_width;
// Output Test Results - 29.7
cout << "\nYour driveway is " << area_rectangle(driveway_length, driveway_width) << " square whatevers.\n";
pause_m();
clear_m();
// *************************** circle
// Input Test Data - 13.8
cout << "\nWhat is the diameter of your circular swimming_pool? -->: ";
cin >> swimming_pool_diameter;
// Output Test Results - 149.571
cout << "\nYour pool is " << area_circle(swimming_pool_diameter / 2) << " square whatevers.\n";
pause_m();
clear_m();
// *************************** trapezoid
// Input Test Data - 12.7
cout << "\nWhat is the length of the bottom side of your trapezoid? -->: ";
cin >> trap_bottom;
// Input Test Data - 9.3
cout << "\nWhat is the length of the top side of your trapezoid? ----->: ";
cin >> trap_top;
// Input Test Data - 4.2
cout << "\nHow tall is your trapezoid? ------------------------------->: ";
cin >> trap_height;
// Output Test Results - 46.2
cout << "\nYour trapezoid is " << area_trapezoid(trap_bottom, trap_top, trap_height) << " square whatevers.\n";
pause_m();
clear_m();
return 0;
}
//******************************************************
// area_square
//******************************************************
double area_square(double side)
{
return side * side;
}
//******************************************************
// area_rectangle
//******************************************************
double area_rectangle(double side1, double side2)
{
return side1 * side2;
}
//******************************************************
// area_circle
//******************************************************
double area_circle(double radius)
{
return 3.14159265 * radius * radius;
}
//******************************************************
// area_trapezoid
//******************************************************
double area_trapezoid(double base, double top, double height)
{
return (base + top) / 2 * height;
}
We need to creat a function called "area_triangle" , prototype it and within the function main we need to add an area for calling the function.
But I have no idea what he means by "area_triangle"? Does anybody know what that is supposed to do?