Back2School is a family-owned store that has been selling school supplies for the last ten years. The owner wants to expand its business to cater to possible customers who may not have the chance to visit their store, so they wish to make their business online.
You have been offered an opportunity to build a software for Back2School to enable their online business. Essentially, you will be writing a program that will allow customers to order products “online” and get them delivered to their designated address. The program accepts as input a purchase order (PO), which is simply a shopping list containing the item codes and quantity of each item for purchase. The program then generates an invoice with the pricing and delivery costs.
The Back2School management is keen to make sure that you will be able to deliver the program by the deadline; as they wish to start the online business as soon as possible. You, as the developer of the program, are required to deliver the program in milestones. This document describes the first milestone.
First Milestone: Item Pricing Lookup
Your first milestone is a program that will allow items to be queried from the inventory. Specifically, there are three queries that your program will accept:
display all categories;
display all items within a given one-character category code; and
display a specific item given the unique product code
At present, there are only four categories; and the number of items per category is also provided by the management. The Back2School management has provided all the details of these on the five tables below. Please be aware that in the second milestone, the management may add more categories and items per category/
Essentially, in this milestone, you are to write your program so that information about these categories and the items are kept within the code itself; and you are to use the appropriate C program constructs (selection/conditional or iterative constructs) so that the queries can be performed.
Table 1. Item Categories for first milestone
Category Code |
Description on the program |
Detailed description (not to be put into the program) |
W |
Writing Instruments |
This includes pens and pencils |
P |
Papers |
This include different sizes of bond papers, yellow pads, oslo papers and colored papers |
B |
Bags |
This includes backpacks and tote bags |
E |
Envelopes |
This includes different sizes (long and short) of brown envelopes and folders |
Table 2. Items in category W (Writing instruments)
Item Code |
Description |
Unit Price (in PHP) |
Weight (in kg) |
1001 |
Ballpoint pen |
10.00 |
0.020 |
1002 |
Rollerball pen |
20.00 |
0.030 |
1003 |
Number 1 pencil |
12.00 |
0.010 |
1004 |
Number 2 pencil |
12.00 |
0.010 |
1005 |
Number 3 pencil |
12.00 |
0.010 |
1006 |
Mechanical pencil |
50.00 |
0.050 |
1007 |
Fountain pen |
100.00 |
0.100 |
Table 3. Items in category P (Papers)
Item Code |
Description |
Unit Price (in PHP) |
Weight (in kg) |
2001 |
Short-sized Bond Papers (1 ream) |
200.00 |
0.800 |
2002 |
Legal-sized Bond Papers (1 ream) |
220.00 |
0.820 |
2003 |
A4-sized Bond Papers (1 ream) |
250.00 |
0.800 |
2004 |
Yellow Pads (100 sheets) |
45.00 |
0.450 |
2005 |
White Pads (100 sheets) |
35.00 |
0.350 |
2006 |
Legal-sized Oslo Paper (20 sheets) |
50.00 |
0.550 |
2007 |
Colored Papers (20 sheets) |
20.00 |
0.200 |
Table 4. Items in Category B (Bags)
Item Code |
Description |
Unit Price (in PHP) |
Weight (in kg) |
3001 |
Back pack |
250.00 |
0.400 |
3002 |
Tote bag |
120.00 |
0.300 |
3003 |
Gym bag |
380.00 |
0.500 |
3004 |
Messenger bag |
420.00 |
0.750 |
Table 5. Items in Category E (Envelopes)
Item Code |
Description |
Unit Price (in PHP) |
Weight (in kg) |
4001 |
Short-sized Brown Envelopes (10 pcs) |
50.00 |
0.020 |
4002 |
Legal-sized Brown Envelopes (10 pcs) |
80.00 |
0.030 |
4003 |
Short-sized Plastic Envelopes (10 pcs) |
120.00 |
0.500 |
4004 |
Legal-sized Plastic Envelopes (10 pcs) |
140.00 |
0.600 |
4005 |
Short-sized Folder (10 pcs) |
80.00 |
0.600 |
4006 |
Legal-sized Folder (10 pcs) |
120.00 |
0.700 |
Presented below are sample runs showing what your program should achieve to complete the first milestone. The Back2School management will review your work and if they are satisfied with your work, they will send you the agreed-upon development fee. The development fee is highly dependent on the quality of the work you have done and if your program achieves the desired functions, including handling of invalid user inputs.
For the purpose of the course, the CCPROG1 requirement, the development fee will be translated in a form of a grade and feedback for improvements in preparation for the next milestone requirement.
Please carefully study the example runs of the first milestone program below. The user input is printed in boldface and underlined. For sample run #1, the first query is demonstrated, and the only user input is 1. The program then prints out the four categories, displaying the one-letter code and the short description of each category (this is from column 2 of Table 1 above). Note that the information on column 3 for Table 1 is not stored in the program.
Sample Run #1.
On startup, the program displays the three options for query. The only acceptable choices are 1, 2, or 3. If the user has entered another input value apart from the three choices, the program is to display an error message: “Invalid category” and it exits afterwards with “Good bye!”.
Category W |
Description Writing instruments |
Item Code Range 1001-1007 |
P |
Paper |
2001-2007 |
B |
Bags |
3001-3004 |
E
Good bye! |
Envelopes |
4001-4006 |
Sample Run #2.
This sample run demonstrates what your program will display for the second query. This requires two user inputs: 2 which means the second query followed by exactly one of four category codes. In this example, W was the user input. Note that there are only four valid choices for the second input: W, P, B, or E. If the user has input any other character, the program is to display this error message: “Invalid category”.
Item Code |
Description |
Unit Price |
Unit Weight |
1001 |
Ballpoint pen |
10.00 |
0.020 |
1002 |
Rollerball pen |
20.00 |
0.030 |
1003 |
Number 1 pencil |
12.00 |
0.010 |
1004 |
Number 2 pencil |
12.00 |
0.010 |
1005 |
Number 3 pencil |
12.00 |
0.010 |
1006 |
Mechanical pencil |
50.00 |
0.050 |
1007
Good bye! |
Fountain pen |
100.00 |
0.100 |
Sample Run #3:
What you see below is the program behavior and output for the third query. In this case, the user enters 3 and then enters the unique item code, in this case, 3004 was entered. Your program has to validate the item code if it exists on the Table 2, 3, 4 and 5 above.
Item Code |
Description |
Unit Price |
Unit Weight |
3004
Good bye! |
Messenger bag |
420.00 |
0.750 |
Additional programming notes:
Carefully consider how to design your program to minimize repeating the data stored. For example, it should be possible to write your code so that the item descriptions like “Messenger bag” appear only once within your program. Hint: consider using functions and
Consider writing a single function to implement query #3, that is, given the item code, it simply displays the item details, i.e., item code, description, unit price and unit weight. This will make it easier to implement query #2; essentially using a loop to display each item in a given category, like W.
It is also worthwhile to design the program so that it is relatively easy to add more
categories and add more items per category.
DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of