Principles of programming
Assessment
Activity 3.1
Prepare UML use case diagrams for the following scenarios, making assumptions where necessary:
1. McDonald’s Family Restaurants has a long history of evolving with the needs of its customers and of adapting to changes in technology. One technological change that suited its business structure and operations was the use of touch-screen terminals in its restaurants. The terminals allow customers to place their orders, including making customisations (e.g. extra cheese, no mayonnaise, etc.) and to pay for their order without needing to interact with a cashier. This, in turn, allows McDonald’s to put more staff into the area where meals are prepared in the hope of increasing the throughput of orders. The terminal is required to present the menu available to customers, allow them to place an order, customise their order. The terminal should then allow the customer to finalise and pay for their letter. It should finally print a receipt for the customer to take to the counter when collecting their meal. (This scenario is presented first because it is very similar to the worked example in this half of the module.)
2. PumpIt Power Gyms is a franchise chain of 24-hour gyms that operate across the country. Franchisees run and operate each of the gyms and the franchisor supports the ongoing operation through collective marketing, and standardised software. The system has access points at the front desk where members (the name given to customers when they have signed up to the gym) first enter and sign-in. The system then must allow a new customer to sign up to become a member, taking various personal information and issue them with a membership card that provides their authentication for entering the gym. It should request a monthly membership payment, that the customer makes. It should also assign the member a personal trainer and keep track of their progress through a plan of fitness prescribed by the trainer. If the member likes, they can sign up for classes such as Pilates and Yoga and also for fitness competitions. The gym will attract sponsors from the local area so that the winner of competitions will have a prize.
3. The local municipal li
ary has a number of books in its collection, that bo
owers can bo
ow for a predefined time. The li
ary should allow new bo
owers to sign up and then to bo
ow from that day. The li
ary has determined that books should be returned within 8 weeks and if not, a late fine is to be applied to the bo
ower’s account. For each week the book is late, up to a maximum of the cost of the book’s replacement value, the fine is applied. Bo
owers are required to pay their outstanding fines before they can bo
ow any other books. The li
ary also provides access to specialised resources such as microfilm, newspapers, magazines and databases, all of which cannot be bo
owed. The li
ary runs a special program called story time, which is open to any bo
ower who has no outstanding fines to
ing their children along on a Tuesday morning for somebody to read stories.
Activity 3.2
Write a program using c++ on visual studio
1. Access the Australian Taxation Office website and find the cu
ent tax tables for individuals. Write a program that asks the user to enter their tax file number (using a ‘string’ data type) and then to enter their taxable income for the cu
ent financial year. If the user does not have an Australian tax file number, they should enter ‘0’ instead. Then, based on the taxable income, the program should return the tax payable on their taxable income.
2. Write a program that helps with children’s multiplication. It should ask the user, which number they are learning to multiply and then produce a set of 12 multiples (i.e. from one through twelve). When execution finishes it should continue to ask for numbers to multiply unless a 0 is entered at the keyboard.
3. Write a program that accepts a date from the user in three parts: a month, a day and a year. Ensure that the date values are valid before printing the the final value to the screen for the user.