Question: I need help making this C program which uses pointers. #include //for printf and scanf #include //for tolower function //function prototypes void Greeting(); //welcome the

I need help making this C program which uses pointers.

I need help making this C program which uses pointers. #include //forprintf and scanf #include //for tolower function //function prototypes void Greeting(); //welcome

#include //for printf and scanf

#include //for tolower function

//function prototypes

void Greeting();

//welcome the user to the gas station app

void ViewAndGetSelection(char* selectionPtr);

//input: the user's selection (input/output parameter)

//display the program options and get the users selection

//use an input/output parameter for the selection

void ProcessSelection(char selection, double* balancePtr);

//input: the user's selection by copy (input parameter)

//input: the account balance (input/output parameter)

//display a message that the selection has been entered

//display the balance when the user enters 'b'

//allow the user to add money to the account when the user enters 'u'

int main()

{

char choiceInMain;

double balanceInMain = 0.00;

//call the greeting function

//view and get the selection - function call

//change the selection to lower or upper case

//make sure the user did not enter q to quit

while (choiceInMain != 'q')

{

//process the selection

//view and get the next selection

//change the selection to lower or upper case

}

//say goodbye to the user

// do not forget to return SUCCESS

}

//function definitions

void Greeting()

//welcome the user to the coffee shop

{

printf("Welcome to the fuel app ");

printf("We offer convenient gas purchasing ");

}

void ViewAndGetSelection(char* selectionPtr)

//input: the user's selection (input/output parameter)

//display the program options and get the users selection

//use an input/output parameter for the selection

{

}

void ProcessSelection(char selection, double* balancePtr)

//input: the user's selection by copy (input parameter)

//input: the account balance (input/output parameter)

//display a message that the selection has been entered

//display the balance when the user enters 'b'

//allow the user to add money to the account when the user enters 'u'

{

if (selection == 'g')

{

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

printf("You selected %c ", selection);

printf("Here you will display the gas prices ");

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

}

//add the rest of the conditions

}

Intro to Programming in C-program 6 (smaller program) Assignment purpose: To compile, build, and execute an interactive program using functions from stdio.h (printf and scanf), simple math in C, conditions, a simple loop, and programmer defined functions, with pass by copy input parameters and with input/output parameters. #define _CRT_SECURE_NO_WARNINGS //for Visual studio compiler #pragma warning(disable:6031) //ignore scanf warnings #include //for printf and scanf Instructions: For this assignment you will begin to implement a menu driven program that simulates adds options to a gas station app. . The program will welcome the user with a friendly message. The user will be presented with a list of options The user will select from the options below: . 'G' to view the gas prices 'p' to purchase gas 'B' to view your account balance 'U' to add money to your account 'O' to Quit . The user may continue to select the options until entering 'Q' to quit (you may use tolower or toupper function from ctype.h) 1. For this assignment you will implement the menu and display messages 2. You will also display the balance when the user enters 'b' 3. You will also allow the user to add money to the account when the user enters u' The full implementation of a gas purchase will be completed in future assignments Use the following programmer defined functions. DO NOT modify the Functions: void Greeting(); //welcome the user to the gas station app void ViewAndGetSelection(char* selectionPtr); //input: the user's selection (input/output parameter) //display the program options and get the users selection //use an input/output paramet for the selection void ProcessSelection (char selection, double* balanceptr); //input: the user's selection by copy (input parameter) //input: the account balance (input/output parameter) //display a message that the selection has been entered //display the balance when the user enters 'b' //allow the user to add money to the account when the user enters 'u' Sample Output: What would you like to do? Please select from the following options: What would you like to do? Please select from the following options: Welcome to the fuel app We offer convenient gas purchasing *************************888**************************** What would you like to do? Please select from the following options: 'G' to view the gas prices 'p' to purchase gas 'B' to view your account balance 'U' to add money to your account 'O' to Quit Enter your selection: u 'G' to view the gas prices 'p' to purchase gas 'B' to view your account balance U to add money to your account 'O' to Quit Enter your selection: 9 Have a great day! 'G' to view the gas prices 'P' to purchase gas 'B' to view your account balance 'U' to add money to your account 'Q' to Quit Enter your selection: 8 You selected u How much do you want to add? 50.00 You selected g Here you will display the gas prices ******************************************************** What would you like to do? Please select from the following options: *************** ******* ******* *************** 'G' to view the gas prices what would you like to do? 'P' to purchase gas Please select from the following options: 'B' to view your account balance 'U' to add money to your account 'G' to view the gas prices 'Q' to Quit 'p' to purchase gas Enter your selection: b 'B' to view your account balance 'U' to add money to your account 'Q' to Quit You selected b Enter your selection: P Your current account balance is $50.00 You selected p Here you will make a purchase ******** ***** What would you like to do? Please select from the following options: ********************* What would you like to do? Please select from the following options: 'G' to view the gas prices 'p' to purchase gas 'B' to view your account balance 'U' to add money to your account 'O' to Quit Enter your selection: b 'G' to view the gas prices 'p' to purchase gas 'B' to view your account balance 'U' to add money to your account 'Q' to Quit Enter your selection: x You selected x That is not a valid option You selected b Your current account balance is $0.00 ********************************************************

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!