Show example code that will modify the example program below so that in addition to counting the the "cakes baked" recorded in the file, it also counts the the number of "cakes baked" on a spefic date. For example the number baked on a thursday. file=open("examplefile.txt","r") total_cakes = 0 for line in file: total_cakes = total_cakes + 1 print("There were ", total_cakes, "cakes in January 2023")
Q: Q: Suppose you have a machine which executes a program that consists of 50% (in terms of execution…
A: Instruction Set: In machine language, an instruction set is a collection of instructions for a CPU.…
Q: The Boolean expressions (xy)' = x'+y' and (x + x)' = x'y' are examples of (the):
A: The question is asking about two Boolean expressions and what kind of properties they represent in…
Q: IF a>=10 && B<=5 Then some line of code Write down the test case for this?
A: We must take into account every situation that could occur based on the values of a and b in order…
Q: Give six examples of the different types of process technologies that are used to make customizable…
A: PLDs are integrated circuits that may be programmed to carry out a number of different digital…
Q: Exists a third component to the operating system of a computer?
A: A computer's operating system is made up of many components that work together to manage hardware…
Q: What is the most essential consideration when transitioning from a serial to a batch processing…
A: The shift from serial to batch processing systems is a crucial step in scaling up computing…
Q: Prove that a minimum spanning tree of a graph component must include a shortest edge. It is…
A: A argument by contradiction can be used to demonstrate that a least spanning tree of a graph…
Q: In a distributed system, multiple copies of software are present on each node. What is its true…
A: When a software component is replicated on each node in a distributed system, it means that the…
Q: How can we make it easier for people from diverse cultural contexts to utilise the online services…
A: Internet has become an indispensable part of our lives, with a multinational corporations offering…
Q: PYTHON class BSTnode: def __init__(self, key = None, left = None, right = None, parent = None):…
A: The Python code below defines a Binary Search Tree (BST) node class containing methods for setting…
Q: Several Linux commands are identical to their corresponding Unix commands. Why is this occurrence…
A: Originally, Linux was created as a free and open-source operating system that could function on a…
Q: How do cryptographic techniques such as encryption, digital signatures, and hash functions…
A: The term "cryptographic" refers to the strategies and procedures used to protect data and…
Q: Make a binary tree implementation utilising the chapter's discussed recursive method. In this…
A: class Node: def __init__(self, value): self.value = value self.left = None…
Q: This week's discussion topic focuses on functional requirements. These need to be clearly written so…
A: The question asks for an analysis and evaluation of a student's response to a prompt about…
Q: What are some of the ethical and legal issues that arise from the use of big data analytics and…
A: Privacy: The collection, storage, and analysis of large volumes of personal data can lead to…
Q: C++ programming task. main.cc file: #include #include #include #include "plane.h" int…
A: main.cc: #include <iostream>#include <map>#include <vector> #include "plane.h" int…
Q: The "Internet of things" now exists. "three new fascinating uses"
A: The "Internet of Things" (IoT) is a network of interconnected physical objects, such as cars and…
Q: Write a program that gets integer n from the user and prints the character "*" as the following…
A: Declare a variable size with a value of 25 to represent the dimensions of the graph. Use a nested…
Q: I need to be able to test all 3 test cases at the same time like I can't delete one and do the other…
A: Two Python codes are given below Code (if you want to enter all inputs at one run) Code (if you…
Q: What can you discern about an object's attributes in the Designer simply by examining its bounding…
A: In computer science, a bounding box is a rectangular box that encapsulates an object or a group of…
Q: Discuss why two separate, standard internet transport protocols exist: TCP and UDP. How are they…
A: TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are two basic internet…
Q: Take the initiative in fighting crime in Kampala. In order to enhance the administration of these…
A: The increasing rate of crime in Kampala calls for effective measures to be put in place to curb the…
Q: What is the principal or more visible effect of data collected on you? A) fingerprinting B) targeted…
A: What is data: Data refers to any information or facts that can be recorded and analyzed to gain…
Q: What would you prioritise if you were compelled to migrate to a system that processes data in…
A: Batch processing: It is the method computers use to periodically complete high-volume, repetitive…
Q: What is an optimising compiler and how does it function? Why would you ever want to use one of these…
A: An optimizing compiler is a type of compiler that analyzes and modifies the code to improve its…
Q: Increase your knowledge of social media. Autonomous computing versus cloud computing? These examples…
A: Social media refers to online platforms and tools that allow people to create, share, and exchange…
Q: If you could provide four persuasive arguments in favour of continuous event simulation, I'd be…
A: As technology continues to advance, so too does the need for accurate and efficient modeling and…
Q: As part of an assignment, you were required to make connections between the concepts covered in your…
A: In this question we have to understand connections between the concepts covered in CS course and…
Q: in a single describe the impacts that computer sciecne has on biology with bioinformatics. please…
A: The answer is given below. Citations website cannot be provided because of Bartleby policies.
Q: Give three advantages of the cascade method over the incremental method.
A: 1) The cascade model and incremental model are two popular software development models used in the…
Q: How does Direct Memory Access (DMA) benefit multithreaded systems? How does this hinder the…
A: Direct Access Memory transfers the block of data between the memory and peripheral devices of the…
Q: Add three methods to the Student class that compare twoStudent objects. One method (__eq__) should…
A: The question asks you to add three comparison methods to a Student class in Python. The three…
Q: Think it's fair that you have to give up your email and login for free or almost free software? How…
A: In the current era of technology , numerous software companies provide free or low cost software to…
Q: What are the pros and cons of real-time versus non-real-time computer operating systems, and what…
A: Computer operating systems can be divided into two categories: real-time operating systems (RTOS)…
Q: Can you code a loop using any of loop types in C++ (while, do-while and for)? Please support your…
A: The cpp language which consist of following types of loops: 1.while loop. 2.do-while loop. 3.For…
Q: Complete a table for the first 4 and last 4 subnets in this network. Give the subnet number starting…
A: We must employ subnetting by borrowing bits from the host portion of the address in order to…
Q: Solve the problems using the Routh-Hurwitz arrangement by hand and confirm using scilab. In the…
A: In this question we have to use the Routh-Hurwitz stability criterion to determine the range of…
Q: How does the concept of pervasive computing ultimately function?
A: The term "pervasive computing" refers to a developing trend in which computational power is embedded…
Q: Given the nature of a set, one could implement the Set interface using any one of a variety of other…
A: One technique to creating a Set data structure is to implement the Set interface using a LinkedList.…
Q: in a pargraph talk about the impacts on computer science and biolgy with bioinformatics. include the…
A: Bioinformatics is an interdisciplinary field that combines computer science and biology to study…
Q: der first four letters of your name coming as emory is 250 MB. Write down the sequence an interrupt…
A: The answer is
Q: A number of Linux commands are identical to their corresponding Unix commands. Why does this keep…
A: Many Linux commands are completely functioning on other OSes as a result of porting and…
Q: Due to their inherently distinct architecture, wireless networks present their consumers with unique…
A: Wireless networks have become popular for their convenience and flexibility, but they also present…
Q: Design a logic circuit or a block diagram of what the a "D flip-flop with enable" would look like…
A: The D flip-flop with enable circuit consists of three main components: the AND gate, the flip-flop,…
Q: Given a pipelined processor with 4 stages, what is the theoretical maximum speedup of the the…
A: What is processor: A processor is the electronic circuitry within a computer that carries out the…
Q: Please fix this so when i press Addorder i am able to add the data and the when i press save the…
A: In this fixed version, I added the necessary JTextFields for ID, Estimated Wait Time, Table Number,…
Q: Read on if you want to learn more about software design and how different methods work. For each…
A: The answer is given below step.
Q: Why would you choose the conventional waterfall technique over the more flexible iterative waterfall…
A: Depending on the project's specific requirements and constraints, the more flexible iterative…
Q: Help, I making a elevator simulator, I need help in writing code in the Elevator class and it's…
A: The offered code is a template for an elevator simulation in Java. It includes classes for different…
Q: Problem#9 Suppose the values of a distribution varies from -3 to +3, with mean of 0 and standard…
A: In this question we have to plot a graph using R programming for the given description and output…
Step by step
Solved in 4 steps
- scores.txt : Jan,86 Drew,92 Blake,85 Alex,81 Taylor,88 Jordan ,72Cam,89 Note: code is written in python please The file scores.txt (attached) contains a list of names and test scores. Create a program that reads each line of the file and determines the highest score and who obtained it. This is an exercise in strings. You are required to use at least one string method to determine the names and the scores. Your output should resemble the following: Highest Score: 100Achieved by: Jay Note; i could not send an attachment of the actual file but i have copied its contents.scores.txt : Jan,86 Drew,92 Blake,85 Alex,81 Taylor,88 Jordan ,72Cam,89 Note: code is written in python using strings and lists only The file scores.txt (attached) contains a list of names and test scores. Create a program that reads each line of the file and determines the highest score and who obtained it. This is an exercise in strings. You are required to use at least one string method to determine the names and the scores. Your output should resemble the following: Highest Score: 100Achieved by: Jay Note; i could not send an attachment of the actual file but i have copied its contents.scores.txt : Jan,86 Drew,92 Blake,85 Alex,81 Taylor,88 Jordan ,72Cam,89 The file scores.txt (attached) contains a list of names and test scores. Create a program that reads each line of the file and determines the highest score and who obtained it. This is an exercise in strings. You are required to use at least one string method to determine the names and the scores. Your output should resemble the following: Highest Score: 100Achieved by: Jay Note; i could not send an attachment of the actual file but i have copied its contents.
- PYTHON: Write a program that reads the student information from a tab separated values (tsv) file. The program then creates a text file that records the course grades of the students. Each row of the tsv file contains the Last Name, First Name, Midterm1 score, Midterm2 score, and the Final score of a student. A sample of the student information is provided in StudentInfo.tsv. Assume the number of students is at least 1 and at most 20. The program performs the following tasks: Read the file name of the tsv file from the user. Open the tsv file and read the student information. Compute the average exam score of each student. Assign a letter grade to each student based on the average exam score in the following scale: A: 90 =< x B: 80 =< x < 90 C: 70 =< x < 80 D: 60 =< x < 70 F: x < 60 Compute the average of each exam. Output the last names, first names, exam scores, and letter grades of the students into a text file named report.txt. Output one student per row…Your program should use a loop to read data from a text file which contains students' names and 3 exam scores. The program should calculate the exam average for each student, determine the appropriate letter grade for that exam average, and print the name, average, and letter grade. After printing all this, you need to print the count of the total number of A's, B's, C's, D's, and F's for the whole class. The text file you need to use can be accessed using this link: scores.txt. Copy this file to the folder where your program will reside. The text file contains a list of 30 records, and each record contains a name and that person's 3 test scores. Each field is separated by a tab character. The first 2 records looks like this: Davis 88 92 84Wilson 98 80 73 and so on. Your program will need to open this file and read each line until the end of file. I recommend calculating a student's exam average and letter grade as you read the file, although this is not a…Problem Definition Task. Your task is to develop a python program that reads input from text file and finds if the alphanumeric sequence in each line of the provided input file is valid for Omani car license plate. The rules for valid sequences for car plates in Oman are as follows: Each sequence is composed of 1 to 5 digits followed by one or two letters. Digits cannot start with 0, for instance, 00, 011, or 09 are not valid digit sequences. The following list are the only valid letter combinations: ['A','AA','AB','AD','AR','AM','AW",'AY"', 'B', BA','BB','BD',"BR','BM',"BW',"BY', 'D','DA','DD','DR','DW','DY', 'R','RA','RR','RM','RW','RY', 'S','SS', 'M','MA','MB','MM','MW','MY", "W',"WA',WB',"wW', Y,YA','YB','YD','YR','YW',YY] Program Input/Output. Your program should read input from a file named plates.txt and write lines with valid sequences to a file named valid.txt. Any line from the input file containing invalid sequence should be written to a file named invalid.txt. Each line…
- The function file_first_chars in python takes one parameter, fname, the name of a text file, and returns a string made up of the first character from each line in the file. You may assume there are no blank lines in the file. Hint: Use a for loop to iterate over the lines of the file and accumulate the string of first characters. NOTE: Return the function, don't print For example: Test Result print(file_first_chars("wordlist1.txt")) hsaemThe Apgar Medical group keeps a patient file for each doctor in the office. Each record contains the patient's first and last name, home address, and birth year. The records are sorted in ascending birth year order. Write a program so that display a count of the number of patients born each year John Hanson, 23 Elm, 1927Mary Locust, 476 Maple, 1950Susan Monroe, 512 Peachtree, 1957Carol Fortune, 2819 Locust, 1960James Fortune, 2819 Locust, 1963Lawrence Fish, 12 Elm, 1968Janice Weiss, 234 Birch, 1971Henry Garza, 199 Second, 1973Kimberly Swanson, 310 Appletree, 1980Louis Claude, 2716 Third, 1981Jill Fox, 12 Oak, 1985Opal Reynolds, 78 County Line, 1987Francis Dumas, 67 Fourth, 1992Madison Conroy, 23 Fifth, 1996Daniel Moy, 100 Sunset, 19872. The manager of a basketball stadium wants you to write a program that calculates the total ticket sales after each game. There are four types of tickets – box, sideline, premium, and general admission. After each game, data is stored in a file in the following forms: ticketPrice numberOfTicketsSold Sample data are shown below: 250 5750 100 28000 50 35750 25 18750 The first line indicates that the box ticket price is 250 pesos and that 5750 Tickets were sold at that price. Output the number of the tickets sold and the total sale amount. Format your output with two decimal places.
- Here are the two programs which you may choose from to do this program: 1. Using Files - Student Line Up Modify the Student Line Up program described in Programming Challenge 14 which states: "A teacher has asked all of her students to line up according to their first name. For example, in one class Amy will at the front of the line, and Yolanda will be at the end. Write a program that prompts the user to enter the number of students in the class, then loops to read that many names. Once all of the names have been read, it reports which student would be at the front of the line and which one would be at the end of the line. You may assume that no two students have the same name. You are now to do this program reading names from a file. Names should be read in until there is no more data to be read. I am providing for you a file named LineUp.txt for you to use in writing this program. I suggest that you write it first without the file and then modify to add the file.Finish this program from the code posted below! Note: There should be two files Main.py and Contact.py You will implement the edit_contact function. In the function, do the following: Ask the user to enter the name of the contact they want to edit. If the contact exists, in a loop, give them the following choices Remove one of the phone numbers from that Contact. Add a phone number to that Contact. Change that Contact's email address. Change that Contact's name (if they do this, you will have to remove the key/value pair from the dictionary and re-add it, since the key is the contact’s name. Use the dictionary's pop method for this!) Stop editing the Contact Once the user is finished making changes to the Contact, the function should return. Code:from Contact import Contactimport pickledef load_contacts():""" Unpickle the data on mydata.dat and save it to a dictionaryReturn an empty dictionary if the file doesn't exist """try:with open("mydata.dat", 'rb') as file:return…PYTHON without Def function Problem Statement Given a grades.txt file of grades on an exam, output a final_grades.txt file in which each score is curved such that the person with the highest score has a score of 100. If someone gets over 100 on the exam, curve all of the grades downward so that the highest score is a 100. Sample Input 1 (File grades.txt) FirstName LastName Grade Harry Potter 86 Ronald Weasley 85 Hermione Granger 98 Sample Output 1 (File final_grades.txt) FirstName LastName Grade Harry Potter 88 Ronald Weasley 87 Hermione Granger 100 Sample Input 2 (File grades.txt) FirstName LastName Grade Harry Potter 86 Ronald Weasley 85 Hermione Granger 110 Sample Output 2 (File final_grades.txt) FirstName LastName Grade Harry Potter 76 Ronald Weasley 75 Hermione Granger 100