Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Raptor Design a superclass called Shape that contains one function-getArea(). The getArea function in the Shape class will simply return 0, you will derive from it in your subclasses mentioned below. Define 3 subclasses of the Shape class-circle, rectangle,

and triangle. The circle class will need a radius field, the rectangle class will need length and width fields, and the triangle class will need base and height fields. Declare all of the appropriate setters and getters for each of these classes. The circle

class will calculate it's area as PI*r*r. The rectangle's area is length * width. The triangle's area is .5 * base * height. Demonstrate your classes be writing a menu driven program that allows the user to select which shape they want to create. After making

their selection, the program will ask the user to input the appropriate dimensions for that shape. The program should then display the area for that shape. The menu will continue to display until the user chooses to quit. Example Output: Please select an option:

1) Area of a circle 2) Area of a rectangle 3) Area of a triangle 4) Quit Enter your selection: 2 [Enter] Enter the rectangle length: 10 [Enter] Enter the rectangle width: 25 [Enter] The area for your rectangle is 250 Please select an option: 1) Area of a circle

2) Area of a rectangle 3) Area of a triangle 4) Quit Enter your selection: 4 [Enter]

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91411920
  • Price:- $35

Priced at Now at $35, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Sorting algorithms are one kind of algorithm whose

Sorting algorithms are one kind of algorithm whose performance may depend upon the data. Choose one of the sorting algorithms or any other algorithm and explain whether the there are any differences in the best, average ...

The stock price for international business machines ibm

The stock price for International Business Machines (IBM) historically has followed an approximately normal distribution (when adjusting for inflation) with a mean of $155.483 and standard deviation of $4.0278. What is t ...

Question what is an information system what are the

Question: What is an information system? What are the business benefits of information management? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow the APA format.

The standard bcd-to-7-segment decoder such as the 74ls47

The standard BCD-to-7-segment decoder (such as the 74LS47 used in the lab), has active-LOW outputs. Should the 7-segment display be common-anode or common-cathode? Why do you think the decoder is configured for active-LO ...

Question for this assignment you will continue your

Question: For this Assignment, you will continue your practice as a critical consumer of research. You will critically evaluate a scholarly article related to one-way ANOVA testing. To prepare for this Assignment: • Use ...

Tablet recommendationpreparation imagine the following

Tablet Recommendation: Preparation Imagine the following scenario: A hospital has hired you as a consultant to recommend a tablet for their employees to use, with these parameters: The hospital provides wifi access to th ...

What are the critical issues we must think about while

What are the Critical Issues we must think about while designing a Lexical Scanner? The results of that development, e.g., discuss both process and product.

Regarding sorting lists an algorithm such as quicksort was

Regarding sorting lists, an algorithm such as QuickSort was preferred if the list was, for the most part, in random order, and that an algorithm such as Insertion Sort was preferred if the list was essentially in order. ...

Display the manager of the employee with the oldest project

Display the manager of the employee with the oldest project start date (start_date). (This query requires 3 nested queries, start by finding the min start_date from project, then find the emp_id from project where start_ ...

Sum of consecutive integersa write a program that prompts

Sum of consecutive integers A) Write a program that prompts for an integer-let's call it X-and then finds the sum of X consecutive integers starting at 1. That is, if X = 5, you will find the sum of1+2+3+4+5=15 B) Modify ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As