Description
Grading: This homework will be graded on the scale of 100.
Homework Description: In this homework, you will implement a banking system. This homework will be implemented by using Structs, Unions, Recursive functions and File operations in C. You need 2 unions and 1 struct type. These are;
union Person
{ char name[50]; char address[50]; int phone;
};
union Loan
{ float amount; float interestRate; int period;
};
struct BankAccount
{
union Person Customer; union Loan Loans[3];
};
Function prototypes are : listCustomers() addCustomer () newLoan ()
calculateLoan(float amount, int period, float interestRate);
getReport();
You have to use a recursive function when calculating the loan. You are not allowed to use the pow() function. The formula for calculating the loan is below.
π³πππ πππππππ = π¨πππππ β ( π + πππππππππΉπππ)ππππππ
In the report section, you have to print out 2 reports. These are the Customer list and Loan detail. You must keep all customers in the customers.txt file. When requesting this report, you must read customers.txt file and print the customers to the screen. When printing a loan detail of a customer, you need to print the total value of that loan and each period one by one as in the example. Not all states are shown in the expected outputs, but you have to check all states and incorrect entries for each step. You can specify the function types according to your needs. Unless the program exit option is selected, it has to return to the menu after each operation. Remember, the list in option 1 has to print the customers in the struct to the screen. The report menu in the 4th option has to print the customers and loans it reads from the file on the screen.
Expected Outputs
General Rules:
1. Obey the style guidelines.
2. Do not change the provided function prototypes (you will not get any credits).
4. Your program should work as expected. Do not expect partial credit if your code works only in some cases but not in all cases as expected.
5. Hand in your work using the appropriate class Teams assignment site.
7. Pack this directory into a zip file named 20180000001_X_Z.zip
8. When unpacked as above in Ubuntu (version provided in class) it should allow executing the following commands in a shell:
βͺ β$make cleanβ removes everything except makefile, source code (.c) and other resource files (if any) β all compiling results and intermediate files should be removed (except results.txt).
βͺ β$make compileβ should compile the code.
βͺ β$make runβ should run the code along with any parameters needed.




Reviews
There are no reviews yet.