EE
ee312bank

# ee312bank - #include #define INTEREST 0.2 main int...

• Notes
• 2

This preview shows pages 1–2. Sign up to view the full content.

#include <stdio.h> #define INTEREST 0.2 main () { int select, counter, end; float loan, term, emi, ppayment, sub; printf( "Good morning! Welcome to the EE312 Bank." ); start: printf( "\nPlease select from the following choices:\n" ); printf( "Press 1 to calculate the EMI for a new loan.\n" ); printf( "Press 2 to calculate payment amounts for prepaying a loan.\n" ); printf( "Press 3 to exit.\n" ); scanf( "%d" , &select); switch (select) { case 1: printf( "Enter the loan's principal (\$ sign not required):" ); scanf( "%f" , &loan); printf( "Enter the loan's term (in months) :" ); scanf( "%f" , &term); if (loan >= 0){ if (term >= 0){ /*price and term of loan must be > 0*/ loan = loan + (loan * INTEREST); /*equation of loan plus the interest*/ emi = loan/term; /*equation of the monthly payments*/ printf( "Thank you. Your esimated monthly payment (EMI) for each month is: \$%.2f\n" , emi); goto start; /*jumps to start of program*/ } else printf( "Illegal Value." ); break ; } else printf( "Illegal Value." ); break ; case 2: printf( "Enter the loan's remaining principal (\$ sign not required):" ); scanf( "%f" , &loan); printf( "Enter the number of months remaining on the loan's term:" ); scanf( "%f" , &term); printf(

This preview has intentionally blurred sections. Sign up to view the full version.

This is the end of the preview. Sign up to access the rest of the document.
• Spring '08
• Shafer
• Default, printf, EMI

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern