C homework – Shopping cart application

The homework for the session 2 was to create a shopping cart application that allow us to manage products, purchase products, add products, display products and generate a bill if you purchase some items in our application.

I’m going to explain my code, first you have to call the libraries you are going to use, in this case we are using three libraries 1First we are going to declare our functions before our funtion main3and also create our structs like Product and BillstructsThen in our function main we are going to see how it works, we give to you at first 4 options: manage product, purchase a product, generate a bill or exit and with a while we evaluate the input 2the principal functions in our function main are 3: manageProduct, purchaseProduct, generateBillmanageproductbefore seeing this functions we have to define our structs who is calling a function called updateProductstructfindupdateproductThen continuing with our first menu in the manageproduct function we are going to display 3 options add a product, display all products or be back at the first menuaddproductdisplayallproduct

then we have purchase a product, here we are going to ask if you want to purchase some items one by onepurchaseproduct

and finally we have the generateBill function that generates a bill with the items that we purchase in the second optiongeneratebillAnd that’s all the structure of the code, if you want to get the code, you can check it in my repository here.



Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión /  Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

Conectando a %s