Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Python script that reads in names and corresponding bank balances (integers, without a $ or commas) and makes a dictionary of the associations.

Write a Python script that reads in names and corresponding bank balances (integers, without a $ or commas) and makes a dictionary of the associations. You can prompt the user first for how many name-income pairs (s)he wants to enter. Use int(input()) for input. After constructing the initial balances, repeatedly do the following: Prompt for a transaction, using a code number, for each bank customer: a deposit (code 1), a withdrawal (code 2), or no transaction (code 0). Update the dictionary of bank balances and output the updated customer-balance associations. Make a dictionary of the transactions where the keys are the same as for the balance dictionary (names of customers); positive values represent deposits, negative values represent withdrawals, and a zero represents no transaction. Maintain a list of the transaction dictionaries (one for each iteration). When the loop exits, output the current balances and the list of transactions in a well-formatted table. This could be implemented with recursion as well as with a loop.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions

Question

an element of formality in the workplace between different levels;

Answered: 1 week ago