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
Which statement opens a text file so that you can retrieve the information it contains?
vesna_86 [32]

Answer:

Answered below

Explanation:

aFile = open("books.txt", "r")

This code uses the function open() which takes two parameters. The first parameter is the file name while the second parameter is the mode in which you are accessing the file.

The "r" mode opens the file in a reading state. That is, you can only read from the file. This code completes the reading process

aFile.read( )

The "w" mode opens the file so you can write to it and make changes.

The "a" mode opens the file so you can add contents to it.

3 0
2 years ago
What is the meaning of HDMI?
tiny-mole [99]

Hey there!

The correct answer is that it stands for high definition video devices.



hope this helped and have a great day (:

3 0
3 years ago
Read 2 more answers
One advantage of using online note-taking tools is that they help students to
raketka [301]

Answer:

the correct answer is A

Explanation:

hope it helps

7 0
3 years ago
Read 2 more answers
What is the best way to describe how your voice should sound when you read a story out loud
umka21 [38]
Full of emotion and not like a robot 
3 0
3 years ago
In 2004, ICQ users were enticed by a sales message from a supposed anti-virus vendor. On the vendor's site, a small program call
Elis [28]

Answer:

Trojan horse

Explanation:

Trojan, also known as Trojan horse is a type of malware that ensures that its users are misled of its true purpose. They are a common type of virus and are very dangerous in such a way that they can even hide within other programs that are harmless. Once installed, Trojan will infect every file on your computer and can even steal information or totally infiltrate your system.

8 0
3 years ago
Other questions:
  • The numbers on the bottom of a typical check represent all of the following EXCEPT?
    12·2 answers
  • A multiplicative inverse of 3 modulo 5 is any integer a such that 3 a ≡ 1 (mod 5) , hence for some a ∈ Z5 .
    12·1 answer
  • A user is unable to install virtualization software on a Windows 8.1 computer. The user verified the host has sufficient RAM, pl
    6·1 answer
  • A file named numbers.txt contains an unknown number of lines, each consisting of a single positive integer. Write some code that
    6·1 answer
  • modified true or false analyze each statement then write technical the statement is true the statement is false underline the wo
    6·1 answer
  • Consider the following method, which is intended to return the index of the first negative integer in a given array of integers.
    14·1 answer
  • PLEASE I NEED HELP FAST
    8·1 answer
  • Flowchart is written using english language.<br>true or false​
    14·2 answers
  • How does an extranet work?
    15·1 answer
  • 1. (A) What do you mean by computer? Discuss the use of<br> computer in daily life.
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!