Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question
How do I turn this code into a flowchart? Python code: #defining the tuples tup1 = ("$") tup2 = ("$") tup3 = ("PAYROLL TRANSACTIONS") #creating the first function to creat the heading "PAYROLL TRANSACTIONS" def print_heading(): print("\t","\t", tup1, tup3, tup2, "\t","\t") print("\n") return #calling the function that was just made print_heading() #creating the second function to make a line between the heading and the data, making the chart look cleaner (this function will be called later) def break_line(): print("_____________________________________________________") print("\n") return #opening the employees file and calling it "Filea" Filea = open('Employees.csv') #reading the lines and copying them to a new variable, emp index 0 a = Filea.readlines() aHeading = a[0] #delete first line from line list we just made del a[0] #split is dividing this string into a list, making our columns and rows aHeading = aHeading.split(",") #opening the timesheet file and doing the same thing we just did above for this file timeFile = open('Timesheets.csv') time = timeFile.readlines() timeHeading = time[0] del time[0] timeHeading = timeHeading.split(",") #making am employee info list aInfo= [] #for loop for row in range(len(a)): #removing new line from the end of each row data = a[row] #spliting all of the data into a list data = data.split(",") timeData = time[row] timeData = timeData.split(",") #appending/putting together the data . timedata has the hours and data has the other info thechart = [] thechart.append(data[0]) thechart.append(data[1]) thechart.append(data[2]) thechart.append(timeData[1]) thechart.append(data[4]) #calculating the gross pay using the data we just put together in the last group of code if(data[5] == 'Y'): gpay = (40*float(data[4]))+((float(timeData[1]) - 40)*float(data[4])*1.5) else: gpay = float(timeData[1]) * float(data[4]) thechart.append(gpay) #adding employee data into the chart! aInfo.append(thechart) #printing the format print("Emp No","First","\t"," Last","\t", " Hours","Wage","Gross Pay") #calling break line function from beginning break_line() #print all employee information for e in aInfo: print("{:
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education