CSc 220 Assignment 1

Something To Tri

Assigned
Due

Jan 13
20 pts
Jan 22

This is a simple project mainly for practice running and submitting a C program.

Write a program which requests a height and base width of a triangle, and reports its area. In case your geometry is a bit rusty, the formula is simply one half base times height. Use floating point numbers (either float or double type).

bennet@bennet:~/courses/cs220/asst$ triarea Enter the height: 5 Enter the width: 10 A triangle 5 high and 10 wide has area 25. bennet@bennet:~/courses/cs220/asst$ triarea Enter the height: 3.18 Enter the width: 7.923 A triangle 3.18 high and 7.923 wide has area 12.5976.

Write in C++ and use the file extension .cpp.

When your program works and looks nice, submit over the web here.