A UML Machine
In the context of programming, UML class diagrams provide an overview of your programming goal without wrapping yourself around the metaphorical axle. UML class diagrams list the two essential components of a class: its fields and its methods. Consider the UML diagram below, which represents the TicketMachine class in your reading. Notice that a horizontal line separates the fields (above) from the methods (below). The symbols preceding each line indicate whether the fields or methods are designated private (–) or public (+).
TicketMachine |
– price : int |
+ getPrice() : int |
Think about a machine with which you are familiar, whether it be an ATM or the coffee machine at your office. All machines take some sort of input, generate an output, and can be described by some state. In the case of the TicketMachine class, input is provided via the insertMoney() method, output is generated by methods such as getPrice() and printTicket(), and the state is described by fields like balance. Think about the methods and fields that would best characterize your machine if it were a Java class, including the variable and return types for each.
post the name of your machine and briefly describe it. Then, generate a UML class diagram for that machine, including at least two fields and at least four methods. Remember, methods can collect input, provide output, or govern the internal operations of the machine itself.
12 years ago 15
Purchase the answer to view it
- atm_machine_uml.pdf
- The oldest catacombs in Rome
- X+y=6 -x+y=18
- Discouraged Workers and the Economy
- Is the prepositional phrase of a future Olympic athlete adjective or adverb
- How does a person’s perception of a good as a necessity or a luxury affect his or her purchase of...
- could the same laboratory techniques used for making synthetic gems be used for making synthetic sedimentary rock
- Name two examples of food products that use all of the general functions in cooking. Write in full sentences. Example:...
- closed
- can you help me make an outline for my first amendment research paper? im in 8th grade. it has to...
- Tutor4U - Homework due 12/20/2012