Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 11 Weeks Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Assignment Instruction
Mathematical CheatSheet:
Â
[Hint] Here is one possible design, but you don’t have to follow it. You are encouraged to come up with your own.
 ATTACHMENT PREVIEW Download attachment
Kui Du, Fall 20151Assignment InstructionConsidering the following quadrilateral (i.e., a shape with four sides) in a Cartesian coordinate plane (x-y plane):The shape consists of four points A, B, C, and D, whose x-y coordinates are shown as in the figure. For mathematicalsimplicy, we assume that following: (1) Point A is fixed in the origin (0,0); (2) Point B is fixed on the x-axis; (3) Point C,and D are fixed in quadrant I; and (4) Point C is to the right of Point DRequirements:ï‚·Write a program that first prompts users for five real numbers as XB, XC, YC, XD, YD. Note that, with these five realnumbers, the shape ABCD is determined.ï‚·[Task 1]Your first task is to display the accurate type of Shape ABCD on the screen (such asQuadrilateral,Trapezoid,Parallelogram,RectangleorSquare)ï‚·[Task 2]If Shape ABCD isTrapezoid,Parallelogram,RectangleorSquare,your second taskisto calculate its areaand display the result on screen.ï‚·[Programing Requirement]Your programMUSThave an inheritance hierarchy of five classes:Quadrilateral,Trapezoid,Parallelogram,RectangleandSquare. Each and every one of these five classesMUSThave a methodcalled Area(), which calculates the area of the shape. You can choose how to design the rest of the program.Other Requirements:In addition, please also meet the following two best practices as much as possible:oMake your app as user friendly as possible (e.g., easy-to-follow user instruction; clearly presented result;meaningful error messages; etc).oAnnotate your program with comments properly so that others can easily follow your logic.Mathematical CheatSheet:ï‚·Mathematical hints to solve the problem (Check their accuracy!)oif YC= YD, then Shape ABCD is at least atrapezoidoif YC= YDand (XC-XD)= XB, then Shape ABCD is at least aparallelogramoif YC= YDand (XC-XD)= XBand XD=0, then Shape ABCD is at least arectangleoif YC= YDand (XC-XD)= XBand XD=0 and XC= Yc, then Shape ABCD is asquareï‚·How to calculate the areas of different shapes:Point A(0,0)Point B(XB,0)Point C(XC, YC)Point D(XD, YD)