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:
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
-
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...
-
The U.S. federal courts are accepting too many lawsuits initiated by foreigners that concern matters not relevant to this country. Explain
-
Prepare a written presentation on the history of hockey Introduction: Tell us about the sport you have chosen and why you chose it. Body: include the following place of origin complete "genealogy"...
-
Find the indicated z-score(s) shown in the graph. Area = 0.05 Area = 0.05 z = ? 0 z=? Z
-
Dr. Susan Sweeney, a Providence, Rhode Island, psychologist, specializes in treating patients who are agoraphobic (i.e., afraid to leave their homes). The following table indicates how many patients...
-
What are the fundamental thermodynamic principles underlying azeotropic distillation, and how do these principles guide the design of separation processes to break azeotropes ?
-
On October 1, 2019, Santana Rey launched a computer services company, Business Solutions, that is organized as a proprietorship and provides consulting services, computer system installations, and...
-
Bakers yeast is produced in a 50,000-litre fermenter under aerobic conditions. The carbon substrate is sucrose; ammonia is provided as the nitrogen source. The average biomass composition is CH1.83...
-
Show that the Fourier transform of a conjugate antisymmetric sequence is imaginary.
-
The term empty input describes what happens when a. the user presses the Spacebar Enter and then the key b. an input operation attempts to read data, but there is no data to read c. the user enters 0...
-
In the month preceding the creation of this exercise, the author made no phone calls on 19 of the 30 days in the month. Assume that 10 days from that month are randomly selected with replacement....
-
Determine the solutions of the difference equations below, supposing that the systems they represent are initially relaxed: (a) \(y(n)-\frac{1}{\sqrt{2}} y(n-1)+y(n-2)=2^{-n} \sin \left(\frac{\pi}{4}...
-
Allied Electronics must purchase a new automatic soldering machine to meet increased demand for its electronic goods. Of all the machines considered, management has narrowed the choices to the...
-
At 17 temperature and 870 ml pressure, the volume of the fixed mass in the gas is 76ml. What will be the volume of that gas at standard temperature and pressure.
-
Using Apple, demonstrate how the differentiation strategy can be well implemented.
-
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...
-
Using a financial calculator, solve for the unknowns in each of the following situations. a. On June 1, 2024, Holly Golightly purchases lakefront property from her neighbor, George Peppard, and...
-
Sally W. Emanual, a teacher, had the following dividends and interest during 2022: Additional information pertaining to Sally Emanual includes The taxable portion of the pension is \($7,000.\) Sally...
-
Ed owns Oak Knoll Apartments. During the year, Fred, a tenant, moved to another state. Fred paid Ed \($1,000\) to cancel the two-year lease he had signed. Ed subsequently began renting the unit to...
Study smarter with the SolutionInn App