A. Case Study: Train stations often provide ticket machine that print a ticket when a customer...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
A. Case Study: Train stations often provide ticket machine that print a ticket when a customer inserts the correct money for their fare. The ticket machine works by customers 'inserting' money into them, and then the machine will print the ticket if the amount of money inserted is sufficient. Note that, for this naïve ticket machine, the fare is fixed which is RM7.50. However, if the amount of money inserted by the customer is insufficient, the machine will ask the customer to insert more money until the amount is sufficient, and then print the ticket as well as the balance. This machine keeps running total of the amount of money it has collected for the ticket fare, total amount of money inserted by the customer, and the total balance it has offered to the customer throughout the operation. Once the machine stops, the total amount collected, and the total balance for all customers throughout the operation will be displayed. Note: The machine is for buying ticket only, and it does not store passenger's information. Question 1: Identify 1 single object, including its attributes and behaviours for the above case study. Object Attributes and its data types Behaviours Question 2: Draw UML based on (1) above. Question 3: Translate the above UML into class definition. Question 4: Write a Java application class to do simulation. Ask user to insert amount of money to buy a ticket. " " If the money is sufficient, print the ticket and produce the balance if any. If the money is insufficient, the machine will ask the customer to insert more many until the amount is sufficient. The machine will only stop if the user requests to stop. Upon stop, the machine will display the followings: i. Total ticket sold. ii. iii. iv. Total amount of money collected from the ticket sold. Total amount of money inserted by the customer. Total balance it has offered (dispense) to the customer. A. Case Study: Train stations often provide ticket machine that print a ticket when a customer inserts the correct money for their fare. The ticket machine works by customers 'inserting' money into them, and then the machine will print the ticket if the amount of money inserted is sufficient. Note that, for this naïve ticket machine, the fare is fixed which is RM7.50. However, if the amount of money inserted by the customer is insufficient, the machine will ask the customer to insert more money until the amount is sufficient, and then print the ticket as well as the balance. This machine keeps running total of the amount of money it has collected for the ticket fare, total amount of money inserted by the customer, and the total balance it has offered to the customer throughout the operation. Once the machine stops, the total amount collected, and the total balance for all customers throughout the operation will be displayed. Note: The machine is for buying ticket only, and it does not store passenger's information. Question 1: Identify 1 single object, including its attributes and behaviours for the above case study. Object Attributes and its data types Behaviours Question 2: Draw UML based on (1) above. Question 3: Translate the above UML into class definition. Question 4: Write a Java application class to do simulation. Ask user to insert amount of money to buy a ticket. " " If the money is sufficient, print the ticket and produce the balance if any. If the money is insufficient, the machine will ask the customer to insert more many until the amount is sufficient. The machine will only stop if the user requests to stop. Upon stop, the machine will display the followings: i. Total ticket sold. ii. iii. iv. Total amount of money collected from the ticket sold. Total amount of money inserted by the customer. Total balance it has offered (dispense) to the customer.
Expert Answer:
Answer rating: 100% (QA)
Lets break down the requirements for our ticket machine Object TicketMachine Attributes fare Fixed fare for the ticket RM750 totalCollected Total amou... View the full answer
Related Book For
Introduction To Materials Management
ISBN: 978-9386873248
8th edition
Authors: Arnold J. R. Tony, Gatewood Ann K., M. Clive Lloyd N. Chapman Stephen
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
In Exercises 130, find the domain of each function. f(x) = 1 4 x - 2 3
-
In January 2017, Harold Corporation acquired 20% of Otis Company's outstanding common stock for $400,000. This investment gave Harold the ability to exercise significant influence over Otis. The book...
-
Silo Inc. sold investment land to PPR Inc. for $110,000 cash. Silos basis in the land was $145,000. Mr. and Mrs. J own 100 percent of the stock of both corporations. a. What is PPRs tax basis in the...
-
Two populations of monkeys are growing logistically. One population has carrying capacity K = 1000, and the other population has carrying capacity K = 5000. Describe how their population growth...
-
The following audit procedures are typical of those found in auditing the payroll and personnel cycle: 1. Scan journals for all periods for unusual transactions to determine whether they are recorded...
-
1. Consider the problem of returning change to a customer requiring the smallest number of coins. a. Show that the greedy algorithm given below returns the smallest number of coins for the coin set...
-
Consider a household that possesses $ 160,000 worth of valuables such as jewelry. This household faces a 0.2 probability of burglary, in which case it loses $ 70,000 worth of the valuables. Suppose...
-
Eric just moved to a new apartment in the city because of a new job. His old friend (Michael) who is living in the same city gave Eric a call asking him to do a basic statistical analysis of data...
-
Littleton Books has the following transactions during May. May 2 Purchases books on account from Readers Wholesale for $2,500, terms 2/10, n/30. May 3 Pays cash for freight costs of $120 on books...
-
Suppose that last year, the market price for a certain bond was $ 1 0 , 9 5 7 . Since then, the price has decreased by 1 0 . 9 % . If the current yield was 6 % last year, what is the current yield...
-
Micro Spinoffs Incorporated issued 10-year debt a year ago at par value with a coupon rate of 8%, paid annually. Today, the debt is selling at $1,180. If the firm's tax bracket is 21%, what is its...
-
Ellie Inc. manufactures stuffed animals. During 2 0 2 3 , total costs incurred in making 1 0 , 0 0 0 stuffed animals included $ 5 5 , 0 0 0 of selling, general, and administrative costs. The selling...
-
Investment Center Net Income Average Assets Cameras and camcorders $ 6,450,000 $ 29,000,000 Phones and communications 2,982,000 21,300,000 Computers and accessories 1,050,000 17,400,000 Assume a...
-
Are Free Trade Agreements Good for the Global Economy? Explain
-
B made an issue of 150,000 $1 ordinary shares at a premium of 20% the proceeds of which is received by cheque. What is the correct journal to record this? A. Bank Share capital Share premium B. Bank...
-
MPS parent X has planned order releases of 30 in weeks 2 and 4. Given the following product tree, complete the MRP records for parts Y and Z. Quantities required are shown in brackets. Z(2) Y(1) X T...
-
In problem 2.2, how much will be produced in each of the three months? In Problem 2.2 A company wants to produce 480 units over the next three months at a uniform rate. The months have 19, 20, and 21...
-
Given the following data, calculate a level production plan, quarterly ending inventory, and average quarterly inventory. If inventory carrying costs are $3 per unit per quarter, what is the annual...
-
Terms a Split-off point b Joint cost c Separable cost d By-product e Joint product f Product Definitions 1 Product with low sales value compared with the sales value of the main or joint product(s)....
-
Milj-Spe AS produces two joint products, cooking oil and soap oil, from a single vegetable oil refining process. In July 2022, the joint costs of this process were NOK 24 000 000. Separable...
-
Claude Deux-Bussy is the owner and operator of Boissons Barbe-Bleue Sarl, a bulk soft-drink producer. A single production process yields two bulk soft drinks, Pellas (the main product) and Mlisande...
Study smarter with the SolutionInn App