A1 The input file A1(input).txt has the following content for example: [a,b], [12, 'y']['1', 2, ¹2 3¹, x]: [ b, 123, ! ] Write a python program that can read and organize A1(input).txt into the output as shown below. Extra test line inputs may also be added by the examiner to fully test out your code's generality. Design your solution to be simple but general. Hints: Focus on using lists, for-loops, functions readlines, split, and replace. Extract bracketed contents: a, b 12, 'y' '1', 2, '2 3¹, b, 123, ! X Processed contents: a, b, One Two, y, One, Two, Two Three, x, b, One Two Three, !
Q: Write a Java Program and introduce an intentional error in it. 1. Your program must include the…
A: What is INTENTIONAL ERROR? Intentional actions, but there is NO harm intended. It’s related to…
Q: Which one is the formula to compute the integral f f(x) dx with the trapezoid rule? O f(0) + f(1)…
A: Given Question: To choose the correct option.
Q: Urgent solve using C++ Notes: The maximum size of any c-string in this lab is 100 characters and…
A: Here is the c++ program See below steps.
Q: 4. Suppose we have to transmit a list of five 4 bit numbers that we need to send to a destination.…
A: Each 1 or 0 in a binary number is called a bit. A group of 4 bits is called a nibble
Q: Suppose the round-trip propagation delay for Ethernet is 46.4 µs. This yields a minimum packet size…
A:
Q: Name at least three tasks performed by the WinMain (startup) procedure.
A: Answer:
Q: A micro instruction format has micro operation field which is divided into 2 subfields F1 and F2,…
A: Logic , if there are n micro- operation then we can represent it in form of 2n where n will…
Q: into two parts: an initial network ID portion that identifies individual networks, followed by a…
A: The answer is
Q: describes the input system used by a IX-generated lexical analyzer (though not by LEX itself). This…
A: The lexical analyzer is used in the first phase of compiler for lexical analysis. Lexical analyzer…
Q: Suppose a TCP connection, with window size 1, loses every other packet. Those that do arrive have…
A:
Q: Consider a triangle having vertices at A (0,2), B (5,10) and C (3,4). Scale the triangle using…
A: The question has been answered in step2
Q: X2 W13.38 1.13, w23 -1.08 -.56 W24 XOR Gate WIL (14) -1.49- کہانیا -.46 -.23 output
A: This exercise is an introduction to using the FEED FORWARD and BACK PROPOGATION algorithm for the…
Q: M07.
A: We are going to write a pearl program which will concatenate 3 strings, string1 then one space and…
Q: What is the output produced by the following code? int a=2, b=4; for (int i=0; i<9; i++) a+=2; b+=4;…
A: Given Code public class Question{ public static void main(String []args){…
Q: Implement the following Racket functions: Reflexive? Input: a list of pairs, L and a list S.…
A: code- L=[(1,1),(2,2)]S=[1]def is_reflective(L, S): for i in S: if (i, i) not in L:…
Q: Write a program that calculates the total grade for N classroom exercises as a percentage. The user…
A: C++ is just an object oriented programming language not only based on objects but also based on…
Q: Give some applications of cloud computing
A: The above question is solved in step 2 :-
Q: Convert the following epsilon NFAs to NFAs with complete transition table 1. 2. E 1 b 1 a E 0,1
A: The question is regarding converting the epsilon NFA to NFA. We will use the transition table and…
Q: The command “#define LED_PORT PORTD” will create LED_PORT constant that can be changed during the…
A: First we have to understand what is the use of the command define in programming . define as the…
Q: In order to use functions in the math library, a program must includea) a comment b) a loop c) an…
A: Explanation A text note called a remark is a text note that is added to the source code to explain…
Q: Explain different types of DBMS
A: The above question is solved in step 2 :-
Q: Write a program that draws a winter scene with a Christmas tree and asnowman.
A: Lets see the solution.
Q: Suppose you have a RISC machine with a 2.7 GHz clock (i.e., the clock ticks 2.7 billion times per…
A: The answer is:-
Q: After establishing a connection with the local DNS server PC1 now knows the IP and MAC addresses of…
A: ARP working: When a new host or computer establishes a connection, an IP address is associated with…
Q: 4. Word Separator:Write a program that accepts as input a sentence in which all of thewords are run…
A: Approach Input string. Take an empty new string. Set counter to 0. for each character of the input…
Q: One of the purposes of TIME_WAIT is to handle the case of a data packet from a first incarnation of…
A: The question has been answered in step2
Q: 7 Question Which of the following is a best security practice to protect your credentials when…
A: Below is the answer to above question...
Q: Java VENDING MACHINE Write a program that simulates a vending machine. The program should display a…
A: Java Programming refers to the object oriented programming languages that are used to develop the…
Q: It is possible to define flows on either a host-to-host basis or on a process-to-process basis. (a)…
A: If a data packet gets transferred from one source to a destination, then the IP address of the…
Q: Q9. Consider the following algorithm: sum = 0 for j in range(1,14): sum = sum + (4*j + 6)…
A: Introduction: This code is related to the python loop and operators. Operators used are assignment…
Q: You are a software engineering manager and your team proposes that model-driven engineering should…
A:
Q: OUTPUT WRITING…
A: Output of First Question : Open Source Softwares available are:PHPPYTHONJAVAR Every value in the…
Q: Find out the generic format for TCP header options from Request for Comments 793. (a) Outline a…
A: TCP Header TCP header holds several information fields with the host address of source and…
Q: Suppose that (Y,. X) satisfy the assumptions specified here and in addition, u, is N (0, 2) and…
A:
Q: After establishing a connection with the local DNS server PC1 now knows the IP and MAC addresses of…
A: Below is the answer to above question. I hope this will be helpful or you...
Q: •Develop a program that has an empty list. Then, have it ask a user five times (use a while loop) to…
A: Introduction: In this question, we are asked to write a python program to enter the 5 names by user…
Q: 4. Calculate the perceptron network if there are 3 inputs x,-1.7, x,-5.9, x₂-3 and b= -1.8. Synaptic…
A: Perceptron network: A perceptron is a neural network entity that carries out specific simulations…
Q: The telephone system uses geographical addressing. Why do you think this wasn't adopted as a matter…
A:
Q: You have been asked to test a method called 'catWhiteSpace' in a 'Paragraph' object that, within the…
A: The given scenario involves testing a method named "catWhiteSpace" in a "Paragraph" object that…
Q: Consider the following network. Here, Distance vector routing is being used. 00 8 X 6 6 12 y 3 W st…
A: The question is based on distance vector routing algorithm.
Q: Order the following sentences so that they form a direct proof of the statement: If x and y are…
A: The question is to arrange the statements in order to prove the given statements.
Q: 6 -2.6 -2.7 Bias Assume that the activation function used for all neurons is "logistic function" and…
A: The answer is
Q: The statement PORTD = 0b11010110 will map the 7-segment LEDs in this order; BAFG.EDC Select…
A: The given statement; The statement PORTD = 0b11010110 will map the 7-segment LEDs in this order;…
Q: Given the variable names pathName contains a string describing a directory path, write a statement…
A: Note- since programming language is not specified we providing answer in python programming. Answer…
Q: Please answer all the question from the SQL: Create table with the name AcademicDetails with…
A: Sql is the structured query languages. It is called as the domain specific languages where we use to…
Q: GSM time slot is 577 s (microseconds) in duration and includes far more than a snapshot of e…
A: The answer is
Q: You have been asked to test a method called 'catWhiteSpace' in a 'Paragraph' object that, within the…
A: Testing partitions are: Strings with sequences of blank characters in the middle of the string…
Q: design a java program that will use a Linked list with an iterator to add new coaches and maintain…
A: Start. Construct the linked list. Use the iterator to add new elements. Print the result. Exit.
Q: Write a program that prompts the user to input an integer between 0 and 35. If the number is less…
A: The input is taken in num variable from the user. int diff = num - 10; //asciiOfA to be…
Q: IP hosts that are not designated routers are required to drop packets misaddressed to them, even if…
A: Introduction: Routing: Routing is the process of selecting a path for traffic in a network or…
Code this
Step by step
Solved in 3 steps with 2 images
- Follow these steps:● Create a Python file called amazon.py in this folder.● Write code to read the content of the text file input.txt.● For each line in input.txt, write a new line in the new text file output.txtthat computes the answer to some operation on a list of numbers.● If the input.txt has the following:o Min: 1,2,3,5,6o Max: 1,2,3,5,6o Avg: 1,2,3,5,6● Your program should generate output.txt as follows:o The min of [1, 2, 3, 5, 6] is 1.o The max of [1, 2, 3, 5, 6] is 6.o The avg of [1, 2, 3, 5, 6] is 34Write a Python program to combine each line from the first file with the corresponding line in the second file and then save it in a 3rd file. Consider, both the files have same number of lines. Assume, each line has a newline(\n) at the end. ========================================================= Example:Input from file 1:HelloHiNice Input from file 2:BadWorseWorst Output in 3rd FIle:Hello BadHi WorseNice Worst ========================================================= Hint(1):Use the write() function what will be the answer of this in python programming languageRun a python program that will: a. Read a text file (input.txt) that contains two lines wherein the first line is a normal DNA sequence, while the second line is a mutated DNA sequence. b. The program must also transcribe and translate the sequences by providing outputs for their respective mRNA and protein products. *** input.txt *** ATGGTCAGAACGCGCTGAAATGGTTAGAACGCGCTGAC *** your.py *** Normal RNA Sequence: UACCAGUCUUGCGCGACUUMutated RNA Sequence: UACCAAUCUUGCGCGACUG Normal Protein Sequence: Try Gln Ser Cys Ala ThrMutated Protein Sequence: Try Gln Ser Cys Ala Thr
- Modify the program 11-10 from pages 753-755 as follows: 1. To Length class files (Length.h and Length.cpp) add the operator overload for stream insertion (<<) and stream extraction (>>) from page 759. You should not use the modified version of class Length from page 759 because it contains more operator overloads. Instead of typing you can use copy/paste from Length1.h and Length1.cpp respectively. 2. In main() replace the lines 11-16 with appropriate usage of stream extraction overload (>>) to change "first" and "second" objects with values inputted by the end user. 3. In main(), replace the output on lines 21,22 and 25,26 with appropriate usage of stream insertion (<<) operator. The resulting output should be identical with the unmodified version of the program. 11-10: // This program demonstrates the Length class's overloaded // +, -, ==, and < operators. #include <iostream> #include "Length.h" using namespace std; int main() { Length first(0),…USE PYTHON Before there were emoji, there were emoticonsLinks to an external site., whereby text like :) was a happy face and text like :( was a sad face. Nowadays, programs tend to convert emoticons to emoji automatically! In a file called faces.py, implement a function called convert that accepts a str as input and returns that same input with any :) converted to ? (otherwise known as a slightly smiling faceLinks to an external site.) and any :( converted to ? (otherwise known as a slightly frowning faceLinks to an external site.). All other text should be returned unchanged. Then, in that same file, implement a function called main that prompts the user for input, calls convert on that input, and prints the result. You’re welcome, but not required, to prompt the user explicitly, as by passing a str of your own as an argument to input. Be sure to call main at the bottom of your file. ( Please see attached file for Demo) use PYTHONOur requirement is to keep information of students who are taking “Introduction to Python” in Fall-2021 in a text file named ‘Students.txt’. The first line of text in this file will be header line as follows Write a python code that: Takes StudentID from user as input in a variable ‘inputID’, reads the file line by line and displays the header line and student information when inputID is found in Students.txt, otherwise display a message ‘Record not found in Students.txt’
- write program code in java: Write a program that reads two files “Data1.txt”, “Data2.txt”; Then add their corresponding elements and produce an output file “output.txt”. If the number of elements are not equal, fill the elements of the smaller file up with “0” s. Sample output: Elements of the “Data1.txt”: 3 5 7 8 9 Elements of the “Data2.txt”: 45 11 Elements of the “Output.txt”: 48 16 7 8Write a Python program in a .py file that includes the following: Program reads, formats and prints a restaurant menu from menu.txt (see at the bottom).Customer orders menu items by name or an assigned item number until a key word is entered such as "I'm Done" or "Exit".Customer order and net total is printed as output to a new text file. -----------------menu.txt-----------------Ham and Egg Sandwich $15.75Bacon and Cheese Plate $9.50Tuna Salad $12.30Beef Soup $9.00Spicy Beef Barbeque $20.00Pork Barbeque $18.00Oven Chicken Barbeque $15.00Pulled Beef Barbeque Burger $25.00House Salad $5.00Pellegrino $5.40White Wine $7.50Red Wine $11.00Trace the following Code and then print the output. msg db 'hello world$' newline db 10,13,'$' buffer db 10 dup mov ah,9 mov dx,offset msg int 21h ;new line mov ah,9 mov dx, offset newline int 21h ;enter a string from the keyboard lea dx,buffer mov ah,0ah int 21h ;new line mov ah,9 mov dx,offset newline int 21h ;adding the $ symbol at the end of the string mov bx,0 mov bl,buffer[1] mov buffer[bx+2],'$' mov ah,9 mov dx,offset buffer+2 int 21h
- Write a program to sort a list of numbers of unknown length. Your program must• read in a list (of unknown size) of numbers (think about types) from an input file namedinput.txt,• use a function, written by you, to sort the list in ascending order and• write the sorted list to an output file named output.txt.This question concerns the use of a book cypher to encode a message.Write a program called ‘bookcypher.py’ that accepts:1. The file name for a Project Gutenberg book text.2. A message that is to be encoded.3. A file name for output of the encoded version of the message.The program will create an encoded version of the message by replacing its words with the locationsof words in the book.Say, for example, the message is ‘meet me at the usual time and place’, and the Gutenberg text is‘The Importance of Being Earnest’ by Oscar Wilde.• There is an occurrence of ‘meet’ as the 5th word on the 493rd line of the book text.• There is an occurrence of ‘me’ as the 9th word on the 190th line of the text.• There is an occurrence of ‘at’ as the 6th word on the 8th line of the text.• And so on.Representing a word position as a conjunction of the line number and the index of the word withinthe line, we can encode the message as 493-5, 190-9, 8-6, etc.Sample I/O (user input in bold):Enter the book…1. Consider the following incomplete C++ program: #include int main() { … } a. Write a statement that includes the header files fstream, string, and iomanip in this program. b. Write statements that declare inFile to be an ifstream variable and outFile to be an ofstream variable. c. The program will read data from the file inData.txt and write output to the file outData.txt. Write statements to open both of these files, associate inFile with inData.txt, and associate outFile with outData.txt. d. Suppose that the file inData.txt contains the following data: Giselle Robinson Accounting 5600 5 30 450 9 75 1.5 The first line contains a person's first name, last name, and the department the person works in. In the second line, the first number represents the monthly gross salary, the bonus (as a percent), and the taxes (as a percent). The third line contains the distance traveled and the traveling time. The fourth line contains the number of coffee cups sold and the cost of each coffee cup. Write statements so that after the program executes, the contents of the file outData.txt are as shown below. If necessary, declare additional variables. Your statements should be general enough so that if the content of the input file changes and the program is run again (without editing and recompiling), it outputs the appropriate results. Name: Giselle Robinson, Department: Accounting Monthly Gross Salary: $5600.00, Monthly Bonus: 5.00, Taxes: 30.000 Paycheck: $4116.00 Distance Traveled 450.00 miles, Traveling Time: 9.00 hours Average Speed: 50.00 miles per hour Number of coffee Cups Sold: 75, Cost: $1.50 per cup Sales Amount = $112.50 e. Write statements that close the input and output files. f. Write a C++ program that tests the statements in parts a through e.