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
Design an application that opens and analyses word files. Requirements: Create an application that analyses text documents. It should open a text file, read each word in

Topic Develop a Web site that will provide information about your organization. The Web site will need to have a user-friendly interface for users to enter their information;

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

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

how to get horizontal motion vectors field with quiver ?

Your program can be invoked with option: -d date, where date is entered in dd/mm/yyyy format. In this case, it must only print the following string: Found cookies expiring bef


Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Develop (i) a context diagram and (ii) a use case diagram to model the following functionalities of NetFlix. Netflix is an online video/DVD renting company. A customer desiring

Objective: In a programming language of your choice, write an intelligent agent able to play block Dominoes against a player. Together with this assignment you will find two pa