#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
int count, cycles;
double area, base[10], height[10];
cout << "CALCULATE THE AREAS OF TRIANGLES\n\n"; //by stev3
//Loop how many times?
cout << "How many triangles do you need to calculate the area of? ";
cin >> cycles;
system("cls");
//Get tri info
for(count = 1; count <= cycles; count++)
{
cout << "\tTriangle no. " << count;
cout << "\n\nBase: "; cin >> base[count];
cout << "\nHeight: "; cin >> height[count];
system("cls");
}
//Output
for(count = 1; count <= cycles; count++)
{
area = (base[count] * height[count]) / 2;
cout << "The Area of the Triangle " << count << ":\t" << area << " square units\n";
}
Sleep(4000);
return 0;
}
0 Comments On This Entry
← January 2022 →
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| 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 |
Tags
My Blog Links
Recent Entries
-
Finding the area of multiple triangleson Aug 31 2009 06:48 AM
-
Colouring your console background/foregroundon Aug 31 2009 06:48 AM
-
Hide console windowon Aug 08 2009 04:45 AM
-
Converted to C++on Aug 08 2009 04:39 AM
-
Weclomon Aug 08 2009 03:56 AM
Search My Blog
3 user(s) viewing
3 Guests
0 member(s)
0 anonymous member(s)
0 member(s)
0 anonymous member(s)
Test
test



Leave Comment








|