SJSU Sales System Programming Questions

Project Description

Write a program that allows the user to manage the sales amounts of the current year.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Sample Run

Product Sales Management System

show – Display all sales recordsview – View an amount of a specified monthmax – View the highest sales amountmin – View the lowest sales amountedit – Edit an amount of a specified monthtotal – Get the total of all salesquit – Terminate the program

Command: shwInvalid command. Try again

Command: showjul $9762dec $2457may $2429apr $3463nov $88oct $6735mar $1073jan $14317feb $4176sep $2437aug $15578jun $4324

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Command: viewThree-character month: junThe sales amount: $4324

Command: maxThe highest sales amount: $15578

Command: minThe lowest sales amount: $88

Command: editThree-character month: JunAmount: 1000New amount updated

Command: showjul $9762dec $2457may $2429apr $3463nov $88oct $6735mar $1073jan $14317feb $4176sep $2437aug $15578jun $1000

Command: totalTotal: $63515

Command: quitThank you for using my app.

Specifications

  • The project should contain three files: main.h, main.cpp, and functions.asm
  • main.h contains the following items:C/C++ libraries – Imports necessary library functionsconstant definitions – Defines constants for arrays:#define MONTH_SIZE 4 //Max number of characters for the month: 3 letters and ‘\0’#define LINE_SIZE 20 //Max number of characters for each line of the text file #define COMMAND_SIZE 10 //Max number of characters for each user command
  • struct definition – Defines a structure named salesRecords that contains the month and the sales amount membersfunction prototypes – Defines function prototypes used in man.cpp and functions.asm
  • main.cpp contains the following functions:main() – Starts the projectprint_title() – Prints the title of this applicationprint_menu() – Prints the command menuread_file() – Reads a text filewrite_file() – Writes a new sales amount for a specified month back to the fileget_amount() – Receives the new sales amount from the user
  • functions.asm contains the following procedures:show – Displays all data of the year max – Returns the highest sales amountmin – Returns the lowest sales amountview – Prints a sales amount for a specified monthedit – Modifies a sales amount for a specified monthtotal – Returns the sales total for the year
  • functions.asm also contains the following items:MONTH_SIZE = 4 ;Max number of characters for the month: 3 letters and ‘\0’MONTHS = 12 ;Max number of months of the yearsalesRecords STRUCTFunctions prototypes defined in main.cpp: get_amount() and write_file()Data labels and messages
  • Use monthly_sales.txt to get months and sales amounts. Note that a tab character is a delimiter for the month and the amount in this text file.
  • The main function should define a structure for one month data, an array of characters for a command, and an array of 12 structures for all sales.
  • All the commands should be entered in the main function and the program calls corresponding assembly language procedures.
  • Use C/C++ code to read the text file and store the sales data in the array of structures. Each line is stored in a structure which has the following members:char month[MONTH_SIZE];int amount;
  • MONTH_SIZE is a constant which is defined as 4.
  • If the sales data of any month is edited, the program should write the entire updated array of structures back to the text file.
  • Use the integer format for sales amounts.
  • Assume the user enters valid inputs, so you are not required to check data type exceptions.

All files must be ran together and not separately. Please write the code in x86 assembly language with Irvine 32.inc and also using Visual Studio 2022 and not VS Code. Also provide the output similar to the example from the Visual Studio Debugger after code is complete.

(Provided a main.h and main.cpp that does allow for the user to change the sales amount for a specified month but not too sure if it implements the other commands but just wanted to provide a reference.)

jul 9762
dec 500
may 2429
apr 3463
nov 88
oct 6735
mar 1073
jan 14317
feb 4176
sep 2437
aug 15578
jun 4324

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER