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]
2 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]2 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
How long is the bachelor's program at Eth Zurich? 3 or 4 years?
natulia [17]
The bachelor's program at Eth Zurich is 3 years.
I hope this helps!
:-)
4 0
2 years ago
PLEASE HELP there are TWO ANSWERS
pickupchik [31]

Answer:

Pero un campo cuyo tipo de datos es Número solo puede almacenar datos numéricos. ... Por ejemplo, los valores que se almacenan en un campo Texto solo pueden contener ... Para más información, haga clic en los tipos de datos siguientes. ... Controla la conversión de frases en las versiones asiáticas de Windows.

5 0
3 years ago
The most likely reason a firm would decide to establish an extranet would be the desire to Multiple Choice speed the flow of inf
brilliants [131]

Answer: share information and collaborate with a select group of outside organizations or individuals.

Explanation:

When a company uses an intranet, it is for the purpose of sharing information within the company so in the same vein, an extranet is done to share information with entities outside the company be it people or organizations.

For information to be shared, the other companies and organizations need to have the means and authorization to join the extranet. Extranets are very useful as they enable collaboration across vast distances thereby increasing productivity.

6 0
3 years ago
Everything is made of tiny Antoms each of these Antoms is made up of a core that has a positive charge and some electrons that c
arlik [135]

Answer:

Magnetism

Explanation:

Magnetism or magnetic energy is a natural phenomenon, we can find magnetism in some materials like nickel, cobalt, and iron, or their alloys are magnets, this was produced the first time in Greece at the city Magnesia del Meandro, for this city is the name magnetism, there were stones that attracted and this was called natural magnetism.

4 0
2 years ago
You are opening a store, and having a working website is an important part of your project plan. The company that started creati
Murljashka [212]
A should be the answer... not having the website will cause you to have to everything by call and things like that ... plz brainliest.
6 0
3 years ago
Other questions:
  • Jordan has been asked to help his company find a way to allow all the workers to log on to computers securely but without using
    6·1 answer
  • Anna is looking for a job. Which two types of skills would she find necessary to secure a job ?
    5·1 answer
  • Name three types of hard drives, along with its speed and size.
    8·1 answer
  • What are the classifications of computer
    9·1 answer
  • Array testGrades contains NUM_VALS test scores. Write a for loop that sets sumExtra to the total extra credit received. Full cre
    11·1 answer
  • If I want to add a new slide to my presentation, which option would I click on?
    5·1 answer
  • How many types of window in Qbasic​
    7·1 answer
  • Really helpful, I want to get together tomorrow ,Later I will follow and make it the best answer
    7·1 answer
  • How do you do 1.17.5, invert colors, on codehs?
    10·1 answer
  • What's your fav show?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!