global_variables.c is made of different functions and arrays. It must be executed alongside with files, (main.h) and (colours.h)
The Car Sales project must make its output to the Console (i.e. the Command Prompt using printf) and it must exhibit the following features as a minimum:
5%: Loopi...
//Amount of cars to declare as available
//Using unsigned, due to expecting the value to decrease later on.
unsigned long setCarStock = 15; /* <-- This value depends on how many cars each
brand has been assigned
Has to be adjusted manually, before the software starts */
//Source: https://canvas.anglia.ac.uk/courses/26905/pages/week-1-introduction-to-
computer-systems
/*Mercedes*/ unsigned short remainingBrandMercedes = 5, carsNeededMercedes = 0;
/*Bmw*/ unsigned short remainingBrandBmw = 5, carsNeededBmw = 0;
/*Audi*/ unsigned short remainingBrandAudi = 5, carsNeededAudi = 0;
/*Porsche*/ unsigned short remainingBrandPorsche = 0, carsNeededPorsche = 0;
/*Toyota*/ unsigned short remainingBrandToyota = 0, carsNeededToyota = 0;
//Discount floats
//Dividing by 100% to give us a float result, which we then multiply by the amount
//Of cars they have purchased, to give us the amount that needs to be discounted.
float divisonpercent = 100;
//Discount value attributes for Mercedes //Discount value attributes for
Audi
float discount_appliedMerc = 0; float discount_appliedAudi = 0;
float discount_divide_mercedes = 0; float discount_divide_audi = 0;
float updated_price_mercedes = 0; float updated_price_audi = 0;
//Discount value attributes for Bmw //Discount value attributes for
Porsche
float discount_appliedBmw = 0; float discount_appliedPorsche =
0;
float discount_divide_bmw = 0; float discount_divide_porsche =
0;
float updated_price_bmw = 0; float updated_price_porsche =
0;
//Discount value attributes for Toyota
float discount_appliedToyota = 0;
float discount_divide_toyota = 0;
float updated_price_toyota = 0;
//ARRAY - Car Models
char carModels[5][25] = { "Mercedes", "Bmw", "Audi", "Porsche", "Toyota" };
//ARRAY - Model Prices
float carPrices[] = { 25000.0, 22000.0, 11000.0, 12000.0, 18000.0 };
//ARRAY - Remaining amounts for each brand
unsigned short modelsRemainingAmount[] = { 5, 5, 5, 0, 0 };
//INTEGER variables
int i;
long long cardNumber;
short expDate;
short cardCode;
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller kaloyantitov. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $33.13. You're not tied to anything after your purchase.