blob: 7d21fe1e1d816b2f85dea712ea0d187e662cd387 (
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
#include <iostream>
using namespace std;
using std::cout;
using std::cin;
using std::endl;
int
length = 0;
int
width = 0;
int
area = ((length * width) / 2);
int
main ()
{
// Following code is to find the area of the kite
// Asking the user to input the length and width in centimetres
cout << "What is the length of the kite in cm?\n";
cin >> length;
cout << "What is the width of the kite in cm? \n";
cin >> width;
if (length || width >= 401)
{
cout << "Measurement too big. Enter a number between 0-400 \n";
}
else
{
cout << "The Area of the kite is: \n" << ((length * width) /
2) << "centimetres \n";
cout << "In Square centimetres this is: \n" << (((length * width) / 2)
/
10000) <<
" Square Meters! \n";
}
return area;
}
|