Problem Statement: Online Gift Shop

Phase 1

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:

  • Allow the customer to choose a gift by the item number.
  • The customer should be able to add multiple gifts (one at a time) to a cart.
  • The customer should be able to filter and see items based on a selected category: For example, provide the capability of displaying only items of category w or d, etc. as selected by the user. Remember category d points to both category w and m.
  • Prices printed on the screen must be formatted to 2 decimal places.
  • Date printed on the screen must be in the format: MM:DD:YY
  • Once the customer has finished adding all items to the cart, ask the customer about the wrapping type; basic wrapping for free or fancy wrapping for additional $10.50. Since Mr. Bob has no programming experience, he saves the price of this service in a text file called wrappingService.txt (provided for you). This means the file wrappingService.txt contains the text 10.50.
  • Ask the customer about the delivery; same day delivery for additional $15.00, next day delivery for $10.00, or within a one-week delivery for only $5.00. Finally, calculate and print the receipt with an additional 6.5% sales tax.

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.

Phase 2

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.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.