Parallel Programming It is vaccine season! COVID19 vaccines are out, and everyone is rushing to get one. Vaccines are available from six different brands and you have been entrusted to write a program to count the total number of vaccines of each brand administered across 21 cities in the state. Write a multithreaded program (in the file vaccines.cpp) that counts the number of vaccines in 21 different files of numbers. Each line in each of the files will contain either one of the following brand names: v1, v2, v3. Your program must count the number of units for each vaccine brand administered, across all 21 cities, and display the total number of units for each brand. The files are named "city1.txt", "city2.txt", and " city21.txt".
Q: Code should be in Python. Write a program that first reads in the name of an input file and then…
A: Step 1 The answer is given in the below step
Q: Ex: If the input of the program is: educate c the program opens the file educate.txt, which…
A: The synonym of a word can be denoted as another word that has the same meaning as the word. The code…
Q: Write a program to create two files with the names file4.txt and file4a.txt two 10 element int…
A: Given:- Write a program to createtwo files with the names file4.txt and file4a.txt two 10 element…
Q: #7 - program that readsthe file named randomPeople.txt sort all the names alphabetically by last…
A: The code for the program is given below
Q: 3. Write a program that reads (up to 100) temperature values from a file called input.txt. Read the…
A: Algorithm : MaxMin function : Step 1 : declare and initialize the variables. Step 2 : open the…
Q: PYTHON-Assume you have a file that has two columns separated by a comma. The first column contains…
A: 1.open file 2. Read file 3.Read it line by line 4.split the line by "," 5.make a dictionary and…
Q: In python please Lab: Faculty Salaries 1. Create a data file, called salary.txt, with 100 lines.…
A: Given: In python please Lab: Faculty Salaries 1. Create a data file, called salary.txt, with 100…
Q: Write a program that reads the student information from a comma separated values (csv) file. The…
A: Required:
Q: A photographer is organizing a photo collection about the national parks in the US and would like to…
A: To write a program in java for replacing the _photo.jpg with _info.txt in the file names mentioned…
Q: Lab: Faculty Salaries 1. Create a data file, called salary.txt, with 100 lines. 2. Each line in…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: num.txt is a file that contains a list of scores. num.txt 10 25 36 45 89 42 54 create a program that…
A: Solution- Programming language - Python All necessary comments are included in program code.…
Q: C++ A teacher is requiring her students to line up in alphabetical order, according to their first…
A: I will explain it in details,
Q: 6. Write a program that reads (up to 100) temperature values from a file called input.txt. Read the…
A: Required:
Q: Write a program that will read in a file of student academic credit data and create a list of…
A: The Java program is written where it takes the input student file and add the GPA function to the…
Q: Write a program that allows the user to navigate the lines of text in a file. The program should…
A: Python Code: #accepting file name (name=input("Enter the input file name:") #printing newline…
Q: Exercise 2: File manipulation Assume that we have a first file called French.txt enclosing the…
A: C++ program to display the translated French words and their equivalent words. Create a file named…
Q: Write a program that reads the student information from a tab separated values (tsv) file. The…
A: In the given version of code, code is not properly indented. and content of list sg is like…
Q: 6. File Analysis Write a program that reads the contents of two text files and compares them in the…
A: Note : Answering in python as no programming language is mentioned. Task : Read two text files.…
Q: Exercise 2 Write a Program that reads integers from a file called "input.dat" (Figure 1) that…
A: Provided the Python program with appropriate comments and as per requirements given in above…
Q: 1.In a loop, fill an array for up to 50 even numbers and a set for up to 50 odd numbers. Use the…
A: Objective: This program includes a loop to fill an array for up to 50 even numbers and a set up to…
Q: Write a program that reads the student information from a tab separated values (tsv) file. The…
A: The answer given as below:
Q: Q. Write a python program that creates an excel file containing Student Record: Roll No.,Name, Marks…
A: GIVEN: A python program that creates an excel file containing Student Record:Roll No.,Name, Marks…
Q: Write a program that findsall prime numbers up to 10,000,000,000. There are approximately455,052,511…
A: Since programming language is not mentioned in the question, we will answer this question in the…
Q: A photographer is organizing a photo collection about the national parks in the US and would like to…
A: Ans:) NOTE: I am solving this problem in python as no programming language is mentioned. Approach:…
Q: PYTHON!!!! Write a program that allows the user to navigate the lines of text in a file. The…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: file contains a list of telephone number in following form. Aman 23456 Raj…
A: Note: We are authorized to answer one problem at a time since you have not mentioned which one you…
Q: Word Puzzle Game In this assignment is only for individual. You are going to decode the scrambled…
A: package com; import java.util.ArrayList;import java.util.Scanner;import java.io.File;import…
Q: ting Write a program that first reads in the name of an input file and then reads the input file…
A: Required: python
Q: A file contains a list of telephone number in following form. Aman 23456 Raj…
A: #include <bits/stdc++.h>using namespace std;int main(){ fstream my_file;…
Q: Python programming language Write a program that asks the user for a number. Write the number…
A: Given: Python programming language Write a program that asks the user for a number. Write the…
Q: 2. Extend the gpasort program so that it allows the user to sort a file of students based on GPA,…
A: The above program is solved using Python below:
Q: Problem Description: In this program, you will implement a Pig Latin converter that reads lines from…
A: def isValidWord(sent): consonant = ('B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q',…
Q: Code should be in Python Write a program that first reads in the name of an input file, followed by…
A: print("Input")filename = input()lower = input()upper = input() fin = open('input1.txt', 'r')Lines =…
Q: A file contains a list of telephone number in following form. Aman 23456 Raj 567854…
A: Note: As per the guidelines, can answer the first section. Please re-submit the question for other…
Q: In Java A comma separated value (.csv) file has been included to be used for this program. Each…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: 6. Write a program that will randomly generate 500 integer numbers in the range -249 to 250. Write…
A: Write a program that will randomly generate 500 integer numbers in the range -249 to 250. Write…
Q: Given a text file containing the availability of food items, write a program that reads the…
A: Code Screenshot :
Q: In Java Oleae nust read a file A photographer is organizing a photo collection about the national…
A: Actually, Java is a general-purpose also class-based, object-oriented programming language designed…
Q: The program takes a single argument as the name of the file to be read. A sample file is named…
A: /****************************************************************************** Welcome to GDB…
Q: WAP to read 4 student objects and write them into a file, then print total number of student number…
A: The code is written below: #include<iostream> #include<fstream> using namespace std;…
Q: ode in Python Write a program that inputs a text file. The program should print the unique words…
A: the program is an given below : #Prompt the user to enter the file name. file_name = input("Enter…
Q: Write a python program that will ask the user for their grocery list, one item at a time, and will…
A: Answer:
Q: 1. Create a file that contains 20 integers or download the attached file…
A: The C++ program and approach are given below:Approach: -Declaring the essential headers.Declaring…
Q: 2. This involves a .txt file with one thousand rows of random numbers (between 1-1000) Using…
A: 1. File Input/OutputFile Input/Ouput (IO) requires 3 steps: Open the file for read or write or…
Q: Each line of a hockey file contains a four-digit year, a team name, and a two-digit number of wins.…
A: - We need to code the team problem. - We have to use python here.
Q: (PYTHON) A photographer is organizing a photo collection about the national parks in the US and…
A: Procedure- for this python provide open() method to open a file. then we remove the unwanted space…
Q: The objective of this question is to generate and read files that contain a list of random numbers.…
A: Python code: import random import time # Function to fill random values in a file def…
Q: A photographer is organizing a photo collection about the national parks in the US and would like to…
A: The Answer start from step-2.
Q: reads in a file of student academic credit data. Each line of the input file will contain the…
A: Programming is instructing a computer to do something for you with the help of a programming…
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images
- PHONE DIRECTORYDescription: Create a phonebook directory that will store the contact numbers of N persons. Your program should allow the user to add, view, delete, and update the contacts in the phonebook. Note that one person can have multiple contact numbers. The program will stop when the user command is ‘X’. Program command and entry should not be case-sensitive. That means commands ‘I’ or ‘i’ and the name “Jacky” or “JACKY” are the same. Each contact number can be 7 digits or 11 digits only. The user should input a string containing the command, name, and contact number(s) (Limit the contact number of each person to three). This string should be broken down into fields in order to separate the different values and store them in their appropriate variables. Use linked list in the implementation. Your node must declare at least four instance variables. Program flow: Command> I Jacky 09211234567 Remarks: New contact has been added. Command> V Jacky Contact…You are to create a database of books that are stored using a vector. Keep track of the author, title and publication date of each book. Your program should have a main menu that allows the user to select from the following: Add a book’s author, title, and date Print an alphabetical list of the books sorted by author Quit You must use a class to hold the data for each book. This class must hold three string fields, one to hold the author’s name, one for the publication date, and another to hold the book’s title. Store the entire database of books in a vector where each vector element is a book class object. To sort the data, use the generic sort function from the <algorithm> library. Note that this requires you to define the <operator to compare two objects of type book so that the author field from the two books are compared. Note: you are required to create three files, Book.h, Book.cpp and TestProgram.cpp. Book.h #ifndef BOOK_H #define BOOK_H #include <string>…# Create Custom Transformer Create a custom transformer, just as we did in the lecture video entitled "Custom Transformers", that performs two computations: 1. Adds an attribute to the end of the numerical data (i.e. new last column) that is equal to $\frac{x_1^3}{x_5}$ for each observation. In other words, for each instance, you will cube the $x_1$ column and then divide by the $x_5$ column. 2. Drops the entire $x_4$ feature column if the passed function argument `drop_x4` is `True` and doesn't drop the column if `drop_x4` is `False`. (See further instructions below.) You must name your custom transformer class `Assignment4Transformer`. Your class should include an input parameter called `drop_x4` with a default value of `True` that deletes the $x_4$ feature column when its value is `True`, but preserves the $x_4$ feature column when you pass a value of `False`. This transformer will be used in a pipeline. In that pipeline, an imputer will be run *before* this transformer. Keep…
- astfoodStats Assignment Description For this assignment, name your R file fastfoodStats.R For all questions you should load tidyverse, openintro, and lm.beta. You should not need to use any other libraries. suppressPackageStartupMessages(library(tidyverse)) suppressPackageStartupMessages(library(openintro)) suppressPackageStartupMessages(library(lm.beta)) The actual data set is called fastfood. Continue to use %>% for the pipe. CodeGrade does not support the new pipe. Round all float/dbl values to two decimal places. All statistics should be run with variables in the order I state E.g., "Run a regression predicting mileage from mpg, make, and type" would be: lm(mileage ~ mpg + make + type...) To access the fastfood data, run the following: fastfood <- openintro::fastfood Create a correlation matrix for the relations between calories, total_fat, sugar, and calcium for all items at Sonic, Subway, and Taco Bell, omitting missing values with na.omit(). Assign the…Binus’s Used Cars, Inc. employs several salespeople. Mr. Robert, the owner of the company, has provided a file that contains sales records for each salesperson for the past month. Each record in the file contains the following two fields: The salesperson’s ID number, as an integer The amount of a sale, as a real number The records are already sorted by salesperson ID. Brewster wants you to design a program that prints a sales report. The report should show each salesperson’s sales and the total sales for that salesperson. The report should also show the total sales for all salespeople for the month. Here is an example of how the sales report should appear:The 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, 1987
- We’ve been updating and extending the inventory project to use files and to use arrays. Now it’s time to put it all together. I will give you a file inventory.txt File Contents: Red delicious apples 1.00 25 6 8 10 Assorted bouquets 4.00 50 10 10 0 Camembert cheese 2.00 25 10 12 4 END The file will have the following specifications: Each record consists of two lines. The first line contains the name of the product, which may be more than one word long. The second line contains the wholesale price as a decimal, the markup as a percentage, and three quantities, for counter, shelf, and warehouse. If the first line of a record contains the word END all by itself, that is the end of the file. Your task is to read each record into the program, as a string for the name, and numbers for the price and markup, and as an array of numbers for the quantities. Then calculate the total profit for each item: (wholesale price) * (markup, converted into a decimal) * (total quantity). Print out a report…A temperature file consists of five records, each containing a temperature in degrees Fahrenheit. A program is to be written that will read the input temperature, convert it from degrees Fahrenheit to degrees Celsius and print both temperatures in two columns on a report. Column headings, which read ‘Degrees F’ and ‘Degrees C’, are to be printed at the top of the page. What ist he best solution algorithm to successfully implement the above question?Frames Unlimited is a wholesaler that specializes in picture frames. The company stores its product information (each item’s number, name, size and price) in a sequential access file named pictureFrame.txt. You need to create a report using the pictureFrame.txt sequential access file. The report should contain a list of all picture frames with a size of 5×7. The report will be saved to another sequential access file named pictureFrame57.txt. Your first step is to ____. a. determine whether the pictureFrame.txt file exists b. declare a StreamReader variable for the input file c. open the pictureFrame.txt file for input using the OpenText method d. open the pictureFrame57.txt file for output using the CreateText method
- A Company wants to produce a product orders report from its product orders file. Each record on the file contains the product number of the item ordered, the product description, the number of units ordered, the retail price per unit, the freight charges per unit, and the packaging costs per unit. Your algorithm is to read the product orders file, calculate the total amount due for each product ordered and print these details on the product orders report. The amount due for each product is calculated as the product of the number of units ordered and the retail price of the unit. A discount of 10% is allowed on the amount due for all orders over GHC100.00. The freight charges and packaging costs per unit must be added to this resulting value to determine the total amount due. Answer should be in pseudo codeA MyPetStore sells many pets and their accessories. As new pets are added to the MyPetStore, theirinformation is entered into a flat text file. Each month, the manager requests a listing of all pets sorted bytheir price. You must write a program to produce a report of MyPetStore and their types sorted by their pricesfrom the data in the flat text file. Below is a description of the information on the text file:• The first entry is the number of animals on the file (numeric) •The fields below repeat for each animal:o Pet name (String)o Birthdate (java.time.LocalDate)o Price (numeric)o Species Type (String)o Special feature (boolean or String)The animals sold by the MyPetStore are of six types: Dogs & Cats, Reptiles, Birds, Rabbits & SmallAnimals.For Dogs & Cats, the special feature field on the flat file is the breed of the animal (String).For Reptiles, the special feature field is the blood type (warm vs cold-blooded, String).For Birds, the special feature field is the…Using visual studio 2019 and using c# programming Create a WPF app that will take a value n from the user, representing a side of a square matrix. Your program will generate an n x n char matrix. The chars’ values are randomly generated. This matrix will be printed into a text file. Suppose the data that is contained in the text file is as follows. s d k w e a e r e q j g e u c n t q a d s w a s f w t n The user must be able to provide a string to your app and your app will verify that the string exists in the generated matrix. For example, suppose the user wants to see if qwerty is in the matrix. The user provides qwerty to your system, and they are informed it doesn’t exist in there! What if the user provides aereq? Well, the user will be informed the string exists. I will only be testing in the vertical (going down) and horizontal (going right to left) directions. Please explain your algorithms for this part