C++, computer programming, Programming Languages

You are to write a program which will answer a pair of questions for squares, triangles, circles and ellipses. A square is defined by its lower left corner (SLLx,SLLy), and the length of one side SW. An isosceles triangle is defined by the topmost point (Tx,Ty), its height TH, and its base TB. A circle is defined by its center (Cx,Cy) and its radius CR. An ellipse is defined by its center (EX,EY), its vertical height EH and its horizontal width EW. The square, circle, ellipse, and triangle are aligned as follows with respect to the x and y coordinate axes.

The first question involves area. Write functions squareArea, triangleArea, circleArea and ellipseArea which will compute areas from the information describing the object. Write function main to prompt the user for the information for one of each object and pass it to the area functions; the returned results should then be displayed.

The second question involves the notion of inside. Write four functions insideSquare, insideTriangle, insideCircle and insideEllipse which will take the same information describing the object as well as a coordinate pair (x,y) and determine whether or not (x,y) lies inside the object. Display these results as well. You may assume that the triangle is isoscles (but not necessarily equilateral).
Posted Date: 2/27/2012 1:53:26 AM | Location : United States







Related Discussions:- C++, computer programming, Assignment Help, Ask Question on C++, computer programming, Get Answer, Expert's Help, C++, computer programming Discussions

Write discussion on C++, computer programming
Your posts are moderated
Related Questions
Write a Program to illustrate the call by value? #include . int compute_sum(int m); int main( void) { int n=3, sum; printf("%d\n",n); /*3 is printed */ sum=compute_sum(n

Create the class Robot described in the Karel++ book. Description: The Robot class described in the Karel++ text is a derived class of ur_Robot. Create class Robot as a d

XML Publishing. Consider the following relational data: Products: pid Name Price Description 323 gizmo

The program output is intended to be parsed by a script working on the log file or correlated in a spreadsheet.  Use the "csv" format (you will have to research "what" is a "csv" f

Write a program to draw the figure shown below. the program must provide: a. Close the fish's mouth slowly (at least 5 moves from the original position to close the mouth) b.

#quFollow the my shell programming guidelines as in the other assignments. Write a shell script to send a customized mail message to the users listed on the command line by login (

MVC Architecture Model/view/controller (MVC) is a program structure, currently regarded an executive design used in program technological innovation. The design isolates "domain lo


what is the code to copy code on 1 jsp page to others

A non-empty string β is called a repeat pre x of a string s if ββ is a pre x of s. Give a linear time algorithm to find the longest repeat prefix of s. Hint: Think of using lca