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
AVprozaik [17]
3 years ago
9

Write a program that outputs inflation rates for two successive years and whether the inflation is increasing or decreasing. Ask

the user to input the current price of an item and its price one year and two years ago. To calculate the inflation rate for a year, subtract the price of the item for that year from the price of the item one year ago and then divide the result by the price a year ago. Your program must contain at least the following functions: a function to get the input, a function to calculate the results, and a function to output the results. Use appropriate parameters to pass the information in and out of the function. Do not use any global variables.
Computers and Technology
1 answer:
MrRissso [65]3 years ago
8 0

Answer:

#include

using namespace std;

void getInput(double currentPrice, double priceYear1, double priceYear2){

   cin >> currentPrice;

   cin >> priceYear1;

   cin >> priceYear2;

}

void printInflationRate( double myRate){

   cout<< "The inflation rate for the year price = "<< rate;

}

void calInflation(double targetPrice, double yearBefore){

   double rate = (yearBefore - targetPrice)/ yearBefore;

   printInflationRate( rate);

}

int main(){

   double cprice, year1price, year2price, rate;

   getInput(cprice, year1price, year2price);

   calInflationRate(cprice, year1price);

   calInflationRate(year1price, year2price);

   return 0;

}

Explanation:

The C++ program source code defines three void functions (functions with no return statement), 'calInflationRate', 'getInput', and printInflationRate. In the main program code, the four float point number variables are declared, and the getInput function assigns values to them. The calInflationRate function calculates the inflation rate of a given year, and it in, the printInflationRate is called to print the output on the screen.

You might be interested in
Trish uas bought a new computer, which she plans to start working on aftwr a week. Since Trish has not used computers in the pas
stepladder [879]

The answer would be B. She should minimize the use of the computer. Hope this helps! :)


<h3>CloutAnswers</h3>
6 0
3 years ago
Which term best describe the operating system of a computer?
blsea [12.9K]

Answer:

Explanation:

System Software

6 0
3 years ago
You are a network administrator for a company that has two buildings. You are setting up a wireless network so users can maintai
lukranit [14]

Answer:

123

Explanation:

123

7 0
3 years ago
Use the drop-down menus to complete the statements about printing Contacts. When printing a single contact, go to File and then
UkoKoshka [18]

Answer:

When printing a single contact, go to File and then Print; the only style available is Memo style .

When printing multiple contacts, there are several styles to choose from

Explanation:

<em>The question has been answered (by you). I will help you with the explanation. The texts in bold in the answer section represent the answer.</em>

<em />

The question is an illustration of Microsoft outlook.

In Microsoft outlook, the default style of printing is the memo style of printing. This is the only form of printing allowed when printing single contacts. In other words, other forms of printing cannot be selected.

However, there are several options available when multiple contacts are to be printied. Some of the printing styles are:  phone directory style, card style, medium booklet style, etc.

8 0
3 years ago
When do you use an else statement for coding
tankabanditka [31]

Answer:

to check to see if some expression is true, and if it is do something, otherwise do something else. An if/else statement requires you to define an expression that evaluates to true or false.

Explanation:

4 0
3 years ago
Other questions:
  • The efficiency for recursively traversing a chain of linked nodes is
    15·1 answer
  • A claim that is printed and mailed to the carrier site is called a _______copy?
    13·1 answer
  • Letm1, m2,···mnbe distinct numbers on the number line, in the increasing order. Your goalis to color all of them blue. You have
    9·1 answer
  • Mark lives in an area that is prone to tornadoes. If a tornado is headed his way, what is one thing Mark should do? A. Get in hi
    8·1 answer
  • Assuming x and y are variables of type float, the expression:
    6·1 answer
  • If you need to provide a storage server with fault tolerance through the use of multiple paths between the server and the actual
    14·1 answer
  • Give your definition of a stored procedure. Based on the Academic Database, identify and describe a scenario where it would be n
    12·1 answer
  • Explain the following as used in Tally Accounting Software:
    8·1 answer
  • For a single CPU core system equipped wiith addditional hardware modes (besides user and kernel), choose those items that are ex
    7·1 answer
  • Host A sends a packet of length 1,100 bytes to host B over a link with transmission rate 4 Mbps over a distance 1300 km, propaga
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!