Computer Ścience The language used here is C++ Develop a C program that processes a file called "grades.txt" containing a list of student grades and outputs the minimum, maximum, and average grade contained within that file. Your program should make use of the following function prototype: void grades(FILE *inp, int *p_min, int *p_max, float *p_ave); Sample Output: Input File: 2 3 9 10 15 17 25 30 40 45 78 81 90 Output: Min: 2, Max: 90, Ave: 34.23
Q: Answer must be in Java. Design an experiment (i.e., design and write programs and take measurements)...
A:
Q: The task is to implement density estimation using the K-NN method. Obtain an iid sample of N ≥ 1 poi...
A: The task is to implement density estimation using the K-NN method. Obtain an iidsample of N ≥ 1 poin...
Q: 9. Construct a logic circuit that implements a 2-bit, 4-function ALU that has oper- ations ADD, AND,...
A: An arithmetic logic unit is a multi-operation, combinational logic function. It can perform a set of...
Q: .Attach the most updated sprint backlog(of a booking system).
A: Sprint backlog is the plan by and for the developer. It is a real-time picture of the design/work th...
Q: Write down a simple code for stroing studnet data in a link list. You must be able to search the rec...
A: A palindrome is the string that is read from the front and back are read as the same. Program explan...
Q: Write the flowchart and alogorithm relate to below C++ code // C++ program to illustrate Saddle poin...
A: C++ is a procedural as well as object-oriented programming language consisting of class objects and ...
Q: 11. In this problem you need to simulate part of a Yahtzee game. This turns out to be more complicat...
A: Solution:-- 1)The given question has required for the solution to be provided with the help of the...
Q: Part 2 1. Design an algorithm to test whether there is at least one common element between two sets ...
A: Due to company policies I am compelled to solve only 1 question and that is the first question. Plea...
Q: Nhy do we utilise MATLAB to solve difficulties in Computational Geometry?
A: Introduction: In business and academia, MATLAB is used by millions of engineers and scientists for d...
Q: An HMM automatic speech recognition (ASR) system consists of 3 models. Identify and briefly explain ...
A: An HMM automatic speech recognition (ASR) system consists of 3 models are:- the lexicon the acousti...
Q: Write a method that calculates and prints both the maximum humidity and maximum temperature values f...
A: the answer is given below:-
Q: ?Fill in the blanks with the adjective derived from each of the following countrie Australia .1 Ital...
A: Note: As per our company guidelines we are supposed to answer only first 3 sub-parts. Kindly repost ...
Q: Explain the reason why there is a difference between protecting against these two different sources ...
A: HMAC stands for Hash-Based Message Authentication Code. It uses a cryptographic hash function and a ...
Q: In Java please,
A: Program is given below:-
Q: When you use GRETL, how do you run a model for a generalised least squares guess?
A: INTRODUCTION: GRETL is an open-source statistics tool that focuses on econometrics. For example, GN...
Q: S b) concurrency contro in DBMS c) importance of concurrency control
A: given - a) transaction in DBMS b) concurrency contro in DBMS c) importance of concurrency contro
Q: OEVO a. List all symbols and their probabilities b. Find the Huffman tree and codeword for each c. L...
A:
Q: 10. K= { a | k=n² and n2l }
A: Proved the given language non regular using the pumping lemma
Q: 2. Find the ring! by CodeChum Admin Thanks to you, my crush was impressed with my awesome display()...
A: PROGRAM INTRODUCTION: Include the required header files. Start the definition of the function to fi...
Q: What is the meaning of the “$” symbol at the end of the managed service account(MSA)? MSA does not ...
A: Correct option is a.
Q: Create a java program that generates elements (randomly from 10 – 75) of a 2-dimensional array (5x5)...
A: import java.util.Random; public class Main { //driver class public static void main(String[...
Q: Clustering and classification are two different things. What is the difference between them?
A: Defined the difference between Clustering and classification
Q: Draw the logical diagram of a 2-line to 4 - line decoder using NOR gates only.
A: NOR gate in the digital electronics is the gate which is a NOT-OR gate, It is a logic gate which hel...
Q: Algorithms are important to know if you want to use computers to invest in the financial market.
A: Solution: Since the role of human in commerce has diminished quickly. In their place take the comput...
Q: The goal of this assignment is to solve problems that involve flow of control with conditional state...
A: Here, I have to provide a C++ solution to the above question.
Q: ## Вeef ## Pork Yes No Total ## Yes 75 492 567 #2# No 441 8827 9268 ## Total 516 9319 9835
A: 1. The following table contains data from the arGroceries data set found in the Lecture 2 Examples. ...
Q: PROBLEM 4 ( ) Show that there is no formal proof of p → qF p.
A: Given that p -> q |- p
Q: Create a soda beverage shopping cart program using C++ implementing the following: Linked List - thi...
A: The code is a c++ implementation of a simple soda machine which uses several datatypes to store diff...
Q: Compare bandwidth and throughput.
A: Following is the comparison of bandwidth and throughput: Bandwidth is the theoretical delivery of th...
Q: In Java please,
A: CODE- import java.io.File;import java.io.IOException;import java.util.Scanner; public class CheckAva...
Q: PYTHON, write a code that allows the user to input two non-negative number sequences in increasing o...
A: Input : m = 10, n = 4 Output : 4 There should be n elements and value of last element should be at-m...
Q: 12.a. How does a two-fiber BLSR network stay online if the work fiber in a span fails? A. Span switc...
A: 12.a. How does a two-fiber BLSR network stay online if the work fiber in a span fails?A. Span switch...
Q: Sum of Digits EXAMPLE: INPUT Given a non-negative integer N with an arbitrary m number of digits, dr...
A: As per the requirement flowchart is drawn.
Q: Create a program where 10 'worker' threads are created. Set all of the worker threads to block on th...
A: Lets see the solution.
Q: technologies, which do you consider the most appropriate nowadays? Elaborate on your answer.
A: given - Among the wireless medium technologies, which do you consider the most appropriate nowadays?...
Q: Design and implement a getLastHalf() method for the MyLinkedList class. The method should return the...
A: Program Explanation: Define a class for implementing the linked list Define a static class for no...
Q: 1. Consider the following P = {P1, P2, P3, P4, P5} R = {R1, R2, R3, R4} E = (P3→R1, P2→R2, R4→P4, R2...
A: 1 (a) ,
Q: to solve this problem, I only need the code since I already made the connection of the circuit "It ...
A: the program is an given below :
Q: Given input space X = {0,1}³, and output set Y = {a,b, c, d}. How many different hypothesis %3D (map...
A: given X={0,1} and Y={a,b,c,d}
Q: 18.a. What's the transceiver optical budget in a 100Base-FX Ethernet network? A. –20 dBm B. 11 dB C....
A: Defined the transceiver optical budget in a 100Base-FX Ethernet network and cable links span in the ...
Q: C++ Programming Exercise 2 #3 Name your C++ source code file: C++PE2-3.cpp (user’s age) Write th...
A: C++ Programming Exercise 2 #3 Name your C++ source code file: C++PE2-3.cpp (user’s age) Write th...
Q: Write a public statie method that takes a 2-dim array of fioats and returns the the row that has the...
A: The answer is givwen below:-
Q: QI Write program in fortran to find the maximum number of (x,y,z)?
A: Fortran is suited for numeric computation and scientific computing. It was originally developed by I...
Q: TCP appears as a continuous byte stream to processes running at the application level. Explain the ...
A: The factors that TCP uses to make decisions about how to break the stream of bytes supplied to it ar...
Q: Write a MIPS ass
A: Given Write a MIPS assembly instruction used to invoke a procedure called "sum"?
Q: estion :) ite a MIPS assembly program that computes an employee's monthly salary. The program should...
A: Solution: We can use the MARS simulator to write a MIPS assembly program. A MIPS assembly program is...
Q: In what ways can constellations be useful to people? Give two examples.
A: NOTE :- Below i explain the answer in my own words by which you understand it well. constellati...
Q: Determine whether the following argument is valid or invalid. Include a truth table and a few words ...
A: Here, I have to provide a solution to the above question.
Q: Please help I’m not sure what to do I’ve done it over and over and it keep giving me an errors
A: Logic:- within input pass message which you want to show while taking input. Within print pass mes...
Q: A U (B n C) = (A U B) n (A U C)
A: Given :- Prove the following equivalence using VENN DIAGRAMS
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images
- //The language is c++,by using this psudo code, creat a function that will compute the probability of each word appearing in the text file. #include <vector>#include <string>#include <iostream>//SRP//Every program when become a process//A running program is a process std::vector<std::string> tokenize(std::string& line){std::vector<std::string> toks;//...... Your code here//......// .....return toks; } std::vector<std::string> read_file(std::string& filename){std::vector<std::string> lines;// ..... Your code here// .....// .....return lines;} // this is my car// ["this", "is", "my", "car"]void histgram(std::vector<std::string>& tok, std::map<std::string, int>& mp){} std::map<std::string, int> histgram(std::string& filename) { std::vector<std::string> lines = read_file(filename);std::map<std::string, int> mp;for (auto line : lines) {std::vector<std::string> toks = tokenize(line);for (auto…Write a function IN C LANGUAGE that splits the following data read from a file named info.txt and store the data into a struct as show in the example: typedef struct{char name[20];char gender[5];char dateOfAdmission[20];char dateOfBirth [20];char illness [20];char address [20];char bloodType[5]; } information; Abed Mukhles#M#2212019#01012000#Ear Infection#Jenin#O+ Here the values are: name:Abed Mukhles gender:M dateOfAdmission:2212019dateOfBirth:01012000illness:Ear Infectionaddress:JeninbloodType:O+ Same for:Nadia A. Ali#F#01102020#05101970#COVID-19#AlBireh#A-Implement in C Programming 9.7.1: LAB: Course Grade 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. Assume the file name has a maximum of 25 characters. Open the tsv file and read the student information. Assume each last name or first name has a maximum of 25 characters. 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…
- Write a void function that will merge the contents of two text files containing the chemical elements into a single binary file. The function's parameters will be three file pointers; each text file will contain an integer atomic number followed by the element name, chemical symbol and atomic weight. Here are two sample lines: 11 Sodium Na 22.9920 Calcium Ca 40.08 The function can assume that one file does not two copies of the same elements and that the binary output file should have the same property. IN C PLEASEWrite a function that takes (i) a FILE pointer (e.g. FILE *fp) type variable, (ii) an array of student struct (that you defined in the previous question), and (iii) the number of valid elements in that array as parameters, and write those elements in a file named "students.dat". This function should return 1 if it can successfully open this file; otherwise, it should return 0.Please use C language(a) Write a C function readNums() that takes a filename and an integer array, reads the integer numbers in the file and stores into the array, returns the number of numbers stored in the array. Assume that the file only contains integer numbers, and nothing else. Prototype: int readNums(char filename[], int arr[]); (b) Write a C function delWordN() that takes a string and an integer (n) as parameter, removes from the string the words that are n character long. A word is a group of consecutive alphanumeric characters; words are separated by non-alphanumeric characters. ps: please do not copy paste from chegg or anywhere else. write unique code
- In C++ Write a program that simulates a Magic 8-Ball. Prompt the user for a question, and randomly select a response from a vector. The attached Responses file is available if you want to use it, OR you may create your own response file, OR you can add/modify/remove the responses in the attached file. Continue to prompt for questions until the user wants to exit the program (Pick your own exit condition, but the program must loop until the condition is met!). Additional requirements: Header comments must be present Prototypes must be present if functions are used Hello and goodbye messages must be shown Use vector(s) for implementation Use comments and good style practices HINT: Read the contents of the response file into an a vector. When the user enters a question, generate a random index and display the response from the vector with that index. Make sure to check for the exit condition. To generate the random index, use the following in main() - this should be familiar by…The objective of this question is to generate and read files that contain a list of random numbers. Write a function that generates a file with following parameters: def fillFile(fileSize, fileName): The function should be called to generate files in the following sizes: fileSizes = [1000, 5000, 10000, 20000, 30000, 40000, 50000] The generated files can have names file1000, file 5000, file 10000, file20000, fi130000, file40000, file 50000. You can use random.randint(0.fileSize+1000) to generate a random number. Write another function that reads numbers inside of a file and returns a list. def readFile(fileName): The returned list contains the numbers stored in the file. At each call of fillFile and readFile, record the times before and after the function call as in following example (import time): start = time.time() fillFile(file Size, "file" + str(fileSize)) finish time.time() runTime = finish - start Record the run times of functions into a file named "fileStats.txt". The…Implement in C Programming 9.6.1: 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. Assume also the maximum number of characters of all file names is 100. 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…
- In C language, write the following two functions maintaining a database of entries of type song in a file. Here is the definition of the struct song: typedef struct { char* title; char* artist; int year; } song; int add_song(const char* file_name, const song s); 1. The function gets the name of a file, and a song. If the song is not in the file, the function adds it to the file and returns 1. Otherwise, the function does not modify the file and returns 0. song* find_song(const char* file_name, const char* title); 2. The function gets the name of a file and a title of a song. It searches the file for the song with the given title. If a song is found, it returns a pointer to the song with all the details. If not found, the function returns NULL. You may assume the song titles are unique. Additional instructions and hints: 1. For the instructions on how to read and write to files see section "C Programming Files" in https://www.programiz.com/c-programming or…In C language, write the following two functions maintaining a database of entries of type song in a file. Here is the definition of the struct song: typedef struct { char* title; char* artist; int year; } song; int add_song(const char* file_name, const song s); 1. The function gets the name of a file, and a song. If the song is not in the file, the function adds it to the file and returns 1. Otherwise, the function does not modify the file and returns 0. song* find_song(const char* file_name, const char* title); 2. The function gets the name of a file and a title of a song. It searches the file for the song with the given title. If a song is found, it returns a pointer to the song with all the details. If not found, the function returns NULL. You may assume the song titles are unique. Additional instructions and hints: 1. For the instructions on how to read and write to files see section "C Programming Files" in https://www.programiz.com/c-programming or…. In c write a program that:a) takes an input file name from the command line;b) opens that file if possible;c) declares a C struct with three variables; these will have data types thatcorrespond to the data types read from the file (i.e. string, int, float);d) declares an array of C structs (i.e. the same struct type declared in point c);e) reads a record from the file and stores the values read into the appropriatestruct variable at the appropriate array index (for that record);f) continues reading each record into a struct (as in point 1e), and stores eachstruct containing the 3 values into the array of structs declared in point d;g) closes the file when all records have been read.Note that your program should print an error message in the event that the filecannot be opened successfully.