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
What happens when the computer is thrashing? quizzlet?
lutik1710 [3]
When computers need to use more memory than have RAM, they'll swap out pages of memory to their drive. When they need those memory pages, they'll swap out others and swap in the needed ones. If a computer needs enough additionall memory, it can get so busy swapping that it doesn't have any (or very little) time to do any useful work. That is called thrashing.

Unix calls swapping swapping. Windows calls it paging, probably because of the memory pages. Memory pages are 4096 (4KB) sections of memory.

Unix drives are usually partitioned with a swap partition, and swap files can be made in the filesystem. Windows just has pagefiles[s].
5 0
3 years ago
What does the coding phase involve?
Harman [31]

Answer:

I do believe it is D im not sure

5 0
2 years ago
Read 2 more answers
The term _____ best describes the level of technology skills needed in today’s business world.A: computer knowledgeB: computer f
Alja [10]

Answer:

The answer is "Option B"

Explanation:

The ability to learn and use basic computer hardware and software understanding to solve problems and to access information is known as computer fluency. and other options are not correct, that can be defined as follows:

  • In option A, computer knowledge is a basic general awareness, that helps the user to use the computer more fluently, that's why it is not correct.
  • In option C, It is an internal feature of the computer, that helps to transfer data, that's why it is not correct.
  • In option D, computer information is also known as data that is stored in the computer, that's why it is not correct.
6 0
3 years ago
What happens if part of an ftp message is not delivered to the destination?
Oliga [24]

The message is lost when an FTP message is not delivered to its destination because FTP doesn't use a reliable delivery method.

<h3>What is FTP?</h3>

FTP is an abbreviation for file transfer protocol and it can be defined as a type of server that's designed and developed to store and provide files for download, as well as sharing between two or more users on an active computer network.

Generally, the message is lost when an FTP message is not delivered to its destination because FTP doesn't use a reliable delivery method.

Read more on FTP here: brainly.com/question/20602197

#SPJ12

4 0
2 years ago
Do the pros of interpersonal communication via social media outweigh the cons? Explain.
JulijaS [17]
Well in my opinion is that yes they do. The ability to be able to communicate with others so far way really helps society advance towards the future. And i cant stress of how the benefits of being able to share ideas with well anyone is so wonderful.

I hope this helps.
6 0
3 years ago
Read 2 more answers
Other questions:
  • A computer-aided system for the collection, storage, retrieval, analysis, and presentation of spatial data of all kinds is calle
    7·1 answer
  • ORANGE COLORED SIGNS AND FLAGS MEAN THAT YOU MUST BE ALERT FOR:
    8·2 answers
  • A company gives you a document to review. This document lays out the strengths and weaknesses of a proposed business venture. It
    13·1 answer
  • What does the clone tile command do?
    15·2 answers
  • Science Help
    11·1 answer
  • What are the characteristics of the sorting and grouping options in Outlook? Check all that apply. Columns can be sorted by clic
    15·2 answers
  • Pls help quick... will mark brainliest...
    15·1 answer
  • Which of the following is an example of group dynamics?
    8·1 answer
  • SINCE I CANT SEE IT KANG LOOK
    6·2 answers
  • If you walked into a room containing three computers and were told one of them was infected with malware, how would you determin
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!