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
To keep information beyond reach of unauthorized users, is to keep the information _____. Group of answer choices simple verifia
nasty-shy [4]

Answer:

Secure is the correct answer for the above question.

Explanation:

  • When any person wants that any information is not hacked by any user then he needs to secure the information with the help of any security mechanism. This security mechanism can be of any type that facilities the user to stop the information are being hacked.
  • The above question asked about the work which is needed to stop the message is being hacked. So there is a need to secure the information. so secure is the correct option while the other option is not valid because "simple, economical or verifiable" can not stop the message from accessed by the unauthorized user.
7 0
3 years ago
What does choosing Slide Sorter view do?
elixir [45]

Answer:

The last two line i.e "displays miniature versions of all the  presentation's slides​  " is the correct answer to the given question .

Explanation:

The main objective of the slide sorter is showing the miniature versions of all the slides though user can quickly push the slides and organize the slides in well mannered by moving the slides . The Slide Sorter display gave the viewers to thumbnail the overview of the slides.

  • The slide sorter making the presentation effective by organizing and sorting the slide .
  • All the other option are not correct for the  Slide Sorter view that's why these are incorrect option .
3 0
3 years ago
GenXTech is a growing company that develops gaming applications for military simulations and commercial clients. As part of its
ki77a [65]

Answer:

an enterprise architecture

Explanation:

Based on the information provided within the question it can be said that in this scenario it seems that GenXTech is creating an enterprise architecture. This is a blueprint made for a company that illustrates and defines all the finer details regarding the structure and operation of an organization, as well as where the organization should be heading in order to achieve the business goals that have already been set.

6 0
2 years ago
The format for the UPDATE command is the word UPDATE, followed by the name of the table to be updated. The next portion of the c
fenix001 [56]

The format for the UPDATE command is the word UPDATE, followed by the name of the table to be updated. The next portion of the command consists of the word <u>SET</u>, followed by the name of the column to be updated, an equals sign, and the new value.​

Explanation:

  • An Update Query is an action query (SQL statement) that changes a set of records according to criteria you specify.
  • The SQL UPDATE Query is used to modify the existing records in a table. You can use the WHERE clause with the UPDATE query to update the selected rows, otherwise all the rows would be affected.
  • Update Queries let you modify the values of a field or fields in a table.

<u>UPDATE Syntax </u>

  • UPDATE table_name
  • SET column1 = value1, column2 = value2, ...
  • WHERE condition;

UPDATE table_name SET column1 = value1, column2 = value2, etc WHERE condition;  

  1. table_name: name of the table
  2. column1: name of first , second, third column....
  3. value1: new value for first, second, third column....
  4. condition: condition to select the rows for which the  
  5. values of columns needs to be updated.

8 0
3 years ago
What have been three technological changes to photography in the past 200 years?
kolbaska11 [484]
I hope this helps but cars, phones and computers.
3 0
3 years ago
Other questions:
  • Describe some advantages of a 64-bit versus 32-bit version of windows.
    9·1 answer
  • James, a technician, needs to format a new drive on a workstation. He will need to configure read attributes to specific local f
    5·1 answer
  • Complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 3, print "To
    9·1 answer
  • _____ consists of the instructions that direct the operation of the computer system and enable users to perform specific tasks,
    15·1 answer
  • Select the correct answer.
    12·2 answers
  • Please hurry Arrange the steps of the engineering design process in the correct sequence.
    10·1 answer
  • Scenario
    7·1 answer
  • Type the correct answer in each box. Spell all words correctly.
    14·2 answers
  • When power is completely removed from your computer
    11·1 answer
  • How do I make my header line visible?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!