Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

- INTRODUCTION

In this assignment, you will get practice with:

Basic Python programming constructs

Expressions, decisions, loops

Getting input from users

Algorithm development and testing; designing test cases

Following program specifications

Inflation is the rate of increase in prices over a time period. The personal inflation rate refers to the rate at which    inflation increased for a household. The calculation of the personal inflation rate requires as input the expenses for each expenditure category (e.g., food, tuition, rent, transportation, entertainment) for a specific month of the         current year and for the same month in the previous year. Individuals may have different expenditure categories.   For example, not everyone pays tuition.

The expenses for each category should be summed up for both years. The sum of all expenses of the previous year is subtracted from the current year. The result is then divided by the monthly expenses of the current year.

For example, let us assume that you have these categories of expenses: food, rent and transportation. The following table represents expenses for food, rent and transportation for August 2022 and August 2021.

The inflation rate is

(1800-1200)/1800 = 600/1800 = 0.33 which represents an inflation rate of 33%.

1 FILES

For this assignment, you must create one Python file: Assign1.py

When submitting your assignment on Gradescope, please submit Assign1.py only. Do not upload any other files. Assign1.py

In this assignment, you will write a complete program in Python that computes the personal inflation rate and        determines if the calculated information rate is low, moderate, high or hyper. A low inflation rate is below 3%, a     moderate is 3% or higher but less than 5%, high inflation is more than 5% but less than 10% and any inflation rate at 10% or higher is hyper.

Your program is expected to prompt the user for input and compute results. Your program will make use of   expressions, decisions and input/output in Python. You should name your program Assign1.py. Your program should strictly adhere to the Functional Specifications (below) and Non-Functional Specifications.

Functional Specifications

Your program will compute the person's inflation rate as described above. The program should prompt the user    for the number of expense categories. This number is used to determine the number of times that the user is        asked for category and expense. It will then print the inflation rate and if the inflation rate is low, moderate, or high.

The program should prompt for these values in the order described. An example of the programs input is:

The output consists of a two lines. The first line is the inflation rate and the second is the level. The first line MUST be identified with phrase Personal inflation rate:” followed by the inflation rate rounded to the first decimal point.  The second line must be identified with the phrase Type of Inflation” followed by the type of inflation. An example output is below:

Personal inflation rate for 2022 is 25.0%

Type of Inflation: Hyper

Finally, an automated testing program will run a number of test cases against your program. Some examples of output and test cases are presented below; these are NOT comprehensive - you should create your own test   cases and thoroughly test your program.

Example Executions and Output

# Example 1

 


Remember!

Make sure you develop your code with Python 3.9 as the interpreter. Failure to do so may result in the testing program failing.

You can find Python 3.9.0 Here.