1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
aleksandrvk [35]
3 years ago
11

"Create a Python program named detect_column_level_data_entry_errors. When complete, you will run this program to produce a diag

nostic report that shows data entry errors that cause column totals in the data to be out of balance. You will be expected to edit the cleaned_data.txt input file and make corrections until running this program shows that all column-level errors have been resolved."
Computers and Technology
1 answer:
11111nata11111 [884]3 years ago
8 0

Answer:

See explaination

Explanation:

Code for detect_column_level_data_entry_errors.py:

# File: detect_column_level_data_entry_errors.py

# The program will produce a diagnostic report that shows data entry errors that cause column

# totals in the data to be out of balance. Will need to fix cleaned_data.txt until errors resolved.

def main():

input_filename = input('Please enter the input filename: ')

infile = open(input_filename, 'r', encoding='utf8')

total_males = 0

total_females = 0

sum_total = 0

print('\n{0:^40}'.format('Column-Level Data Entry Errors'))

print('\n{0:<10}{1:>10}{2:>10}{3:>10}'.format(

'Age Group', 'Males', 'Females', 'Total'))

for line in infile:

age_group, males, females, total = line.split()

males = int(males)

females = int(females)

total = int(total)

print('{0:<10}{1:>10,}{2:>10,}{3:>10,}'.format(

age_group, males, females, total))

if age_group != 'Total':

total_males = males + total_males

total_females = females + total_females

sum_total = total + sum_total

else:

print('{0:<10}{1:>10,}{2:>10,}{3:>10,}'.format(

'Error', (males-total_males), (females-total_females), (total-sum_total)))

infile.close()

main()

You might be interested in
When describing memory, ____________ is the first component required in the process necessary for retention?
8_murik_8 [283]
Depends on how deep you're willing to go to really,
You need one of a few arrangements of flip flop circuits to keep 1-bit state.
Going deeper, you need either NAND, or NOR gates(or a bunch of other ones) and connectors.
Even deeper, you'll require diodes or transistors to build the logic gates.
Beyond that is particle physics.
8 0
3 years ago
What steps do you need to take to register
ratelena [41]
Depends on what you are registering for but you will most likely need your First and last Name, Email, and a secure password... that's for most signups.
7 0
3 years ago
What is a power surge?
Damm [24]
D. A spike of electricity. They are fast and have a short duration.
4 0
2 years ago
WILL GIVE BRAINLIEST!!!!!!!!!
sukhopar [10]

Answer:

True

Explanation:

7 0
3 years ago
Look at (d), is it accurate? ​
Angelina_Jolie [31]

Answer:

ya

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Why does this say I'm in middle school?
    11·1 answer
  • What is the name of the symbol that is used to classify and categorize information?​
    10·2 answers
  • How to download a software program??
    15·1 answer
  • Please help. 15 points!!!!
    8·2 answers
  • Which attribute defines the file name for the specific image in an image tag??
    13·1 answer
  • Give me username ideas for rblx.
    6·2 answers
  • Menus are attached to the windows by calling
    15·1 answer
  • Give 5 examples for software ​
    9·1 answer
  • Which command os used to find a particular word in a document ?<br>​
    9·2 answers
  • 11. Explain different types of program control with suitable flow chart.<br> N
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!