{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ee312bank

# ee312bank - printf"Thank you Here are your calculated...

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

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 scanf("%f", &toggle) if(toggle==1) { printf("Enter the loan's principal: ") scanf("%f",&loanPrin) printf("Enter the loan's term (in months): ") scanf("%f",&month) 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: ") scanf("%f",&loanPrin) loanPrin=loanPrin*1.2 printf("Enter the number of months remaining on the loan's term: ") scanf("%f",&month) printf("Enter the intended percentage of prepayment: ") scanf("%f",&percent) decPercentage=1+(percent/100)

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

View Full Document

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

View Full Document
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

{[ snackBarMessage ]}