Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago