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
Support for Multi-Targeting The multi-targeting function of Vision Facilities allows you specify the particular edition or account of the .NET Structure that is required for your p

**This programming assignment is for use in the LINUX/UNIX environment!! Introduction: System administration often requires custom written programs and tools. One problem a syste

Most popular news websites publish their RSS ( Really Simple Syndication ) feeds. If you haven 't heard of RSS, you may have a look at this article on Wikipedia. In this assignm

how to make a program using vb?seriously i don''t know

How to i write a car rental program in jgrasp

Please explain about sub programming.

Tamagochi were all the rage in the 90's as a small toy that had limited functionality but modelled a pet. The "owner" could do the following • Feed the pet • Heal the pet

W.A.S.S to find the factorial of a given number. Program # W.A.S.S to find the factorial of a given number.    echo -e "enter number:\c"            #  \c Suppress trailing n

Let the player (denoted U in the diagram below) navigate around the board until she wins the game by finding the exit or is killed by a monster. A player begins the game with a sli

Matlab Assignment # For each of the three datasets (data1.txt, data2.txt, and data3.txt in bnhw2q2.zip), cluster the data using k-means in Matlab, with k=2, 3, 4 and 5 using the pr