# INTRODUCTION The goal of this programming project is to entble studen.pdf

1. Apr 2023
1 von 7

### INTRODUCTION The goal of this programming project is to entble studen.pdf

• 1. INTRODUCTION The goal of this programming project is to entble students practice solving a problem that uses the Python features of functions and lists. PROBLEM Write a program that inputs names of personal expenses and a corresponding amount for each expense. The program should store all input data in lists. The program should present the user with a main menu to select options to: 1. Input personal expense names 2. Input personal expense amounts 3. Display the expenses (names and amounts) 4. Exit the program The program should then allow the user to select how the information will be displayed from the list of: (a) pie chart (b) bar chart (c) table. The program should achieve this in functions described below. To ensure good programming and modularity, none of the functions should call itself and the only function calls should be in the main function. Functions should not be defined inside other functions. At the bottom, there should be a statement that calls the main function. No function call to main should happen inside the main function. Here are the descriptions of what should be in the functions: 1. main This function will have statements to call the other functions and display the main menu. The first function called will input names of the expenses into a list and assign the list to a list object. The second call will pass the expense items list to a function that inputs expense amounts into a second list that is then assigned to a list object. The third call passes the two lists to a function that will display the contents on the two lists. Here are the Python statements: expenseItems = InputExpenseNames () expenseAmounts = InputExpenseAmounts (expenseItems) DisplayExpenseReport (expenseItems, expenseAmounts) 2. InputExpenseNames First create an empty list for expense items. Next, enter a loop that iterates for as long as the user responds that there are more item names to enter. In the loop, display a message asking the user to input the name of an expense item, then input the name and append it to the list. Then input a response to the question whether there are more item names. 3. InputExpenseAmounts Create an empty list for expense amounts. Enter a loop that uses the size (you may use the len function) of the expense items list to determine number of iterations. For each iteration, display a message that says: How much was spent on xocxxoxxocx expense item? where x x xxxxxxx is replaced by the name from the expense_items_list corresponding to the current iteration. The amount should then be input and appended to the expense amounts list. Input validation should be done including using try ... except ... to ensure a number was entered. After the loop ends, return the expense amounts list. 4. DisplayExpenseReport Parameters to this function will be the expense items and expense amounts lists. Your program should offer the user the menu of (a) table display (b) pie chart (c) bar chart. When the user selects option (a), the program should output column headings and then enters a loop that iterates as many times as the size of the expense items list and outputs the contents of the lists. The program should output some type of delineation that expenses are done and output the total of the amounts in the