Usetutoringspotscode to get 8% OFF on your first order!

  • time icon24/7 online - support@tutoringspots.com
  • phone icon1-316-444-1378 or 44-141-628-6690
  • login iconLogin

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 : intbalance : int

total : int

+ getPrice() : int

+ getBalance() : int

+ insertMoney (int amount) : void

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 theTicketMachine class, input is provided via the insertMoney() method, output is generated by methods such asgetPrice() 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.

 

You can leave a response, or trackback from your own site.

Leave a Reply

Powered by WordPress | Designed by: Premium WordPress Themes | Thanks to Themes Gallery, Bromoney and Wordpress Themes