Design and implement a class hierarchy for shapes

Assignment Help Programming Languages
Reference no: EM133534288

Object-Oriented Software Development

Activity

Learning outcome 1: Demonstrate understanding of classes, constructors, objects, data types and instantiation; Convert data types using wrapper methods and objects.

Learning outcome 2: Independently analyse customer requirements and design object-oriented programs using scope, inheritance, and other design techniques; Create classes and objects that access variables and modifier keywords. Develop methods using parameters and return values.

Learning outcome 3: Demonstrate adaptability in building control and loop structures in an object-oriented environment; Demonstrate use of user defined data structures and array manipulation.

Project: Implement a Class Hierarchy for Shapes

Problem Description:

Design and implement a class hierarchy for shapes using Java inheritance. Your solution should include the following classes:

1. A Shape class, which represents the base class for all shapes. It should have a field for the color (treat it as text) of the shape, as well as methods for calculating the area and perimeter of the shape.

2. A Rectangle class, which extends the Shape class and includes additional fields for the width and height of the rectangle.

3. A Circle class, which extends the Shape class and includes an additional field for the radius of the circle.

Your solution should also include a main method that demonstrates the functionality of the shape system. This should include creating fiveinstances of the different classes, putting them into an appropriatearray, calculating the area and perimeter of each shape, describing the color of each shape, and printing out the results using a loop. You should also include an UMLdiagram design of your classes.

Your code should be well-documented and follow Java coding conventions.

Analysis/Design/UML:State what you need to implement, methods required and UML diagram ... etc.

Coding: (Paste your code here, including Shape, Rectangle, Circle and main class using Courier 10pts)

Screenshots of your output and testing.

Reference no: EM133534288

Questions Cloud

Explain similarities and differences between the generations : How do you explain the similarities and differences between the generations? What is more influential: experience, SES, heritage, or age?
Why is that percent higher or lower than the national : Write down the degree of independence of all your relatives over age 65, such as grandparents and great-grandparents, great aunts and great uncles, and so on.
Describes development best and discuss 3 reasons : describes development best and discuss 3 reasons why you think it is the best theory. How will this theory relate to your future work based on your interests?
Describe approach to organizational ethical decision-making : Describe your approach to organizational ethical decision-making and your plan for instilling ethical decision-making in those you lead.
Design and implement a class hierarchy for shapes : MITS4002 Object-Oriented Software Development, Victorian Institute of Technology - Demonstrate understanding of classes, constructors, objects, data types
Describe the characteristics of this population : Describe the characteristics of this population and what makes it diverse. Describe the needs of the population by identifying how society's structures
Discuss the role public, private, and voluntary organization : Consider your current employer or an employer for whom you aspire to work for in the future. (If neither of these is in the emergency management field
What were the most significant aha moments in reading sex : What were the most significant "aha" moments in reading Sex and the iWorld? Did anything Kuehne write about offend you? Surprise you? Scare you?
Discuss your dialog with him including anticipated reactions : How do you respond? What are the options for you both here? Discuss your dialog with him including anticipated reactions from him. Start your discussion with

Reviews

Write a Review

Programming Languages Questions & Answers

  Add details to the design of a file system and implement it

add details to the design of a file system and implement it in detail. The file system uses a variant of the scheme used by UNIX in that it allows for a hierarchical file directory and uses pointers to individual blocks of data. The disk used has 100..

  Write a rule in lex to print integer numbers

Write a rule in Lex to print integer numbers that are multiple of five. The numbers are allowed to have an optional sign (+/-). You are not neither allowed to.

  Write program to prints the question

Write a program that prints the question"do you want to continue?" and reads a user input. if the user input is"y", "yes", "ok", "sure", or "why not?".

  Write program with procedure which draws shape

Write down program with procedure which draws a shape of your choice. Your program must then call the procedure 10 times to draw the shape at 10 random locations.

  Introduction to Computing Science and Programming I CMPT 120

Introduction to Computing Science and Programming I- CMPT120 Assignment Help and Solutions, Simon Fraser University Canada. Implement an automated help.

  Draw simple shapes using python turtle graphics objects

Use variables to store values and update those values and draw simple shapes using Python 'Turtle Graphics' objects - repeat a block of code a given number

  Write program to compute amount of money

Write a program that computes the amount of money the computer club will receive from the proceeds of their candy sales project.

  Create a class for performing arithmetic with fractions

Create a class called Rational for performing arithmetic with fractions. Write a program to test your class. 1/2+2/3+3/4.......+98/99+99/100.Use integer variables to represent the private data of the class

  Write a recursive boolean function named ismember

Write a recursive Boolean function named isMember . The function should accept two arguments: an array and a value. The function should return true if the value is found in the array, or false if the value is not found in the array. Demonstrate t..

  How to update web pages using navy for unvisited link

The Marketing Director at Steel Solutions is unhappy that links on company Web page appear in blue. She has asked you to update Web pages to use navy for unvisited link.

  Creating loop to find number of items bought based on price

Make a block using a loop that will find the number of items that can be bought based on the price of the item and the total amount available to spend.

  Write a program which takes any amount from the user

Write a program which takes any amount from the user between (1 to 9999). The program should count the number of currency notes (starting from highest).

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd