Home / Expert Answers / Computer Science / coding-in-c-please-intro-to-programming-in-c-program-5-assignment-purpose-to-compile-build-and-pa447

(Solved): coding in c please! Intro to Programming in C-program 5 Assignment purpose: To compile, build, and ...




Intro to Programming in \( \mathrm{C} \)-program 5
Assignment purpose: To compile, build, and execute an interactive program
Please use an app with only deposit Or quit MENU OPTIONS
1. Initialize the balance in the checking and savings account with t
Sample output:
Welcome to the bank deposit program
The balance in your checking account is \( \$ 12 \theta .67 \)
The balance
Enter  \( d \)  to make a deposit or  \( q \)  to Quit: \( q \)
Saving to the file
Have a nice day!
- laatname program5.c
Add name, date, and brief description here
\( +y \)
\#define CRT_SECURE_NO_WARNINGS //for Visus1 Studio
/et the account
\( / \) /if (account = \( =1 \) )
\( / /\{ \)
fleposit to checking
\( 1 / 1=(a c c o u n t==2) \)
Ifeposit to
coding in c please!
Intro to Programming in -program 5 Assignment purpose: To compile, build, and execute an interactive program using functions from stdio.h (printf and scanf), math in C, condition PRACTICE, a while loop, file input and output processing , and programmer defined functions. Instructions: For this assignment you will be implementing a program that simulates a banking application deposit ONLY with 2 accounts: checking and savings. The checking and savings balances will be "read from" and "written back" to a tat file called "balancesinput.txt" You should be familiar with program 4 before starting program 5 Use the following programmer defined functions. DO NOT modify the Functions: I/function prototypes - DO NOT MODIFY THE FUNCTIONS //greets the user void Greeting ; I/SAME AS PROGRAM 4 //Input: one double and one character //displays the balance of the account ('C') checking or ' 5 ', savings) void DisplayBalance(double accountBalance, char account); I/SAME AS PROGRAM 4 //Input: one double and one character //declare, ask, and get the amount from the user and add it to the account //return the updated balance (' ', checking or ' 5 ', savings) double DepositMoney(double accountBalance, char account); Use the template code provided to create the file with the checking and savings account balances in the file: int l double checkingBalance ; double savingsBalance ; FILE* outPtr: FILE InPtr; //creating the file and "write" the initial balances outptr = fopen ("balancesinput. txt", "w"); fprintf(outPtr, "sfln", checkingBalance); fprintf(outPtr, "tfln", savingsbalance); //Open the file and "read" the balances inptr = fopen("balancesInput.txt", " ); fscanf(inptr, "slf", scheckingBalance); fscanf(1nPtr, "slf", Gsavingsialance); //the rest of the main function code and while loop //save the new balances to the file at the end, right before return a printf("lnsaving to the fileln"); fprintf(outptr, "sfln", checkingBalance); fprintf(outptr, =sfln", savingsialance); return ; \} Please use an app with only deposit Or quit MENU OPTIONS 1. Initialize the balance in the checking and savings account with the template code provided 2. The program will welcome the user with a friendly message and instructions. 3. Display the balance in both accounts at the start of execution 4. Display the itcm options: (d) to Deposit (q) to quit 5. The user will make the selection (d) or 6. Remember that lowerease and uppercase letters are not the same 7. If the user selects 'd' or ' D' they with then have the option to select (1) for checking or (2) for savings 8. The purpose of this assignment is to practice, loops, conditions, functions, and files 9. More features to the bank app will be added in program 6 The user may continue to make deposits until entering ('Q') to QUIT When the user selects or the new balances will be saved to the file See the template code provided with the assignment. Additional information: - One source code file (unformatted text) will be submitted - The file name must match the assignment (fastname_programs.c) - The code should be tested and run on an IDE before it is uploaded onto Canvas - The code must be submitted on time in order to receive credit, do not wait until the last minute - Late submissions, or email submissions will not be accepted for grading - All programming assignments are individual work, sharing code is considered cheating Here are some tips and tricks that will help you with this assignment and make the experience more enjoyable. - Do not try to write out all the code at once. - For cach new line of code written (2-3 lincs), build it to if it compiles successfully. - After any suceessful build, run the exccutable to sce what happens so you know what to do next! If the program performs as expected, you can then move onto the next step If you try to write everything at once and build it successfully to find out it does not work properiy, you will get frustrated trying to find out the logical crror in your code! - Logical errors are the hardest to fix and identify in a program? - Start the assignment carly! Do not wait last minute (the day of) to begin the assignment. - Do not make any assumptions, if you have any questions, please ask. Sample output: Welcome to the bank deposit program The balance in your checking account is The balance in your savings account is Enter 'd' to make a deposit or ' ' to Quit:d Enter 1 for checking and 2 for savings:1 The balance in your checking account is How much do you want to add?2e0.00 The balance in your checking account is Enter ' ' to make a deposit or ' ' to Quit:d Enter 1 for checking and 2 for savings: 1 The balance in your checking account is How much do you want to add?1e The balance in your checking account is Enter ' ' to make a deposit or ' ' to Quit:d Enter 1 for checking and 2 for savings: 2 The balance in your savings account is How much do you want to add? The balance in your savings account is Enter ' ' to make a deposit or ' ' to Quit: Saving to the file Have a nice day! - laatname program5.c Add name, date, and brief description here \#define CRT_SECURE_NO_WARNINGS //for Visus1 Studio compiler fpragna warning(disable::6031) //1gnore acanf warningg \#includeritdio.h> // for printf and scane //greets the user void Greeting (): //Input: one double and one character l/diaplays the belance of the account ('C', checking of 'S', savinga) void DiaplayBalance (double accountBalance, char account) : flInput: one double and one character fldeclare, ask, and get the amount from the user and add it to the accoune return the updated balance (' ', checking or ' ', mavings) double Depositkoney (double accouneBalance, chaz accounc); Int i double checkingBalunce ; double savingsBalance l/declare variables for the loop and sor the aceount FILE* inperi FILE+OuEPEX; llereating the file and "write" the initial balances outPtr = fopen ("balancesInput. ext", "M"); fprinet (ouvper, "4Ala", eheckingBaiance); f/greet the user Hopen the file and "zead" the balances InPtr = fopen ("balancesinpus. cxt", " ); facanf(InPtr, "41f", taavangsbalance); llthe rest of the main funciton code I/display the balances I/get the selection 'd' or 'q' (initialization for the while loop) // while (relection I= 'Q' it selection ' )// haitle teat (selection ' ' 11 selection ' ') /et the account /if (account = ) fleposit to checking Ifeposit to gavings pinti ("Nnnot recognized"); /jget the selection 'd' or 'd' jJpDezi for the while 1001 //save the new balances to the file at the end, zight before zeturn printf(")nSaving to the file tn"); Ipxinte (outPtx, "\&f , , checkingBalance); fprintf(outPtr, "zfln", savingsBalance); //cloge the file pointers fclose (inPtr); fclose (outPtr); return 0 ; \} Ifunction defintions


We have an Answer from Expert

View Expert Answer

Expert Answer


The answer provided below has been developed in a clear step by step manner.here the solution#include #include // Programmer-defined functionsvoid Gre
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe