Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

plan the logic for a program for the sales manger of the couch potato furniture

ID: 3584811 • Letter: P

Question

plan the logic for a program for the sales manger of the couch potato furniture company. The manger needs a program to determine the profit on any item sold. Input includes the wholesale price and retail price for an item. The output is the item's profit, which is the retail price minus the wholesale price. Use three modules. The main program declares global variables and calls housekeeping module prompts for and accepts the retail price, computes the profit and displayes the result. The end-of -job module displays the message "Thanks for using this program. what would the data dictionary look like?

Explanation / Answer

Structure of Data item typedef struct data_dict{ float wholesale_price; float retail_price; float profit; }data_dict; The data dictionary will be a collection of above structures. The program is as follows: int main() { // Declare the global variables int max_items = 500; // Put any value here for the max size of data dict. data_dict item[max_items]; int n = 0; // Number of items transactions done. loop{ //Call housekeeping n = housekeeping(item, n) //Check if user wants to continue // If yes loop // else break } end-of-job() } housekeeping(data_dict item) { //Input the retail price and whole sale price // Compute profit = wholesale price - retail price. // Enter the details in item return n+1 } end-of-job() { //Print thank you }