ee312bank - printf("Thank you. Here are your...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #include <stdio.h> int main( void ) { int toggle2=0 while(toggle2==0) { float toggle=0 float loanPrin=0 float percent=0 float emi=0 float payamt=0 float loanPrin1=0 float month=0 int month2=1 float decPercentage=0 printf( "Good morning! Welcome to the EE312 Bank.\nPlease select from the following choices: \nPress 1 to calculate the EM I if(toggle==1) { printf("Enter the loan's principal: ") printf("Enter the loan's term (in months): ") emi=(loanPrin*1.2)/month printf("Thank you. Your Estimated monthly payment (EMI) for each month is: $%.2f\n\n",emi) getchar ( ) } else { if(toggle==2) { printf("Enter the loan's principal: ") loanPrin=loanPrin*1.2 printf("Enter the number of months remaining on the loan's term: ") printf("Enter the intended percentage of prepayment: ") decPercentage=1+(percent/100)
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: printf("Thank you. Here are your calculated payment amounts and the balance at the end of each month:") printf("\nMonth\t\tPayment Amount\t\tRemaining Balance\n") while(month>1) { payamt=(loanPrin*decPercentage)/month loanPrin=loanPrin-payamt printf("%5d%25.2f%27.2f\n",month2, payamt,loanPrin) month--month2++ } payamt=loanPrin loanPrin=0 Sheet1 Page 2 printf("%5d%25.2f%27.2f\n\n",month2, payamt,loanPrin) getchar( ) } else { if(toggle==3) toggle2=1 else printf("Illegal input please try again.\n\n") } } } getchar( ) return 0 } Sheet1 Page 3 /*1,2, or 3 determines which of the subroutines is started*/ /*used in the first program for the loan's principal*/ /*used for the intended percetange of prepayment*/ /*stimated monthly payment*/ /*payment amount for payment schedule*/ /*loan principal copy*/ /*the percentage read in divided by 100*/ Sheet1 Page 4...
View Full Document

This note was uploaded on 05/30/2008 for the course EE 312 taught by Professor Shafer during the Spring '08 term at University of Texas at Austin.

Page1 / 4

ee312bank - printf("Thank you. Here are your...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online