100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Other

global_variables.h code

Rating
-
Sold
-
Pages
2
Uploaded on
24-02-2023
Written in
2022/2023

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%: Looping Menu with 3 main actions: View Cars Stock, Buy Cars, View Sales Data Note: A Car is defined by its price and model 5%: Must contain at least three arrays to cars information (maximum of 10 Car models) Two for recording the price and name of a car One for recording the remaining amount of each car model 5%: View Cars Stock will show a list of models and remaining amount 4%: Sorted by remaining amount in descending order 10%: Buying Cars needs to record the total price/customer name/customer age/if discount was given/discount value/number of cars and update existing car arrays as necessary once a sale is concluded 4%: Any data being accepted from the keyboard needs to be validated and filtered (i.e. only accept correct data from the customer and keep asking until correct data is entered) 10%: Sales Data for a Car Model is also displayed as a total sum for each model, in addition to displaying what each customer bought 10%: Sorted by total sale amount in descending order 10%: Sales Data is to be stored in a file 10%: When the program launches, it should read previous sales data from the file, if it exists, to be used as initial data 2%: Exiting the software thanks the customer for using it before closing 15%: Make use of topics not taught in the module, but can be applied in a relevant way to this software project (do not include features/topics just for the sake of showing that you know how to use/implement it, instead consider why it will improve the software for the user) - e.g. struct 5%: Your code needs to follow recommended coding standards and good practice (see Week 2) 5%: Also submit a Logbook detailing your engagement with the Pluralsight platform, including your Pluralsight C exam (test) results. Please see this page for information on this. Total: 100% Note: Please do not feel like you need to limit yourselves to the above features list. I'm happy for you to explore adding in other features beyond the ones listed above (but as a minimum the program must exhibit the listed features). The marks are awarded based on the complexity of each feature, as the case may be. For example, having a Looping Menu that does not validate user input (i.e. it blindly trusts the keyboard input), but works well for its intended purpose is worth 2%, while also validating the user's choice (i.e. did they type an expected character that's part of the menu? - switch does not count for this purpose) before it is fully accepted would attract 4-5% (assuming the code works as intended with no issues), depending on the technical quality of the work. A similar approach will be taken when marking the entire project.

Show more Read less
Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Unknown
Course

Document information

Uploaded on
February 24, 2023
Number of pages
2
Written in
2022/2023
Type
Other
Person
Unknown

Subjects

Content preview

//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;

/*Mercedes Float*/ /*Bmw Float*/ /*Audi Float*/
float totalPriceMercedes = 0; float totalPriceBmw = 0; float totalPriceAudi
= 0;
/*Porsche Float*/ /*Toyota Float*/
float totalPricePorsche = 0; float totalPriceToyota = 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;
$34.95
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached


Document also available in package deal

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
kaloyantitov Norwich City College of Further and Higher Education
Follow You need to be logged in order to follow users or courses
Sold
84
Member since
3 year
Number of followers
69
Documents
14
Last sold
5 months ago
Level 2, Level 3, 3 Extended Assignments - Information and Technology.

Please note, all assignments listed on my profile are completed to a distinction standard, they have been marked and graded by teachers. Please send me a message if more information is needed or if something is unclear. Kind Regards

2.8

19 reviews

5
6
4
2
3
1
2
2
1
8

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions