Problem -1: Write a python function display () for each requirement to read the file exam.txt...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Problem -1: Write a python function display () for each requirement to read the file "exam.txt" and (1) Display "K" in place of all the occurrence of "C" in the word College. (II) Display "K" in place of all the occurrence of "C" Note: To demonstrate the function, create a file exam.txt with two lines at minimum. The lines should contain College and Centennial many times. Problem - 2: What is CSV file? What are its characteristics? When do we use CSV file? Create a "student.csv" file with the student's records which are stored in the format: ID, Name, and Points Earned. Write a program to read all content of "student.csv", count number of records present in this CSV file and display records of only those students who scored more than 80 points. Problem - 3: Create a data file containing the following data: Identification Number 10031 10067 10083 10095 Write a program that uses the information contained in the data file created to produce the following pay report: ID No. Rate Hours Regular Pay Overtime Pay Gross Pay Any hours worked above 40 hours are paid at time and a half. At the end of the individual output for each ID number, the program should display the totals of the regular, overtime, and gross pay columns. Problem - 5: Problem - 4: Write a program named Machine: Accepts two floating point numbers, using one input ( statement, and calls three functions named sum, difference, and product. The function sum () uses a variable parameter *num. Displays the arguments received when called The function sum will calculate the sum of the numbers The function difference will calculate the difference of the numbers The function product will calculate the product of the numbers The program should then print the input numbers and their sum, difference and product. Note: You will develop all the required functions in a module "myMod" and utilize those functions by importing your model "myMod" read x, n Write a program to evaluate the x power of n. Hint: The following is the flowchart to implement set r = 1 n!=0? no Rate 6.00 5.00 6.50 8.00 return r yes n%2!=0? Hours 40 48 35 50 yes r=r*x no X=X*X ving to bas n=n/2 48 darch Problem -1: Write a python function display () for each requirement to read the file "exam.txt" and (1) Display "K" in place of all the occurrence of "C" in the word College. (II) Display "K" in place of all the occurrence of "C" Note: To demonstrate the function, create a file exam.txt with two lines at minimum. The lines should contain College and Centennial many times. Problem - 2: What is CSV file? What are its characteristics? When do we use CSV file? Create a "student.csv" file with the student's records which are stored in the format: ID, Name, and Points Earned. Write a program to read all content of "student.csv", count number of records present in this CSV file and display records of only those students who scored more than 80 points. Problem - 3: Create a data file containing the following data: Identification Number 10031 10067 10083 10095 Write a program that uses the information contained in the data file created to produce the following pay report: ID No. Rate Hours Regular Pay Overtime Pay Gross Pay Any hours worked above 40 hours are paid at time and a half. At the end of the individual output for each ID number, the program should display the totals of the regular, overtime, and gross pay columns. Problem - 5: Problem - 4: Write a program named Machine: Accepts two floating point numbers, using one input ( statement, and calls three functions named sum, difference, and product. The function sum () uses a variable parameter *num. Displays the arguments received when called The function sum will calculate the sum of the numbers The function difference will calculate the difference of the numbers The function product will calculate the product of the numbers The program should then print the input numbers and their sum, difference and product. Note: You will develop all the required functions in a module "myMod" and utilize those functions by importing your model "myMod" read x, n Write a program to evaluate the x power of n. Hint: The following is the flowchart to implement set r = 1 n!=0? no Rate 6.00 5.00 6.50 8.00 return r yes n%2!=0? Hours 40 48 35 50 yes r=r*x no X=X*X ving to bas n=n/2 48 darch
Expert Answer:
Answer rating: 100% (QA)
Sure Here are the solutions to the problems you provided Problem1 python def display with openexamtxt r as file for line in file line linereplaceC K Replaces C with K in the word College printlinerepl... View the full answer
Related Book For
Computer Architecture A Quantitative Approach
ISBN: 978-0123704900
4th edition
Authors: John L. Hennessy, David A. Patterson
Posted Date:
Students also viewed these programming questions
-
Activity 1 (4pts): Please create a full adder. After it is constructed on the breadboard please submit a photo of your completed circuit and create a truth table for its functionality. Also, please...
-
Give Correct ANSWERS Human-Computer Interaction (a) If you had been one of the original inventors of the WIMP interface, and engineers on the technical team had been sceptical about the advantages...
-
ttth Suppose that the sequence of bags {Bn | n N} is recursively enumerated by the computable function e(n, x) = fn(x), [7 marks] Hence prove that the set of all recursive bags cannot be recursively...
-
help me with questions 10, 11 and 12 to answer them for practiceolin data structures Given the following linked list definitions: struct listRec! string name; listRec *link, ;: nodeType *begin; Code...
-
Wong testified that he had looked for the note at a third-party storage facility. If the note had been found there, would it mean that the note had been "transferred" to the facility, making the...
-
In the constant growth model, should you use a nominal growth rate or a real growth rate? Why?
-
The income statement of Dreamworks International Co. for the year ended December 31, 2002, reported the following condensed information. Dream works' balance sheet contained the following comparative...
-
Murray Company borrows $340,000 cash from a bank and in return signs an installment note for five annual payments of equal amount, with the first payment due one year after the note is signed. Use...
-
Matthew (48 at year-end) develops cutting-edge technology for SV Incorporated, located in Silicon Valley. In 2021, Matthew participates in SVs money purchase pension plan (a defined contribution...
-
The Specialty Department Stores, Inc. chief executive officer (CEO) has asked you to compare the company's profit performance and financial position with the averages for the industry. The CEO has...
-
An "if" statement must always be inside an "always" block. This statement is Select one: O a. True O b. False O .False if there is an event control operator O d. True if there is an event control...
-
Write a C++ program (with two arrays) to: 1. Read up to 100 student numbers and test scores from the keyboard (provide a method to end the input before reaching 100 records); 2. Display the student...
-
Each General Electronics manufactures microchips in large quantities. microchip undergoes assembly and testing. The total assembly costs during January 2006 were: 1. Direct materials used Conversion...
-
20. What is the output of this program? import java.io.IOException; public class Derived { public void getDetails() throws IOException { System.out.println("Derived class"); } } public class Test...
-
19. What is the output of following program? public class Test implements Runnable { public void run() { } System.out.printf("GFG "); public static void main(String[] args) throws...
-
Show the contents of the CPU registers after the execution of the following code (your answer must be in hexadecimal) mov mov push AX, 34ACH; all constants are hexadecimal numbers (letter H) BL, 73H...
-
11: Show all necessary work for each problem; your work is part of the grading criteria. Precise usage of language and symbols/notations 1. (14 points) Taylor's MasterCard activity for one billing...
-
d) For die casting processes: 1. What are the most common metals processed using die casting and discuss why other metals are not commonly die casted? 2. Which die casting machines usually have a...
-
Let's consider what dynamic scheduling might achieve here. Assume a microarchitecture as shown in Figure 2.42. Assume that the ALUs can do all arithmetic ops (MULTD, DIVD, ADDD, ADDI, SUB) and...
-
RAID 6 is used to tolerate up to two simultaneous disk failures. Assume that you have a RAID 6 system based on row-diagonal parity, or RAIDDP; your six-disk RAID-DP system is based on RAID 4, with p...
-
Assume you are redesigning a hardware prefetcher for the unblocked matrix transposition code above. The simplest type of hardware prefetcher only prefetches sequential cache blocks after a miss. More...
-
Sanchez Company's manufacturing overhead budget for the first quarter of 2002 contained the following data. Actual variable costs were: indirect materials \($14,200\), indirect labor \($9,600\),...
-
As sales manager, Todd Keyser was given the following static budget report for selling expenses in the Clothing Department of Pace Company for the month of October. As a result oi this budget report,...
-
Haven Manufacturing Inc. has three divisions which are operated as profit centers. Operating data for the divisions listed alphabetically are as follows. Instructions (a) Compute the missing amounts....
Study smarter with the SolutionInn App