Find Jobs
Hire Freelancers

C Programming Assignment 3

$10-30 CAD

Terminado
Publicado hace alrededor de 8 años

$10-30 CAD

Pagado a la entrega
Problem Description Your job for this project is to write an application that manages shopping. Application Features: • Customers are able to view an inventory of items. • Customers are able to buy items. • Customers are able to quickly search and get item details. • Your application interacts with the customer. • Your application adds/removes items to a shopping cart. • Your application calculates the total cost. Design Requirements [login to view URL] must use const or #define directives to declare constants. Here is a sample list of constants: MAX_INVENTORY_SIZE 4 TAX .13 2. 2. You are allowed to code additional functions. 3. You must document (i.e. comments and indentation) your code properly. 4. You must use blank lines to separate logical units in the source code. [login to view URL] are not allowed to declare global variables. Milestone #3 In this milestone, you are going to use a C structure, write four functions and extend the main program from Milestone #2. In Milestone #2, the main program uses two parallel arrays to represent inventory data (i.e. sku and price) of a grocery store. In this milestone, the main program uses a C structure to represent a shopping cart. Whenever a customer wants to buy an item, one adds it to the shopping cart. One may also remove the shopping cart. The C structure contains information about the items that have been added to the shopping cart. Here is the C struct type that should be used in this milestone: struct Cart{ int sku[MAX_ITEMS]; float price[MAX_ITEMS]; int quantity[MAX_ITEMS]; float totalCost; int size; }; sku[MAX_ITEMS]: An array of the SKU numbers of the items that are added to the cart. price[MAX_ITEMS]: An array of the prices of the items that are added to the cart. Quantity[MAX_ITEMS]: An array of the quantities of the items that are added to the cart. MAX_ITEMS: the maximum number of shopping items that may be put into a shopping cart. Assume MAX_ITEMS is 10. totalCost: Total cost of the items in the shopping cart. size: Size of the shopping cart. a) Replace void displayCart() from MS2 with the following function: void displayCart(const struct Cart* pShoppingCart); • This function receives an address to an object of Cart. • This function displays the shopping cart in an informative format. See sample output. • This function must not display items that have quantity zero. b) Replace void addCart() from MS2 with the following function: void addCart(struct Cart* pShoppingCart,const int sku[],const float price[]); • This function receives an address to an object of Cart, and two parallel arrays sku and price representing the inventory. • This function prompts the user to input the SKU number of an item that one wants to add to the shopping cart. • This function searches through the inventory (the sku array) to find if the item exists in the array (use searchInventory function from MS2). more in attached file.
ID del proyecto: 10024551

Información sobre el proyecto

1 propuesta
Proyecto remoto
Activo hace 8 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
$20 CAD en 2 días
5,0 (13 comentarios)
2,9
2,9

Sobre este cliente

Bandera de CANADA
Hamilton, Canada
5,0
27
Forma de pago verificada
Miembro desde feb 22, 2016

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.