Question: PLEASE USE THE FOLLOWING PROGRAM DEFINE FUNCTIONS. DO NOT MODIFY THE FUNCTIONS PLEASE. PLEAS DECLARE A CHARATER AND USE scanf WITH %c TO GET THE

PLEASE USE THE FOLLOWING PROGRAM DEFINE FUNCTIONS. DO NOT MODIFY THE FUNCTIONS PLEASE.

PLEAS DECLARE A CHARATER AND USE scanf WITH %c TO GET THE CHARATER FROM THE USER INSTEAD OF getchar()

PLEASE USE 2019 VISUAL STUDIOS PROGRAMMING IN C.

THANK YOU.

#define _CRT_SECURE_NO_WARNINGS //for Visual studio compiler

#pragma warning(disable:6031) //ignore scanf warnings#include //for printf and scanf

//function prototypes

void Greeting(void);

//welcome the user to the gas purchasing app

int DisplayGasSelections();

//display the gas choices and related item number

//declare, ask, get, and return the item number

double GallonPrice(int itemNumber);

//input: item number

//returns the price per gallon of the selected type of fuel

double CheckForEnoughMoney(double accountBalance, double total);

//input: amount of money in the account and the transaction total

//gets money from the user until the user has enough to make the purchase

//make the purchase and returns the remaining balance

double AddMoney(double accountBalance);

//input: amount of money in the account

//displays the amount of money available in the account

//allows the user to add money to the account

//returns the updated balance after the money has been added

void DisplayBalance(double accountBalance);

//input: amount of money in the account

//displays the amount of money available in the account

int main()

{

//declare variables here

//greet the user - Greeting function call

//display the account balance - DisplayBalance function call

//get the item number - DisplayGasSelections function call

//get the price per gallon - GallonPrice function call

//ask and get the number of gallons

//calculate the total//check if there is enough money - CheckForEnoughMoney function call

//ask and get an integer from the user when they are ready to see the remaining balance

//display remaining account balance

//thank the user

//say goodbye to the user

printf(" Have a great day! ");

// do not forget to return SUCCESS

// type your command here...

}

//function definitions

void Greeting(void)

//welcome the user to the gas purchasing app

{

}

int DisplayGasSelections()

//display the gas choices and related item number

//declare, ask, get, and return the item number

{

}

double GallonPrice(int itemNumber)

//input: item number

//returns the price per gallon of the selected type of fuel

{

}

double CheckForEnoughMoney(double accountBalance, double total)

//input: amount of money in the account and the transaction total

//gets money from the user until the user has enough to make the purchase

//make the purchase and returns the remaining balance

{

while (accountBalance < total)//not enough

{

accountBalance = AddMoney(accountBalance);

printf(" -------------------------------------------------------");

printf(" The total is $%.2f and you have $%.2f in your account ", total, accountBalance);

}

//make the transaction

//return the accountBalance

{

double AddMoney(double accountBalance)

//input: amount of money in the account

//displays the amount of money available in the account

//allows the user to add money to the account

//returns the updated balance after the money has been added

{

//return the accountBalance

}

void DisplayBalance(double accountBalance)

//input: amount of money in the account

//displays the amount of money available in the account

{

}

Sample Output:

Welcome to the gas purchasing app We offer fast service for you to select the grade of gas and number of gallons

You will be presented with a list of available fuel options

Please select the number for the item you wish to purchase.

If you do not have enough money to cover the purchase, you will be asked to add money to your account until you have enough to make the purchase.

You have $0.00 available in your account

-----------------------------------------

Here are the gas options (select the fuel option by entering the item number):

1. Regular $2.35 per gallon

2. Midgrade $2.69 per gallon

3. Premium $2.99 per gallon

4. Diesel $2.60 per gallon

5. E85 $2.09 per gallon

Enter your selection (1-5):3

How many gallons of gas do you need? 16

-------------------------------------------------------

The total is $47.84 and you have $0.00 in your account

Enter the amount to add: 20.00

-------------------------------------------------------

The total is $47.84 and you have $20.00 in your account

Enter the amount to add: 20.00

-------------------------------------------------------

The total is $47.84 and you have $40.00 in your account

Enter the amount to add: 15.25

-------------------------------------------------------

The total is $47.84 and you have $55.25 in your account

. . . You are now purchasing the gasoline . . .

Enter any character to see your remaining balance: t

You have $7.41 available in your account

Thank you for purchasing gas using this app!

Have a great day!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!