assignment9 - solution of this problem...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/*Assignment 9: Write a program which declares variables for the sides of a 4-sided polygon s1, s2, s3, and s4. Set the values to 10, 5, 7.5 and 8.3. Calculate the perimeter of the polygon. The output should look like the following: The perimeter of a polygon with sides 10, 5, 7.5 and 8.3 is Followed by the answer. The exact spacing of the line breaks is not critical to the
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: solution of this problem.*/ p #include<iostream> # using namespace std; u int main () i { double s1 = 10, s2 = 5, s3 = 7.5, s4 = 8.3, total = s1+s2+s3+s4; d cout << "The perimeter of a polygon with sides " <<s1<< ", " <<s2<< ", "<<s3<< ", " <<s4<< " is " <<total << endl; < }...
View Full Document

This note was uploaded on 01/11/2010 for the course CMPSC 101 taught by Professor Drobish,renee during the Summer '07 term at Penn State.

Ask a homework question - tutors are online