University of Texas Python Programming Code
Description
1. # Part 1
You have secured an internship at CapitalOne in the credit card risk management department. Your manager
needs you to create a script to help provide a basic analysis on which account applications will be booked
(issued a credit card) vs. which account applications will be declined, while meeting CapitalOne’s auditing
requirements which state all account applications must be logged into a file. At CapitalOne, account
applications are booked when they have a CO Score of at least 605. The CO Score is calculated from each
account application’s credit score and credit score multiplier. Each account application includes a credit score
(from 300-850, inclusive) along with a credit score multiplier (from -20% to +20%, inclusive). For example, a
credit score of 500 with a multiplier of -10% will result in a CO Score of 450, resulting in a declined application.
Write Python code that will allow an end user to enter a set of credit applicant names, credit
scores, and credit score multipliers. All data must be appropriately validated. Whenever any invalid value is
entered, the user must be re-prompted for a new value. Generate a text file that will store only this data
entered.
Based on the text file you created, use the text file within Python code that prints a well-formatted,
professional report (e.g., appropriately line up values, use column headers, etc.) from the data within the file.
The report must also list the CO score and whether the application was booked. Finally, the report must show
how many applications were booked, how many applications were declined, and the percentage of accounts
that were booked.
Part 2
A local casino needs your data analysis skills to determine if a pair of dice purchased from a vendor are casino
grade. To determine the answer, each individual die in the pair of dice must be rolled X number of times. X is
specified by the user testing the pair of dice. A chart of frequencies is then generated from the dice rolls.
Write Python code that will simulate the testing described above for the pair of dice. The code will
prompt the user to enter the number of times the pair of dice should be rolled. In the case the user does not
enter a valid value, they must be re-prompted. To simulate the rolling of a single die within the pair of dice,
use a function that can randomly generate a number in range. Then calculate the total achieved from rolling
the pair of dice. Determine the total number of occurrences for each dice roll (frequencies). Print a well-
formatted frequency table (e.g., appropriately line up values, use column headers, etc.) listing all possible dice
totals (i.e., 2 through 12), the number of times that total was achieved, and the percentage of times the total
was achieved relative to all dice rolls.
RULES
Your solution must demonstrate the use of dictionaries, strings, and files.
• You may import Python’s random library.
• You may use any Python functions that do not require a library to be imported (provided we have
covered them in class). Further, you may import the random library; however, your solution may not
import any additional Python libraries.
• You may not use the keyword global in your code. Converting a local variable in a function to a
global variable leads to spaghetti code. The only way you should share variables between functions is
by passing or returning them.
• You must not exit any repetition statements using break, continue, or return or any other
similar strategy. A repetition statement must only exit when its iteration condition is false.
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."