1. Design a UML diagram to represent class called damConstruction, to implement the properties of a water dam construction. Your class should have the instance variables to store the length (in meters), width (in meters), depth (in meters), the rate (in litters per minute) at which the water is filling the dam, and the rate (in litters per minute) at which the water is draining from the dam. Add appropriate constructors to initialize the instance variables. Also add member functions to do the following: determine the amount of water needed to fill an empty or partially filled dam; determine the time needed to completely or partially fill or empty the dam; add or drain water for a specific amount of time. 2. Following the UML diagrams you designed in 1., code the class. 3. Write a test program to test the class you coded in 2.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 15PE
icon
Related questions
Question

answers all questions and code using java

1. Design a UML diagram to represent class called damConstruction, to implement the
properties of a water dam construction. Your class should have the instance variables
to store the length (in meters), width (in meters), depth (in meters), the rate (in litters
per minute) at which the water is filling the dam, and the rate (in litters per minute) at
which the water is draining from the dam. Add appropriate constructors to initialize the
instance variables. Also add member functions to do the following: determine the
amount of water needed to fill an empty or partially filled dam; determine the time
needed to completely or partially fill or empty the dam; add or drain water for a specific
amount of time.
2. Following the UML diagrams you designed in 1., code the class.
3. Write a test program to test the class you coded in 2.
Transcribed Image Text:1. Design a UML diagram to represent class called damConstruction, to implement the properties of a water dam construction. Your class should have the instance variables to store the length (in meters), width (in meters), depth (in meters), the rate (in litters per minute) at which the water is filling the dam, and the rate (in litters per minute) at which the water is draining from the dam. Add appropriate constructors to initialize the instance variables. Also add member functions to do the following: determine the amount of water needed to fill an empty or partially filled dam; determine the time needed to completely or partially fill or empty the dam; add or drain water for a specific amount of time. 2. Following the UML diagrams you designed in 1., code the class. 3. Write a test program to test the class you coded in 2.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning