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
(a) Define a procedure called make-avl-tree which makes an AVL tree with one node. Also create another constructor build-avl-tree that creates an AVL tree from a root, left subtree

Write a Prolog predicate remove_nth(N,L1,L2) that is true if list L2 is just list L1 with its Nth element removed. If L1 does not have an Nth element then the predicate should fail


We want a program that will allow us to print a "grade list" of the students in a class. The program should loop, asking for a name, midterm score, and final score. It should th

What is an abstract class:   Abstract class is stated as an abstract concept that cannot be instantiated or comparing to interface this can have some implementation and interface c

Characteristics of procedure-oriented programming: Emphasis is on doing things (algorithms). Large programs are divided into smaller programs known as functions.

Show that we can represent pairs of nonnegative integers using only numbers and arithmetic operations if we represent the pair a and b as the integer that is the product 2 a 3 b .

How to lunch webcame via viusal studio 2012

(a) Define a procedure (subsets x) that takes a list as a single argument and returns all 2^n subsets of that list, i.e. the power set of the list; e.g. (subsets '(a b c)) ==> (

Object-oriented programming paradigm Object  Oriented  Programming  is  an  aproach  in  which  a  program  is  viewed  as  a  dynamic  network  of collaborating objects, where