Explain how the functions in your program are designed

Assignment Help Computer Engineering
Reference no: EM133482110

Question:

In this assignment you need to write C program that simulates total sales for an online fruits/vegetables store. Your role is to help this store manage the payments process and print out the receipts for the customer.

Main Requirements:
A. Write the following data types to access/retrieve "cartList" linked list:

1. Create struct type called Item that contains the following information: item ID, item name, item price , and quantity (i.e. number of units per an item).

2. Create array of string that contains 10 types of fruits and vegetable. For example, char itemsName[15][15] = { "","Carrot", "Apple", "Orange", "Parsnip", "Avocado", "Blueberry", "Cherry", "Asparagus", "Cabbage", "Celery"};

3. Create array of double that contains the prices of the items in Names respectively. double itemsPrice[15] = { 0, 1.5, 2.25, 2.75, 1.25, .99, 1.25, 2.25, 2.00, 3.5, 1.25};

4. Create struct type called Item that contains the following information: item ID, item name, item price , and quantity (i.e. number of units per an item).

5. Create struct called Node that contains the item and a pointer to an item.

6. Create shopping cart as a linked list of items called "cartList".

B. Write the following functions to manage the "cartList":

Randomly create 10 ID items( from 1 to 10} with their quantities { from 1 to 10 } and add them to myCartList. You need to retrieve the name and the price from the Names and price lists.
1. Add an item to the cartList.
2. Update the quantity of a given item ID in cartList.
3. Delete an item ID from the cartList.
4. Display Items- including the number of items in the cart and the total payment.
5. Compute Payment - the number of items in the cart and the total payment
2Spring/Summer 2023- Prog20799 Data Structures and Algorithms Development in C
6. Save the items in a file called "receipt.txt" including items detail, number of items, and total payment.

C. In your C program you should:
• Use proper C libraries.
• Avoid using hardcoded values (use #define when appropriate).
• Use reasonably optimized code: minimize time & space complexity, place data on the
heap, avoid repetitive code, etc.

D. Answer the following questions

• -What are the data types used in this program?
• -Can you explain how the program works, step by step?
• -Can you explain any algorithms (e.g., Sorting/searching) or techniques you used in your program?
• -How are data allocated?
• -What challenges did you face when writing the program and how did you
overcome them?
• -Can you explain how the functions in your program are designed to improve modularity, code organization and reusability.

Reference no: EM133482110

Questions Cloud

Draw the recursion tree for bubblesort : List the capabilities that any data and information processor, whether organic, mechanical, electrical, or optical, must have
Discuss key concepts as they may relate to your chosen case : Discuss key concepts as they may relate to your chosen case. Apply facts from your case to support conclusions on the applicability of concepts.
Calculate the accounts receivable turnover : Calculate the accounts receivable turnover and the average collection period ratio for The Coca-Cola Company for the most current year presented.
Why is governance difficult in cyberspace : Why is governance difficult in cyberspace? Share an example and explain your response
Explain how the functions in your program are designed : Can you explain how the functions in your program are designed to improve modularity, code organization and reusability.
What are the economic issues involved : What are the economic issues involved? Which economic theories or approaches best explain the issue? What are the statistical facts related to the issue?
Which of the five theories in the text most closely mirrors : Neither deontology nor duty ethics are explicitly addressed in the text. Which of the five theories in the text most closely mirrors your conclusions
Make a product pitch for your selected product : Make a product pitch for your selected product to present to potential stakeholders and Analysis of how your solution is similar to or different from existing
What will be the actual code for the program to run : What will be the actual code for the program to run - entering for one event only You have been asked to design and develop a computer program to manage

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd