Question
The simple interest on a loan is calculated by the formula interest = principal * rate * term / 365; The preceding formula assumes that
The simple interest on a loan is calculated by the formula
interest = principal * rate * term / 365;
The preceding formula assumes that rate is the annual interest rate, and therefore includes the division by 365 (days).
Develop a program that will input principal, rate and days for several loans, and will calculate and display the simple interest for each loan, using the preceding formula.
Use the below program template to answer each question. The program is created by answering all the questions hence, do not skip any question.
Programming Shell Template
Instructions
Using the Xendesktop, open Visual Studio 2015. Create a new project and add a new .cpp file to the project. Type the programming shell template as stated up above and continue with the following steps below. Be sure to include comments throughout your program for readability purposes.
(Housekeeping): Declare the following variables in your program using appropriate data type. When selecting a data type keep in mind the type of value you want to store, i.e., int, float, character. Also, be sure to use conventional naming standards for all variable declarations.
principal
rate
term
interest
(Output): Add a prompt to guide the user to input loan principal as a dollar amount. Take notice of the value restriction at the end of this output statement.
(Input):Add a scanf() statement to store user input for loan principal value.
(Control Structure): Add a looping statement that will keep on calculating interest charges until the user enters the value -1 as the principal value to end the process.
(Output): Add a prompt to guide the user to input interest rate as a decimal value.
(Input): Add a scanf() statement to store user input for rate value.
(Output): Add a prompt to guide the user to input length of the loan in days (term).
(Input): Add a scanf() statement to store user input for the number of days (term).
(Assignment Statement): Use the following equation for interest charge calculation.
interest = principal * rate * term / 365;
End looping structure and then create a prompt and input statement to ask the user for the next loan principal value.
Be sure to include comments throughout your program for readability purposes.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started