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

1.  A function that produces the Collatz sequence and counts the number of terms. 2.  A main function that calculates interesting values about the Collatz sequence. 1.The Col

1. Write a shell script to locate executable files. This script takes a list of file names from the command line and determines which would be executed had these names been given a

1- Allocate array with 32bit 100 element 2- Prompt the user to enter the maximum or the upper bound of the random value 3- Read the value and use it generate random numbers to init

Question 1 How will you add styles to a document? Question2 How will you view XML in different ways? Question 3 Explain various file handling mechanism available in PERL

Ask question #Minimum 100 A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets

Write a program (calculation.ccp) to allow the user to perform an arithmetic operation on the two complex numbers entered.  The user can key in one of the four operations: addition

Is there one can help me in the language Lisp and Prolog

A traveler wants to purchase a number of traveler''s checks, each having a set amount for four different currencies: Mexican pesos, Euro dollars, Swiss francs, and US dollars. A t