1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
iren2701 [21]
3 years ago
8

2) [13 points] You’ve been hired by Banker Bisons to write a C++ console application that determines the number of months to rep

ay a car loan. Write value function getLoanAmount that has no parameters, uses a validation loop to prompt for and get from the user a car loan amount in the range $2,500-7,500, and returns the loan amount to function main. Write value function getMonth Payment that has no parameters, uses a validation loop to prompt for and get from the user the monthly payment in the range $50-750, and returns the monthly payment to function main. Write value function getInterestRate that has no parameters, uses a validation loop to prompt for and get from the user the annual interest rate in the range 1-6%, and returns the interest rate to function main. Here are the first lines of the three functions:

Computers and Technology
1 answer:
Paha777 [63]3 years ago
5 0

Answer:

Check the explanation

Explanation:

CODE:

#include <iostream>

#include <iomanip>

using namespace std;

double getLoanAmount() { // functions as per asked in question

double loan;

while(true){ // while loop is used to re prompt

cout << "Enter the car loan amount ($2,500-7,500): ";

cin >> loan;

if (loan>=2500 && loan <= 7500){ // if the condition is fulfilled then

break; // break statement is use to come out of while loop

}

else{ // else error message is printed

cout << "Error: $"<< loan << " is an invalid loan amount." << endl;

}

}

return loan;

}

double getMonthlyPayment(){ // functions as per asked in question

double monthpay;

while(true){ // while loop is used to re prompt

cout << "Enter the monthly payment ($50-750): ";

cin >> monthpay;

if (monthpay>=50 && monthpay <= 750){ // if the condition is fulfilled then

break; // break statement is use to come out of while loop

}

else{ // else error message is printed

cout << "Error: $"<< monthpay << " is an invalid monthly payment." << endl;

}

}

return monthpay;

}

double getInterestRate(){ // functions as per asked in question

double rate;

while(true){ // while loop is used to re prompt

cout << "Enter the annual interest rate (1-6%): ";

cin >> rate;

if (rate>=1 && rate <= 6){ // if the condition is fulfilled then

break; // break statement is use to come out of while loop

}

else{ // else error message is printed

cout << "Error: "<< rate << "% is an invalid annual interest rate." << endl;

}

}

return rate;

}

int main() {

cout << setprecision(2) << fixed; // to print with 2 decimal places

int month = 0; // initializing month

// calling functions and storing the returned value

double balance= getLoanAmount();

double payment= getMonthlyPayment();

double rate= getInterestRate();

rate = rate /12 /100; // as per question

// printing as per required in question

cout << "Month Balance($) Payment($) Interest($) Principal($)"<< endl;

while(balance>0){ // while the balance is more than zero

month = month + 1; // counting Months

// calculations as per questions

double interest = balance * rate;

double principal = payment - interest;

balance = balance - principal;

// printing required info with proper spacing

cout <<" "<< month;

cout <<" "<< balance;

cout <<" "<< payment;

cout <<" "<< interest;

cout <<" "<< principal << endl;

}

cout << "Months to repay loan: " << month << endl; // displaying month

cout << "End of Banker Bisons";

Kindly check the output in the attached image below.

You might be interested in
What would happen if the bitmap or free list containing the information about free disk blocks was completely lost due to a cras
masha68 [24]

Answer:

It can be repaired with disk utility / recovery algorithms

In UNIX it can be done by scanning

In FAT file scan the FAT looking for free entries

Explanation:

When the crash happens, it is not a problem for UNIX and FAT file system

It can be repaired with disk utility/recovery algorithms.

The recovery algorithm is a list of all blocks in all files and takes a compliment as new free file.

In UNIX scanning can be done at all I-nodes.

In FAT file problem cannot occur because there is no free list .If there was any problem than it would have to be done to recover it to scan the FAT looking for free entries.

7 0
3 years ago
Reply emailing a student who is asking about audio materials​
Sergeeva-Olga [200]

Answer:

The student because you are replying to the student.

Explanation:

4 0
3 years ago
Read 2 more answers
A lot of software loads when you boot up any computing device, such as small programs called _______________, that provide suppo
lina2011 [118]

Answer:

Services is the correct answer of the following question.

Explanation:

Loads a lot of applications when booting any computer device, including tiny programs called Services. This provides access for the various operating system functions. A service relates to research carried out by any or several individuals who support us.

  • A machine is technology that executes repetitive tasks, answers to physical activities or responds to many other software information requests.
  • The philosophy of the service explains how a supplier will understand the benefit and expected results of its products.

Other options are incorrect because they are not related to the given scenario.

8 0
3 years ago
A feature of the IEEE 802.11n/ac standards for wireless networking whereby two or more antennas are used at both ends of transmi
Vitek1552 [10]

Answer:

Yes it is.

Explanation:

The IEEE 802.11n/ac standards for wireless networking use two antennas to improve the data rates, with these both antennas the transmission is better and the performance, MIMO is a technology that uses multiple antennas to coherently resolve more information than possible using a single antenna, this is the main feature for this technology.

5 0
3 years ago
To show the growth comparisons of your company from one year to the next, a _____ can be included in your PowerPoint presentatio
777dan777 [17]

a column chart can show both years side by side

8 0
3 years ago
Read 2 more answers
Other questions:
  • When data are normalized, attributes in the table depend only on the secondary key?
    5·1 answer
  • He has a new Wi-Fi router that connects wirelessly to a new desktop and two new laptops, in addition to multiple smartphones, ta
    8·1 answer
  • Mike wants to build an amplifier. which technology can he use?
    6·1 answer
  • Wat kind o mouse pleese hep meh​
    11·1 answer
  • What is one of the first power tools you’ll need as electrician
    15·1 answer
  • B) Use an Excel function to find: Note: No need to use Excel TABLES to answer these questions! 6. The average viewer rating of a
    10·1 answer
  • How to draw use case diagram
    13·1 answer
  • _____________programs and features are often integrated into video editing software.
    13·1 answer
  • An interactive online representation of geospatial data, which can be accesses via a Web browser is a(an): a. Web Application b.
    11·1 answer
  • State two differences between a mouse pointer and a mouse cursor​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!