Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone do this Python program? You have been tasked with writing a Python program that will compute (and display to the screen) the trade
Can someone do this Python program?
You have been tasked with writing a Python program that will compute (and display to the screen) the trade fees for each customer at a stock trading company.
A stock trading company charges $25 per month plus the following trade fees for a stock account:
- $5.00 each for fewer than 20 trades
- $3.00 each for 20-39 trades
- $2.00 each for 40-59 trades
- $1.00 each for 60 or more trades
The company also charges an extra $50 if the balance of the account falls below $250 (before any trade fees are applied). Write a Python program that contains at least three (3) functions - main, getInfo, and compute - that complete the following tasks:
- a function named main that kicks off the program with a description of what the program will do. It will then call the getInfo function (see below).
- a function named getInfo reads the file named customers.txt, one record at a time. Each record contains a name, beginning balance and the number of trades. (Keep in mind that this file may contain any number of records.) This function will then call (with two arguments) the compute function (see below). Once the customers trade fees for the month have been passed back from the compute function, your program should display (to the screen) the customers name and their trade fees for the month.
- a function compute that has the beginning balance and the number of trades passed to it as arguments. It will then compute and return to the getInfo function the company's trade fees for the month (for that customer).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started