Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Help needed on final assesment

Please read the following and if you think there is anyway you could help please let me know as any help would be much appreacated.



Mail me on u05rdh@abdn.ac.uk

or

Richie@corsaworld.co.uk



Thank you



CS1501 Programming Methods



Exercise 5



Supermarket sales records



This is the assessment project for 2000



A supermarket is concerned that it might have run out of some goods before it closes at 21:00 hours, when all items will be

refilled by the overnight shelf-stackers. The managers of the supermarket would like to find those items that have run out, but

have found that sending a person to look at the shelves is expensive and unsatisfactory. They believe that an item of which the

last sale was before 16:00 hours may have run out. Your task is to find those items with no sales after this time, and report them

to the supermarket management.



The supermarket has available text files from the tills which show which items were sold when, with lines like





b9823 9:37



a67543 11:52



b9823 19:06





i.e



an item code which is an arbitrary string of alphanumeric characters

one or more spaces

a time on a 24 hour clock



1.write a function minutes( str24:string): integer which will convert a time in 24 hour format to the number

of minutes since 00:00.



2.file market1.txt contains data about a single item, with the times in order. Write a program to report the time of the last

sale, in minutes since 00:00, using writeln on a text screen.



Up to CAS 11 may be attained by presenting programs for this section.



3.file market2.txt contains data about one item, but the times are out of order. Write a program to find the last sale time of

the item, and report it, again using writeln on a text screen.



Up to CAS 14 may be attained by presenting programs for this section.



4.file market3.txt contains data about many items, again fewer than 1000, but because the data has come from several tills,

the times are shuffled. Write a program to find the last sale time of each item, and report the item codes and times of

items which were last sold before 16:00, and only those items, again using writeln on a text screen.



hint: create an array of records each of which contains an item code and the time of its last known sale.



Up to CAS 18 may be attained by presenting programs for this section.



5.Use file market3.txt again, but use binary search for looking up the strings.



Up to CAS 20 may be attained by presenting programs for this section.



Assessment Criteria



This programming assignment will be assessed on the following criteria:

Accuracy

Does the program compile?

Does the program solve the problem that was set?

Does the program solve all parts of the problem that was set?



Style and Maintainability

Helpful layout ?

Meaningful identifiers?

Sensible partition into subroutines?

Local variables?

Helpful, but not excessive, comments?



Robust Programming

Solves the problem generally?

Survives unexpected inputs?



Permitted language constructs



You may use any Pascal you know. The problems are soluble with material that has been taught, but you are encouraged

to use any other constructs or methods.


Sign In or Register to comment.