Explore BrainMass

Program test data and fields for library items records

[a] Discuss and suggest a good set of test data for a program that gives an employee a $50.00 bonus cheque if the employee has produced more than 1,000 items in a week.

[b] Assume that a library keeps a file with data about its collection, one record for each item the library loans out. Name at least eight(8) fields that might be stored for each record.


Solution Preview

[a] Number of items produced by employee in a week could be less than, equal to, or more than 1000. We need to give bonus only when it is more than 1000. We can express this in our program as --

if (itemsproduced > 1000)
bonus = 50;
bonus = 0;

So, we need to partition our input (number of items produced) into two sets : "> 1000" and "<= 1000". One ...

Solution Summary

Solution briefly explains the process of finding a good set of test data in the given case. For addressing the second question, it considers two cases - "keeping track of loaned items" and "records of items that can be loaned".