blob: 71d264303fb96efaec9b3223a913f98a88fe1663 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
// BlankConsoleLab.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <iomanip>
using namespace std;
using std::cout;
using std::cin;
using std::endl;
using std::setprecision;
//Ask the user for the width and length in centimeters.
//Print what the user entered for the width and length.
//Compute the area of the kite.Area = (width � length) / 2
//Convert the square centimeters to square meters by dividing by 10000.
//Print area in square meters.Note: square meters will use decimals.
//Compute the aspect ratio of the kite.The aspect ratio is width / length
//If the aspect ratio is greater than or equal to 1, print a warning message that a lower aspect ratio would provide more stability.
int width;
int length;
int area;
int sqmarea;
int aspectratio;
int main()
{
cout << "Insert Kite width: " ;
cin >> width ;
cout << "Insert Kite length: " ;
cin >> length ;
cout << "Our kite has a width of " << width << " and a length of " << length << " both measured in cm." ;
int area = width * length;
cout << " Our kite was an area of " << area << " in cm^2.";
int sqmarea = area / 10000;
cout << " Our area in square meters is " << sqmarea;
}
|