Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 - balance : int - total : int

+ getPrice() : int + getBalance() : int + insertMoney (int amount) : void + printTicket() : void + refundBalance() : 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, includingat least twofields andat least fourmethods. Remember, methods can collect input, provide output, or govern the internal operations of the machine itself.

Step by Step Solution

3.38 Rating (148 Votes )

There are 3 Steps involved in it

Step: 1

Name VendingMachine Description The VendingMachine is a device commonly found in public spaces allow... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Analysis Synthesis And Design Of Chemical Processes

Authors: Richard Turton, Joseph Shaeiwitz, Debangsu Bhattacharyya, Wallace Whiting

5th Edition

0134177401, 978-0134177403

More Books

Students also viewed these Programming questions

Question

What are the need and importance of training ?

Answered: 1 week ago

Question

What is job rotation ?

Answered: 1 week ago

Question

What is the difference between form drag and frictional drag?

Answered: 1 week ago