A4 - CSC180 Introduction to Computer Programming Assignment...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSC180 Introduction to Computer Programming Assignment 4 Due: 11:59 PM, December 3, 2008 1 Problem description Improve the receipt machine in the assignment 3. The program can sort trans- actions by transaction time, in increasing order or decreasing order. You must hold transactions and sort transactions (if requested) using a singly-linked list. This assignment is worth 6% toward your final grade. A transaction file, e.g., trans.txt , has the following format: TRANSACTION:K0123456789-7:53 01/11/08 09:25 C Programming A Modern Approach:98.75:2:p Molecular Biology of the Cell:152.57:1:G C Programming A Modern Approach:98.75:3:p PAYMENT:mc:1234567887654321:500 TRANSACTION:K0000246871-7:263 10/08/07 14:25 Highlighter:4.99:2:b Diablo Pad Holder:29.99:1:N Agenda:5.99:1:g PAYMENT:cash:50.25 TRANSACTION:K0123456789-8:202 09/09/08 12:00 The assignment 3 describes trans.txt . All transactions are in or after the year 2000. Assume that a transaction file is always valid. Suppose the program name is receipt . Typing either ./receipt or ./receipt-h prints the following usage information: Usage: ./receipt [OPTION] [FILE] 1-a TEMP append TEMP to FILE-d id[,item] delete a transaction or an item-f id find a transaction-k >t|<t|=t delete transactions happened after, before or at time t-p print receipts-r 0|1|2 specify sort criterion for items-s 0|1 specify sort order for items-t 0|1 specify sort order for transactions-h this message Given trans.txt , typing the command ./receipt -t 0 -p trans.txt prints the following receipts, where-t 0 means sorting transactions by transaction time in increasing order. Welcome to U of T Bookstore Koffler Student Services Bldg. 214 College St. Toronto, ON M5T 3A1 Phone: 416.640.7900 GST # R132094343 Sale Receipt: K0000246871-7 Cashier: 263 10/08/07 14:25 2 Highlighter $9.98 1 Diablo Pad Holder $29.99 1 Agenda $5.99 Subtotal: $45.96 Tax: GST: $0.80 PST: $0.80------ Total: $47.56 CASH $50.25 Change due: $2.69 Receipt required for all refunds Welcome to U of T Bookstore Koffler Student Services Bldg. 214 College St. Toronto, ON M5T 3A1 Phone: 416.640.7900 2 GST # R132094343 Sale Receipt: K0123456789-8 Cashier: 202 09/09/08 12:00 Subtotal: $0.00 Tax: GST: $0.00 PST: $0.00------ Total: $0.00 No payment $0.00 Change due: $0.00 Receipt required for all refunds Welcome to U of T Bookstore Koffler Student Services Bldg. 214 College St. Toronto, ON M5T 3A1 Phone: 416.640.7900 GST # R132094343 Sale Receipt: K0123456789-7 Cashier: 53 01/11/08 09:25 2 C Programming A Mo $197.50 1 Molecular Biology $152.57 3 C Programming A Mo $296.25 Subtotal: $646.32 Tax: GST: $7.63 PST: $39.50------ Total: $693.45 MASTER CARD $500.00 12345678******** Change due: $-193.45 Receipt required for all refunds 3 The current receipts have the same format as the receipts shown in the assignment 3....
View Full Document

This note was uploaded on 01/10/2011 for the course CSC 180 taught by Professor Na during the Fall '01 term at University of Toronto.

Page1 / 12

A4 - CSC180 Introduction to Computer Programming Assignment...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online