SOLGO Based on the UML class diagram and specification given below, write a complete Java program...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
SOLGO Based on the UML class diagram and specification given below, write a complete Java program conqa shivong s Shapes2D +calArea():double Shape -width: double -length: double ii. mush +setWidth() +selLength() Hof Pavalkoller: Shapes3D 101 -height: double +setHeight(double); void +calArea(): double a) Define set methods in class Shape. (1 mark) b) Define methods calArea() with formula area = width * length for class Shapes2D. (Hint: use super keyword) aldobilo (1.5 mark) =) Define methods calArea() with formula calVolume, volume = width*length*height for class Shapes3D. (Hint: use super keyword) (2 marks) d) Define a main class and do the followings: Create 1 object Shape. Assign width with 2.5 and length with 3.1 by calling the set methods. (1.5 mark) Create 1 object Shapes2D. Call calArea method and display the result. (1.5 mark) Create 1 object Shapes3D. Assign height with 2.0 by calling the set methods. Call calArea method and display the result. (2.5 marks) SOLGO Based on the UML class diagram and specification given below, write a complete Java program conqa shivong s Shapes2D +calArea():double Shape -width: double -length: double ii. mush +setWidth() +selLength() Hof Pavalkoller: Shapes3D 101 -height: double +setHeight(double); void +calArea(): double a) Define set methods in class Shape. (1 mark) b) Define methods calArea() with formula area = width * length for class Shapes2D. (Hint: use super keyword) aldobilo (1.5 mark) =) Define methods calArea() with formula calVolume, volume = width*length*height for class Shapes3D. (Hint: use super keyword) (2 marks) d) Define a main class and do the followings: Create 1 object Shape. Assign width with 2.5 and length with 3.1 by calling the set methods. (1.5 mark) Create 1 object Shapes2D. Call calArea method and display the result. (1.5 mark) Create 1 object Shapes3D. Assign height with 2.0 by calling the set methods. Call calArea method and display the result. (2.5 marks)
Expert Answer:
Answer rating: 100% (QA)
sent describes a scenario where you need to write a Java program based on a UML class diagram The classes involved are Shape Shapes2D and Shapes3D Heres a breakdown of the information provided in the ... View the full answer
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Posted Date:
Students also viewed these programming questions
-
The book value of a firm's equity is $100 million and it's market value of equity is $157 million. The face value of it's debt is $52 million and it's market value of debt is $74 million. What is the...
-
An air-conditioning manufacturer has spent $1,500,000 on developing a new ductless AC system. The estimated market size for the ductless AC systems is 26,000 units in 2017, and is expected to grow...
-
Write a complete Java program to do the following. program to do the following.... Create superclass UTAPerson with String name and String ID. This class has an instance method Who Am I () that...
-
- A large, open bucket of water sits on a table. The height of the water level in the bucket is 4 m above the surface of the table. A small hole is made in the bucket at a distance of 10 cm above the...
-
The Kretovich Company had a quick ratio of 1.4, a current ratio of 3.0, an inventory turnover of 6 times, total current assets of $810,000, and cash and marketable securities of $120,000. What were...
-
How could your choices of coffee or cocoa help preserve forests, biodiversity, and local economies in tropical countries?
-
Electric outlets in England are 230 V. Alice brings her electric kettle from England, where it draws \(13 \mathrm{~A}\), and wants to use it in the United States. She uses a step-up transformer to...
-
Fugate Inc. is considering these two alternatives to finance its construction of a new $2 million plant: 1. Issuance of 200,000 shares of common stock at the market price of $10 per share. 2....
-
make a copy of Capstone project (task_manager.py) and save it in the Dropbox folder for this project. Also, copy and paste the text files (user.txt and tasks.txt) that accompanied the previous...
-
Barone, Inc. is involved with several situations that possibly involve contingencies. Each is described below. Barone's fiscal year ends December 31, and the 2021 financial statements are issued on...
-
The 2 and 3 years zero coupon spot yields are 3.5% and 3.8%, respectively. What is the 1 year forward rate starting in 2 years?
-
2. Consider the curve C defined by T= F(0)-1-sin (0) (a) Sketch the graph of F(0) for 0s 0 2. 2 1 F(6) I */2 3/2 2T =0. i. Explain and clearly indicate the points where F(6)=( ii. Explain and clearly...
-
Which over the counter (OTC) medication should be avoided with a nonbenzodiazepine?
-
What are the barriers to the development and/or utilization of online payment systems?
-
Use Lagrange multipliers to optimise the function Q= 6K + 20L - 0.025K^2 - 0.05L^2 subject to 3K+8L=1140 .
-
Discuss strategies in selecting and adopting various electronic payment methods in developing versus developed countries .?
-
Question 3 Not yet answered Marked out of 3.00 Flag question Paul is the 100% owner and manager of Lormary Pty Limited, a small successful private company looking to secure a lucrative long term...
-
What are the two methods used to translate financial statements and how does the functional currency play a role in determining which method is used?
-
This String class method performs the same operation as the + operator when used on strings. a. Add b. Join c. Concat d. Plus
-
What happens when you serialize an object? What happens when you deserialize an object?
-
What does it mean to let the user control a loop?
-
Explain how the control variate technique is implemented.
-
Suppose that in September 2013 a company takes a long position in a contract on May 2014 crude oil futures. It closes out its position in March 2014. The futures price (per barrel) is \($88.30\) when...
-
Use the technique discussed in Section9.4 to develop a GEE approach for zeroinflated Poisson model for count responses in longitudinal studies. Section9.4: 9.4 Marginal Models for Longitudinal Data...
Study smarter with the SolutionInn App