Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please come up with an algorithm for the following: Write it in a logical order Use the following programmer defined functions. DO NOT modify the

Please come up with an algorithm for the following:
Write it in a logical order image text in transcribed
image text in transcribed
Use the following programmer defined functions. DO NOT modify the Functions: //function prototypes - DO NOT MODIFY THE FUNCTIONS //greets the user void Greeting(); // Input/output : one character by reference // displays and gets the menu choice: ('D', ' W ', ' Q ') void RunMenu(char* choicePtr); //Input/output : two doubles by reference //Input : one character by value(copy) //Processes the selection void ProcessSelection(char choice, double* checkPtr, double* savPtr); //SAME AS PROGRAM 4 //Input: one double and one character both by value(copy) //displays the balance of the account (' C ', checking or ' S ', savings) void DisplayBalance(double accountBalance, char account); // Input/output : one double by reference //declare, ask, and get the amount from the user and add it to the account void DepositMoney (double* balancePtr); // Input/output : one double by reference // declare, ask, and get the amount from the user and subtract it from the account void WithDrawMoney(double* balancePtr); //Input: 2 doubles by value (copy) //returns a 1 if the balance is >= subtractAmount //prints "not enough" message and returns if balance =100.00; double savingsBalance =200.00; FlLe" outPtr: FlLe inPtr, //creating the file and "write" the initial balances outPtr = fopen("balancesinput.txt", "w"); fprintf(outPtr, "\%fn", checkingBalance); fprintf(outPtr, "\%fn", savingsBalance); //Open the file and "read" the balances inPtr = fopen("balancesinput txt", "r"); fscanf(inPtr, "\%lf", \&checkingBalance); fscanf(inPtr, "\%lf", \&savingsBalance); //the rest of the main function code and while loop //save the new balances to the file at the end, right before retum 0 printf("InSaving to the fileln"); fprintf(outPtr, "\%fln", checkingBalance); fprintf(outPtr, "\%fun", savingsBalance); return 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions