Running a gift shop seems a boring job for Mr. Bob. Therefore, he decided to start an online business to sell gifts. Based on his long experience running a boutique gift-shop, Mr. Bob knows that his customers are mainly looking to buy unique and fashionable gifts. Most of the customers are last minute buyers and may not be looking for brand name items. Therefore, Mr. Bobs gift shop has fashionable items categorized into seven sections for, boys, girls, men, women, kids (boy/girl), adults (man/woman) and all (anyone).
Mr. Bob wants to hire someone to write for him a program to run his online gift shop. Your task is to write a C++ program to help Mr. Bon running his shop. The inventory data is saved in a text file named inventory.txt (provided for you). Data in this file is organized into records. The first line of the file shows the number of records. A record contains many fields:
< item name, price, category, number of pieces in stock, (conditional) out of stock since date > >, where fields are separated by a space, as follow:
Sunglasses 20.23 a 150
Perfume-w 40.55 w 206
Perfume-m 30.43 m 327
Wallets 15.61 d 70
Bracelets 35.00 w 500
Games-b 21.56 b 678
Games-g 21.56 g 0 MM:DD:YY Toy 27.00 k 972
IPad 33.17 a 5
Cellphone 100.00 a 0 MM:DD:YY
Cellphone cover 25.00 a 400
Notes:
Key:
- w: woman,
- m: man,
- g: girl,
- b: boy,
- a: all,
- k: kids "boy or girl",
- d: adults "man or woman"
Some items are out of stock - these are the items with a value of zero in the fourth column
Date, in the fifth column, is only recorded for items that are out of stock
Mr. Bob wants to help his customers find the right gift for the special someone. Also, he wants to make sure that each customer has enough money to spend on a specific gift. Therefore, the customer menu which you will develop should:
Please note that, your program should allow the user to buy more than one gift type. Also, your program should allow the user to buy more than one item of the same gift type. For example, a customer can buy in one order: a sunglass, two wallets and an IPad. Your program should prevent users from exceeding the current available number of pieces in stock column four from the inventory.txt data file. In your program, you must use an array to read the data from the input file inventory.txt. Name the array giftItems. The size of the array cannot be fixed; instead the size should be read from the data file. All elements of the array are records read from the inventory data file. Use struct to represent the elements of the array. As a result, the data will be read into an array of structs. After processing each customer order, you should update the inventory database and save the data into inventory.txt.
The main() function of your program should be very simple. The main function should be a collection of variables declaration and functions call. You will need to use different functions to read the data from the inventory.txt, wrappingService.txt and perform other functionalities. You must use a separate function to print the customer receipt after each order, and use another function to save the updated inventory inventory.txt.
Description: You must design a complete Black-Box testing plan for the "online gift shop" program which you developed in Assignment #1. Start by reviewing the problem description of Assignment #1. Your task is to apply what you have learned about black-box testing techniques to develop a full suite of test data for this program. Use the template file provided in the Instructions and supporting files on BlackBoard to organize your tests and test data.