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

  How do you write an equality operator

Question: How do you write an equality operator (call it =/) that determines if two yearday instances are equal?

  Draw a finite state machine with three states

Using the following specifications, draw a finite state machine with three states (l, ll, and Ill), six events, and four actions.

  Record your thoughts about similarities

Record your thoughts about similarities and differences between visits with a child under age 3 and this child who is over 3 years of age.

  Examine the balance of pre-treatment variables

Examine the balance of pre-treatment variables, gender (bg_female), age (bg_b1_age) and marital status (bg_married)

  Describe the organization cloud computing implementation

Describe the organization's Cloud Computing implementation and the benefits they realized from the implementation. What was the result of implementing Cloud.

  Why most groupware is deployed today over the web

Explain why most groupware is deployed today over the Web. Explain in what ways physical meetings can be inefficient. Explain how technology can make meetings

  Calculate the necessary heat flux along the nozzle surface

Listed below, as functions of axial distance, are the radius, mass velocity, temperature, and pressure inside a supersonic nozzle.

  Prompt and read the number of discs in each peg

Write a program for playing the game of NIM. Our version of the game starts with up to 20 pegs and up to 10 discs in each peg.

  An algorithm for counting the number of optimal alignment

Describe an algorithm for counting the number of optimal alignments, given an optimal cost matrix S.

  Write a program that reads a square array of integers

Write a program that reads a square array of integers and determines whether or not it is a magic square.

  Explain what an information system is

Introduction to Systems Analysis-Level-Semester 4, Year 2-National Council for Higher Education- BACHELOR OF LIBRARY AND INFORMATION SCIENCE.

  What are the major social structure theories

What are the major social structure theories that apply to digital crime - Explain how cyber stalking and harassment could be the result of strains

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