Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int CHOICE;
- float r = 0.0, n = 3.0, p = 100000.0, AMOUNT = 0.0;
- printf("USER PANEL\n");
- printf("------------------------------------------------\n");
- printf("| Press any number to Bank with the bank below |\n");
- printf("| 1. BK |\n");
- printf("| 2. EQUITY |\n");
- printf("| 3. ECOBANK |\n");
- printf("| 4. I & M Bank |\n");
- printf("| 5. Quit the program |\n");
- printf("------------------------------------------------\n");
- printf("Please choose from the above options: ");
- scanf("%d", &CHOICE);
- switch(CHOICE) {
- case 1: // BK
- r = 10.0 / 100.0;
- break;
- case 2: // EQUITY
- r = 12.0 / 100.0;
- break;
- case 3: // ECOBANK
- r = 15.0 / 100.0;
- break;
- case 4: // I & M
- r = 9.0 / 100.0;
- break;
- case 5:
- // quit the program
- break;
- default:
- printf("Try again\n");
- break;
- }
- AMOUNT = p * (((pow((1 + r), n)) - 1) / r);
- printf("Amount: %.2f\n", AMOUNT);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment