1
answer
0
watching
124
views

Hello. I appriciate ur help with this. Unfortunatly code did not work in my vs code. One of the libraries lastly listed #include <openssl/sha.h> is not existing. Also, the bottom of code there is info that iv never used in my class, not sure. // Define the struct for a category. struct Category  char name

 

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include <time.h>

#include <openssl/sha.h>

 

// Define the maximum length of a string.

#define MAX_LENGTH 100

 

// Define the number of items in each category.

#define NUM_MEAT 2

#define NUM_DELI 2

#define NUM_PHARMACY 2

#define NUM_SEAFOOD 2

#define NUM_BEVERAGE 2

#define NUM_CANNED 2

#define NUM_JARRED 2

#define NUM_DRY_FOOD 2

#define NUM_DAIRY 2

#define NUM_BAKERY 2

#define NUM_PERSONAL_CARE 2

#define NUM_PAPER_GOODS 2

 

// Define the number of categories.

#define NUM_CATEGORIES 12

 

// Define the durable life period of each category.

#define DURABLE_LIFE_PERIOD_MEAT 5

#define DURABLE_LIFE_PERIOD_DELI 4

#define DURABLE_LIFE_PERIOD_PHARMACY 2

#define DURABLE_LIFE_PERIOD_SEAFOOD 3

#define DURABLE_LIFE_PERIOD_BEVERAGE 6

#define DURABLE_LIFE_PERIOD_CANNED 8

#define DURABLE_LIFE_PERIOD_JARRED 10

#define DURABLE_LIFE_PERIOD_DRY_FOOD 12

#define DURABLE_LIFE_PERIOD_DAIRY 7

#define DURABLE_LIFE_PERIOD_BAKERY 2

#define DURABLE_LIFE_PERIOD_PERSONAL_CARE 9

#define DURABLE_LIFE_PERIOD_PAPER_GOODS 14

 

// Define the encryption key for encryption method 1.

#define ENCRYPTION_KEY_1 "zyxwvutsrqponmlkjihgfedcba"

 

// Define the encryption key for encryption method 2.

#define ENCRYPTION_KEY_2 "nopqrstuvwxyzabcdefghijklm"

 

// Define the encryption key for encryption method 3.

#define ENCRYPTION_KEY_3 "plmoknijbuhvygctfxrdzeswaq"

 

// Define the encryption key for encryption method 5.

#define ENCRYPTION_KEY_5 "abcdefghijklmnopqrstuvwyxz"

 

// Define the encryption key for encryption method 6.

#define ENCRYPTION_KEY_6 "0123456789"

 

// Define the encryption key for encryption method 7.

#define ENCRYPTION_KEY_7 "USD"

 

// Define the number of digits for the barcode.

#define BARCODE_LENGTH 10

 

// Define the number of items in the store.

#define NUM_ITEMS (NUM_MEAT + NUM_DELI + NUM_PHARMACY + NUM_SEAFOOD + NUM_BEVERAGE + NUM_CANNED + NUM_JARRED + NUM_DRY_FOOD + NUM_DAIRY + NUM_BAKERY + NUM_PERSONAL_CARE + NUM_PAPER_GOODS)

 

// Define the struct for an item.

struct Item {

    char name[MAX_LENGTH];

    char category[MAX_LENGTH];

    char company[MAX_LENGTH];

    double purchased_price;

    double sale_price;

    int quantity;

    char date_purchased[MAX_LENGTH];

    char date_production[MAX_LENGTH];

    char expiry_date[MAX_LENGTH];

    int store_code;

    char currency[MAX_LENGTH];

    char barcode[BARCODE_LENGTH + 1];

};

 

// Define the struct for a category.

struct Category {

    char name

For unlimited access to Homework Help, a Homework+ subscription is required.

Avatar image
Liked by brm and 1 others

Unlock all answers

Get 1 free homework help answer.
Already have an account? Log in

Related questions

Weekly leaderboard

Start filling in the gaps now
Log in