12.10 LAB: Sorting TV Shows (dictionaries and lists) Write a program that first reads in the name of an input file and then
Q: How can public facial recognition without consumer consent violate the ACM code of ethics and…
A: Today's world is more and more replete with facial recognition technology, which is used in…
Q: Make a class called takeout that stores someone's takeout order. The order should have a number and…
A: Handling and organizing takeout orders is a common task for restaurants and food delivery services.…
Q: Boot logs can be used to generate a list of drivers that were loaded during a normal startup and…
A: One of the common issues that computer users face is when their system fails to start up properly.…
Q: In the code below, what value of check will be displayed at the end? bool check=true;…
A: To state whether the given code returns true or false.
Q: The question of how information is sent between the many components of a web app is an important…
A: Web applications have become an integral part of our daily lives, with millions of users accessing…
Q: How do computer networks function, and what are their benefits? Can you list all network components?…
A: Computer networks are interconnected groups of computers, servers, and other networking devices that…
Q: As you create, consider the obstacles and solutions. Will cloud computing solve all our issues?…
A: Cloud computing has grown in popularity in recent years, and many businesses are shifting their…
Q: matlab errors as part..
A: There are two errors in the given code: The first error is a syntax error in the first line where…
Q: The surface area of a sphere of radius r is S = 4*pi*r^2. Its volume is V = (4/3)*pi*r^3. Use MATLAB…
A: The question asks to use MATLAB to find the expression dS/dV for a sphere and to use this result to…
Q: Wireless technology affects underdeveloped countries. Why are wireless networks being installed…
A: In recent times , there has been a significant increase in the adoption of wireless technology in…
Q: Storage configuration and rationale for optical medium. Explain how an optical storage media is read…
A: In contrast to magnetic storage devices like hard disc drives (HDDs) or solid-state drives (SSDs),…
Q: Virtualization will impact operating systems in several ways:
A: Introduction Virtualization technology has revolutionized the way computing resources are managed…
Q: Multiple packets may be transmitted over a host-to-host connection. Please outline the actions…
A: In computer networking, it is common to transmit data over a host-to-host connection in the form of…
Q: What logic block is used in writing to a register in the register file? Select an answer and submit.…
A: A register file is a collection of registers that may be read from or written to using precise…
Q: The OS mechanism allows operations to be performed without using all allocated memory.
A: In this question we have to understand and discuss on the OS mechanism allows operations to be…
Q: ** * Removes the specified key and its associated value from this symbol table * (if…
A: Here's the algorithm for the modified delete(Node x, Key key) method: If the current node is null,…
Q: Because of my interest in distributed computing, I've often thought about the logistics of process…
A: Changing Topics: Switching from one thread to another inside the same process is known as thread…
Q: Think about the benefits and drawbacks of adding a gateway to your network.
A: A gateway is a network gadget that interfaces at least two networks, permitting information to be…
Q: Answer the two questions on the images
A: Inheritance: In Java, inheritance is a mechanism that allows a class to inherit properties and…
Q: To what extent do discoveries in science and advances in technology influence one another, and how…
A: Science and technology are two intertwined domains that are constantly influencing one another.…
Q: Which digital privacy law act was implemented in 1986? A)computer fraud and abuse act B)financial…
A: A) Computer Fraud and Abuse Act (CFAA) - Implemented in 1986, the CFAA is a United States federal…
Q: Would you use a website with these features? Why?
A: Website: A collection of web pages and media over the internet is called a website. The website can…
Q: Create a deterministic state diagram which accepts all binary strings in the following set (and…
A: Sure, I can create a deterministic state diagram for this problem. Let's start by defining the 4…
Q: q2- What is the minimum number of bits in a PN sequence if we use Frequency Hopping Spread Spectrum…
A: Frequency Hopping Spread Spectrum (FHSS) is a wireless communication protocol that spreads the…
Q: How to find the minimum value, maximum value, and average while the text file in the c# program and…
A: To find the minimum value, maximum value, and average from a text file in a C# program, you can use…
Q: Which computer networks are most widespread in universities and colleges? How does this variety…
A: Computer networks have become an integral part of modern education, particularly in universities and…
Q: Faith in an email? How does information go from one location to another? Describe what you know. So…
A: In today's digital age, the transmission of information has become faster and more efficient than…
Q: Attributes with cardinality descriptions The company keeps track of each warehouse, inventory bin,…
A: An ER diagram is a graphical representation of the entities and their relationships with each other.…
Q: Explain the inner workings of the computerised neural network. Could you provide me any further…
A: A computerised neural network is a type of artificial intelligence that is designed to simulate the…
Q: How should we approach the myriad ethical issues raised by widespread use of digital technologies…
A: The widespread use of digital technologies such as computers, information networks, and the internet…
Q: import java.util.LinkedList; public class IntTree { private Node root; private static…
A: To implement the sizeAboveDepth method, use a recursive approach. Traverse the tree in a pre-order…
Q: Direct memory access (DMA) might boost system concurrency. How does this complicate hardware…
A: In this question we have to understand that Direct memory access (DMA) might boost system…
Q: In the future, technological development and progress will definitely quicken. - With the MIT…
A: The world is fast-moving towards the future of technological development and progress, and the…
Q: Write a Java program that expands a given binomial (x + y)^n, where integer n is user input. To do…
A: Dear learner, hope you are doing well, I will try my best to answer this question. Thank You!!
Q: python code
A: in the following section we will write python program to declare an abstract class called Player. In…
Q: I'm missing anything, please explain the significance of developing a challenge-response…
A: Challenge-response authentication systems are designed to provide a more secure way of verifying the…
Q: Please suggest ways to make multinational firms' websites more accessible to international users.
A: In this question we have to understand and suggest ways to make multinational firms' websites more…
Q: Please help write this. In Java, You will create a class called CoinTest. It represents the…
A: Java is a popular, general-purpose, object-oriented programming language that is designed to be…
Q: Write a stored procedure called sp_apply_discount() that will apply percent discount to books in a…
A: Database: An organized group of data that can be electronically stored and retrieved is…
Q: Track down the mistake/s in the accompanying code, feature and compose the right code. MATLAB n = 5;…
A: There is a colon (:) after the assignment of the variable A. This is not necessary and will…
Q: It is essential to comprehend how information moves through a web app
A: Web applications have become an integral part of our daily lives, providing us with a vast range of…
Q: Use "Object-Orientation"? Object-oriented software design.
A: Object-oriented software design is a popular approach to software development that emphasizes the…
Q: Can the inner workings of a computer be described using this? After that, I anticipate that we will…
A: Computers are become a necessary component of our lives. Life, from basic chores like checking…
Q: Which VLAN is intended to provide administrative access to network devices?
A: The Answer and detailed explanation are provided below. Please check.
Q: Explain the distinctions between EPROM, EEPROM, and Flash Memory and provide your own definitions of…
A: EPROM, EEPROM, and Flash memory are three types of non-volatile memory that are commonly used in…
Q: Explain what a Web app consists of and how information moves through it.
A: A web application (web app) is an application program that is stored on a remote server and…
Q: Write a program that will undertake a range search of all elements lying within limits a, b along a…
A: To implement a range search in a k-d tree, we can follow the following steps: begin at the tree's…
Q: How do I back up my Windows 10 PC, and what are the main benefits of doing so?
A: Windows 10, the successor to Windows 7 and 8.1, is the most recent version of the Windows operating…
Q: ed to enter this capability in matlab. This is my code: syms f(x) syms m x b = ((2*m)+1)^2; c =…
A: The error message "too many input arguments" is occurring because you are using the function pi with…
Q: The data stored in a computer's programmed read-only memory (PROM) cannot be changed after it has…
A: PROMs features a series of memory cell that where a binary code (either it is 0 or 1) or it may be…
12.10 LAB: Sorting TV Shows (dictionaries and lists)
Write a
Sort the dictionary by key (greatest to least) and output the results to a file named output_keys.txt. Separate multiple TV shows associated with the same key with a semicolon (;), ordering by appearance in the input file. Next, sort the dictionary by values (in reverse alphabetical order), and output the results to a file named output_titles.txt.
Ex: If the input is:
file1.txtand the contents of file1.txt are:
20 Gunsmoke 30 The Simpsons 10 Will & Grace 14 Dallas 20 Law & Order 12 Murder, She Wrotethe file output_keys.txt should contain:
30: The Simpsons 20: Gunsmoke; Law & Order 14: Dallas 12: Murder, She Wrote 10: Will & Graceand the file output_titles.txt should contain:
Will & Grace The Simpsons Murder, She Wrote Law & Order Gunsmoke DallasNote: End each output file with a newline, and file1.txt is available to download.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 5 images
- 6.28 In Python, Write a program that replaces words in a sentence. The input begins with word replacement pairs (original and replacement). The next line of input is the sentence where any word on the original list is replaced. Ex: If the input is: automobile car manufacturer maker children kids The automobile manufacturer recommends car seats for children if the automobile doesn't already have one. the output is: The car maker recommends car seats for kids if the car doesn't already have one. You can assume the original words are unique.12.12 LAB: File name change A photographer is organizing a photo collection about the national parks in the US and would like to annotate the information about each of the photos into a separate set of files. Write a program that reads the name of a text file containing a list of photo file names. The program then reads the photo file names from the text file, replaces the "_photo.jpg" portion of the file names with "_info.txt", and outputs the modified file names. Assume the unchanged portion of the photo file names contains only letters and numbers, and the text file stores one photo file name per line. If the text file is empty, the program produces no output. Ex: If the input of the program is:12.12 LAB: File name change A photographer is organizing a photo collection about the national parks in the US and would like to annotate the information about each of the photos into a separate set of files. Write a program that reads the name of a text file containing a list of photo file names. The program then reads the photo file names from the text file, replaces the "_photo.jpg" portion of the file names with "_info.txt", and outputs the modified file names. Assume the unchanged portion of the photo file names contains only letters and numbers, and the text file stores one photo file name per line. If the text file is empty, the program produces no output. Ex: If the input of the program is: ParkPhotos.txt and the contents of ParkPhotos.txt are: Acadia2003_photo.jpg AmericanSamoa1989_photo.jpg BlackCanyonoftheGunnison1983_photo.jpg CarlsbadCaverns2010_photo.jpg CraterLake1996_photo.jpg GrandCanyon1996_photo.jpg IndianaDunes1987_photo.jpg LakeClark2009_photo.jpg…
- 11.17 (Bucket Sort) Use Python. Show the whole code input and output when done. A bucket sort begins with a one-dimensional array of positive integers to be sorted and a two-dimensional array of integers with rows indexed from 0 to 9 and columns indexed from 0 to n – 1, where n is the number of values to be sorted. Each row of the two-dimensional array is referred to as a bucket. Write a class named BucketSort containing a function called sort that operates as follows: a) Place each value of the one-dimensional array into a row of the bucket array, based on the value’s “ones” (rightmost) digit. For example, 97 is placed in row 7, 3 is placed in row 3, and 100 is placed in row 0. This procedure is called a distribution pass. b) Loop through the bucket array row by row, and copy the values back to the original array. This procedure is called a gathering pass. The new order of the preceding values in the one-dimensional array is 100, 3 and 97. c) Repeat this process for each subsequent…8.7 LAB: File name change A photographer is organizing a photo collection about the national parks in the US and would like to annotate the information about each of the photos into a separate set of files. Write a program that reads the name of a text file containing a list of photo file names. The program then reads the photo file names from the text file, replaces the "_photo.jpg" portion of the file names with "_info.txt", and outputs the modified file names. Assume the unchanged portion of the photo file names contains only letters and numbers, and the text file stores one photo file name per line. If the text file is empty, the program produces no output. Ex: If the input of the program is: ParkPhotos.txt and the contents of ParkPhotos.txt are: Acadia2003_photo.jpg AmericanSamoa1989_photo.jpg BlackCanyonoftheGunnison1983_photo.jpg CarlsbadCaverns2010_photo.jpg CraterLake1996_photo.jpg GrandCanyon1996_photo.jpg IndianaDunes1987_photo.jpg LakeClark2009_photo.jpg…22.3 LAB: Remove all even numbers from a list (Use Python) Write the remove_evens() function, which receives a list of integers as a parameter and returns a new list of integers containing only the odd numbers from the original list. The main program outputs values of the returned list. Hint: If the original list has even numbers, then the new list will be smaller in length than the original list and should have no blank elements. Ex: If the list passed to the remove_evens() function is [1, 2, 3, 4, 5, 6, 7, 8, 9], then the function returns and the program output is: [1, 3, 5, 7, 9] Ex: If the list passed to the remove_evens() function is [1, 9, 3], then the function returns and the program output is: [1, 9, 3]
- 5.18 C++ Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicating the number of integers that follow. For coding simplicity, follow each output integer by a comma, including the last one. Ex: If the input is: 5 2 4 6 8 10 the output is: 10,8,6,4,2,5.23 C++ Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. The output of the program is every word in the list that contains the character at least once. For coding simplicity, follow each output word by a comma, even the last one. Add a newline to the end of the last output. Assume at least one word in the list will contain the given character. Ex: If the input is: 4 hello zoo sleep drizzle z then the output is: zoo,drizzle, To achieve the above, first read the list into a vector. Keep in mind that the character 'a' is not equal to the character 'A'.Exercise 20 the string below comes from an alphabet consisting of only characters A and B. Accordingly, write the full code of the program (Use the given space below the question. If you struggle to fit into the space then upload a file) that prints the permutation list that can be formed with the characters A or B, which can replace the question marks, into a text file. (Hint: give a go to recursion) A?AA?BB?A? The output will be like the list below: ABAABBBBAB ABAABBBBAA ABAABBBAAB ABAABBBAAA ABAAABBBAB ABAAABBBAA ABAAABBAAB ABAAABBAAA AAAABBBBAB AAAABBBBAA AAAABBBAAB AAAABBBAAA AAAAABBBAB AAAAABBBAA AAAAABBAAB AAAAABBAAA
- 10-8. Cats and Dogs: Make two files, cats.txt and dogs.txt. Store at least three names of cats in the first file and three names of dogs in the second file. Write a program that tries to read these files and print the contents of the file to the screen. Wrap your code in a try-except block to catch the FileNotFound error, and print a friendly message if a file is missing. Temporarily rename each of your files, and make sure the code in the except block executes properly. Make sure an exception is caught for either file missing.8.26 LAB: Word frequencies (dictionaries) Implement the build_dictionary() function to build a word frequency dictionary from a list of words. Ex: If the words list is: ["hey", "hi", "Mark", "hi", "mark"] the dictionary returned from calling build_dictionary(words) is: {'hey': 1, 'hi': 2, 'Mark': 1, 'mark': 1} Ex: If the words list is: ["zyBooks", "now", "zyBooks", "later", "zyBooks", "forever"] the dictionary returned from calling build_dictionary(words) is: {'zyBooks': 3, 'now': 1, 'later': 1, 'forever': 1} The main code builds the word list from an input string, calls build_dictionary() to build the dictionary, and displays the dictionary sorted by key value. Ex: If the input is: hey hi Mark hi mark the output is: Mark: 1 hey: 1 hi: 2 mark: 1 Use Python, please.5.12.2: Switch statement to convert letters to Greek letters. Write a switch statement that checks origLetter. If 'a' or 'A', print "Alpha". If 'b' or 'B', print "Beta". For any other character, print "Unknown". Use fall-through as appropriate. End with newline. import java.util.Scanner; public class ConvertToGreek {public static void main (String [] args) {Scanner scnr = new Scanner(System.in);char origLetter; origLetter = scnr.next().charAt(0); /* Your solution goes here */ }}