Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    GIF shows where to locate </> in the thread and or post editor toolbar.
    To learn more about how to use our BBCode feature, review our "How to post your code into threads" here.

    Thank you, Code Forum.

Need this code done by tonight.

beginner101

New Coder
Code:
#define _CRT_SECURE_NO_WARNINGS

//for Visual Studio compiler#pragma warning(disable:6031)

//ignore scanf warnings #include<stdio.h>

//for printf and scanf#include<ctype.h>

//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\n");

printf("We offer convenient gas purchasing\n");

}

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("\n----------------------------------\n");

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

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

printf("----------------------------------\n");

}

//add the rest of the conditions}
 

Attachments

Last edited:
Hi @beginner101,

Welcome to Code Forum!

Before we can help you out, could you please reformat your original thread to have all code within </> formatting. This is easier on the eyes and can also use to quickly look through and copy if necessary. Along with reformating the code, please include what the issue is, what you are trying to do and if possible any screenshots or troubleshooting steps already taken.

I have locked the thread in the meantime.
 

Buy us a coffee!

Buy me a coffee.
Back
Top Bottom