Write a program to calculate the students’ average test scores and their grades. assume the following input data: Johnson 85 83 77 91 76 Cooper 78 81 11 90 73 Kennedy 77 31 52 74 83 Use three parallel arrays; one array to store the students’ names, one array to store the students’ average test scores, and one array to store the students’ grades. Your program should have at least the following functions: • a function to open the file. • a function to read the data. • a function to compute the grades. • a function to sort the students’ by average test scores.
Q: 2.1 Write a new float function called lookup for your interp.cpp file that takes two float arrays…
A: The required function is given below: int lookup(float xVal[], float yVal[], float x) {…
Q: a) Write a C++ programs that creates a two-dimensional array or table of characters. The number of…
A: Given: a) C++ program to store random characters in an array and count the occurrences of each…
Q: Write a cpp file and Pass two one dimensional array as an arguments to a function and compare the…
A: Code : // C++ program to find given two array// are equal or not#include <bits/stdc++.h>using…
Q: 3. Write and run a program that reads integers from the file “numbers.txt" into array. Then, write…
A: PROGRAM: #include <iostream> #include <fstream> using namespace std; int main() {…
Q: 2. Write a C++ program that requests the user to enter 10 floating-point values. The first 5 values…
A: Given:
Q: Demonstrate that when a ten element array, a, is passed, if the the called method can change the…
A: Program code: //FilesExercise.javaimport java.io.File;import java.io.FileNotFoundException;import…
Q: In this question, you are going to write a program that computes matrix operations using NumPy. The…
A: I have solve the problem in python code and screenshot of code for easy understanding :- CODE-…
Q: Write a C++ program that requests the user to enter 10 floating-point values. The first 5 lues are…
A: #include <iostream> #include <fstream> using namespace std; int main() { float…
Q: Write a C++ program that does the following: Read and input file xycoordinates.txt containing…
A: The C++ program for the above code is given below:
Q: Write a Python function that implements binary search. The function takes two parameters – a file…
A: def binary_Search(file, value): #function takes filename and value f = open(file, 'r') #open…
Q: I need help modifying this function. I need it to prompt the user for the file name and store it's…
A: The ask is to write/modify the C++ program to read the faculty details from a file. The file name…
Q: 3. Write a program that reads (up to 100) temperature values from a file called input.txt. Read the…
A: Given:
Q: Write a Python function that implements binary search. The function takes two parameters – a file…
A: The function binary_search() will take two parameters- a filename and the value that has to be…
Q: 8.09) Write a program that processes a data file of names in which each name is on a separate line…
A: the code is given below,
Q: PROBLEM M5B-3: Write a complete program (Filename : ARRAY_M5B_3 ) that will load a Two-Dimensional…
A: An array is a linear data structure where the elements occupy contiguous locations in memory. All…
Q: nName is provided as X, Y in a 100 by 100 room Use square root function in cmath sqrt() to calculate…
A: code : #include <bits/stdc++.h>using namespace std; struct person{string name;int x,…
Q: Write a function to read every 2nd value from a text file and store it in a vector. Additionally,…
A: Solution: C++ Program: #include <bits/stdc++.h> #include <fstream> using namespace…
Q: Required: The program must read from the above file and must load the name, surname and mark into…
A: Objective: This program reads a text file of four students and loads the details into three arrays.…
Q: Write a program that will randomly generate 500 integer numbers in the range -249 to 250. Write…
A: Given:- Write a program that will randomly generate 500 integer numbers in the range -249 to 250.…
Q: Write a program that can read in a rank 2 array from an input disk file and calculate the sums of…
A: Answer:- Here we have taken the array of rank 2 that is a 2d array what we call a matrix , then we…
Q: You are given a file having a number in first row representing the size of array. Create an array of…
A: #include<iostream>#include<fstream>using namespace std; int* allocate_memory(int *n){…
Q: The file named gasData.txt contains experimental data on the volume (V) in m³ and temperature (T) in…
A: As per the given question, we need to write a function named ReadGasData() that reads data from…
Q: Write a C++ program that requests the user to enter 10 floating-point values. The first 5values are…
A: According to the asked question, the solution is given below with a proper explanation. In the Given…
Q: Write the statements to do the following: A.declare an array of 10 strings with room for 60…
A: As per our company guidelines we are supposed to answer ?️only first 3️⃣ sub-parts. Kindly repost…
Q: Given a file with data for names and marks you will read them into two arrays You will then display…
A: Answer:)
Q: write a program that reads up to 100 numbers from a file. As you read the numbers, insert them into…
A: int addToArrayAsc(float myArray[], float numEntries, float newValue){ //corner case: array…
Q: 3. Write and run a program that reads integers from the file “numbers.txt" into array. Then, write…
A: Following points are important for reading a file and writing to a file according to given…
Q: Write a function that reads all the numbers from a file into an array. The file is already open…
A: Programming instructions: Include necessary header files. Declare an array "numbers" as global. In…
Q: Write a program that opens a file for read, reads the data in from the file and calculates the sum…
A: Program approach: Created main(). Input file name from user call the openFile() function. The…
Q: 1. a) Write a program to create two files with the names file4.txt and file4a.txt two 10…
A: We need to write a java program for the given scenario.
Q: Write a C++ program that does the following: Read and input file xycoordinates.txt containing the…
A: PROGRAM CODE: #include <iostream>using namespace std;#include <fstream>using…
Q: . a) Write a C++ programs that creates a two-dimensional array or table of characters. The number of…
A: Create a char array of 15*15. Fill it randomly and print it to the console.Generate a text file that…
Q: This assignment will give you practice with arrays and producing an external output file. You are…
A: Program: //Header File import java.io.File; import java.io.FileNotFoundException; import…
Q: Write a program that can read in a rank 2 array from an input disk file and calculate the sums of…
A: Here we have taken the array of rank 2 that is a 2d array what we call a matrix , then we defined 2…
Q: 6. Write a program that reads (up to 100) temperature values from a file called input.txt. Read the…
A: Write a program that reads (up to 100) temperature values from a file called input.txt. Read the…
Q: PROBLEM M5B-3: Write a complete program (Filename : ARRAY_M5B_3 ) that will Two-Dimensional array…
A: An array is a linear data structure where the elements occupy contiguous locations in memory. All…
Q: I need help in creating a function based on the program below. The program below prints out the…
A: Answer: C Source Code: #include <stdio.h>#include <stdbool.h>#include…
Q: 2. Write a C++ program that requests the user to enter 10 floating-point values. The first 5 values…
A: According to the Question below the Complete Program: Program Output: After enter 10 float value…
Q: write a one function to find the max number, and use this function to find maximum number for the…
A: NOTE: Since programming, langauge is not mentioned therefore answering the question in C++ language.…
Q: includes a function that reads integers consisting of students’ test scores in the range of 0-200…
A: The program has functions for each of tasks mentioned in the question as below printScores…
Q: 3. Write a program that reads (up to 100) temperature values from a file called input.txt. Read the…
A: Note: Answering the question in python as no language is mentioned. Input : Read the data from…
Q: Write a function named take_input() that asks the user for the names (strings) of the owner and the…
A: Step 1: Define function take_input() that opens the file "inventory.txt" in write mode. Step 2:…
Q: Given the following piecewise function, f(x): -5 if x 5 Create a function M-file, PieceZig, that…
A: Matlab Code: code.m % function that accepts an input and returns an outputfunction value =…
Q: How to write a function that imports a data from a text file and load it into 5 parallel arrays For…
A: How to write a function that imports a data from a text file and load it into 5 parallel arrays…
Q: Write a program to calculate the net pay of an employee. Input the basic pay, pass basic pay to…
A: Since programming language not mentioned, using C++ CODE: #include <iostream>using…
Q: 2) Write a program in M-File to read 3 x 3 Matrix, then display the diagonal of matrix as shown…
A: Answer: for i=1:9; %for loop to take user inputs a(i)=input(''); %taking…
Q: Q1: write a M-file mat lab program call it Eql.m file to enter a square matrix A(m,m) and find the…
A: Main Diagonal is the elements where row number and column number is same Upper Triangle is the…
Q: Create a program that read the file "data_bmi.txt" 1 180 86 2 176 68.8 3 184 74 4 158 46 169 65.3…
A: Formula to calculate the BMI value of a person given height and weight as input values is as follows…
Q: ## This function is used to generate the input file Directory.txt 2 ## Run this cell to gererate the…
A: Writting the code in python :
Q: Given a file with data for names and marks you will read them into two arrays You will then display…
A: Coded using C++. According to the guidelines we are supposed to answer a single part. So I am…
Write a program to calculate the students’ average test scores and their grades. assume the following input data:
Johnson 85 83 77 91 76
Cooper 78 81 11 90 73
Kennedy 77 31 52 74 83
Use three parallel arrays; one array to store the students’ names, one array to store the students’ average test scores, and one array to store the students’ grades. Your program should have at least the following functions:
• a function to open the file.
• a function to read the data.
• a function to compute the grades.
• a function to sort the students’ by average test scores.
Step by step
Solved in 3 steps with 4 images
- INSTRUCTION: C++ Language Create a function that writes to a file named Inventy.txt the information of 8 items. Ask the user for the item's name, the item's quantity in storage, and the item's price and write it to the file. Create a function that reads the file and items' quantity and price to two different arrays. Create a function that computes the subtotal of each item. Implement all functions inside the main program and the computed value should be displayed with the item's name.Given a file with data for names and marks you will read them into two arrays You will then display the data, do a linear search and report if found, sort the data, do a binary search. Be sure to test for found and not found in your main program. Read Data Write a function that reads in data from a file using the prototype below. The function can define and open the file, read the names and marks into the arrays and keep track of how many names there are in numElts, and then closes the file. The list of names and marks can be found at the end of the lab and copied into a text file. void getNames(string names[], int marks[], int& numElts); Display Data Write a function to display the contents of names and marks using the prototype given below. void displayData(const string names[], const int marks[], int numElts); Linear Search Write the searchList function given the prototype below so that it searches for a given name. The functions returns and int which is…Given a file with data for names and marks you will read them into two arrays You will then display the data, do a linear search and report if found, sort the data, do a binary search. Be sure to test for found and not found in your main program. Read Data Write a function that reads in data from a file using the prototype below. The function can define and open the file, read the names and marks into the arrays and keep track of how many names there are in numElts, and then closes the file. The list of names and marks can be found at the end of the lab and copied into a text file. void getNames(string names[], int marks[], int& numElts); Display Data Write a function to display the contents of names and marks using the prototype given below. void displayData(const string names[], const int marks[], int numElts); Linear Search Write the searchList function given the prototype below so that it searches for a given name. The functions returns and int which is the…
- How to put an array and code in a function. The function takes one parameter, which is the file name. Use the file name passed to your function to load the data from the file into the array then display the arrayGiven a text file containing the availability of food items, write a program that reads the information from the text file and outputs the available food items. The program first reads the name of the text file from the user. The program then reads the text file, stores the information into four separate arrays, and outputs the available food items in the following format: name (category) -- description Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character. Ex: If the input of the program is: food.txt and the contents of food.txt are: Sandwiches Ham sandwich Classic ham sandwich Available Sandwiches Chicken salad sandwich Chicken salad sandwich Not available Sandwiches Cheeseburger Classic cheeseburger Not available Salads Caesar salad Chunks of romaine heart lettuce dressed with lemon juice Available Salads Asian salad Mixed greens with ginger dressing, sprinkled with sesame Not available Drinks Water…Given a text file containing the availability of food items, write a program that reads the information from the text file and outputs the available food items. The program first reads the name of the text file from the user. The program then reads the text file, stores the information into four separate arrays, and outputs the available food items in the following format: name (category) -- description Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character. Ex: If the input of the program is: food.txt and the contents of food.txt are: Sandwiches Ham sandwich Classic ham sandwich Available Sandwiches Chicken salad sandwich Chicken salad sandwich Not available Sandwiches Cheeseburger Classic cheeseburger Not available Salads Caesar salad Chunks of romaine heart lettuce dressed with lemon juice Available Salads Asian salad Mixed greens with ginger dressing, sprinkled with sesame Not available Drinks Water…
- Given a text file containing the availability of food items, write a program that reads the information from the text file and outputs the available food items. The program first reads the name of the text file from the user. The program then reads the text file, stores the information into four separate arrays, and outputs the available food items in the following format: name (category) -- description Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character. Ex: If the input of the program is: food.txt and the contents of food.txt are: Sandwiches Ham sandwich Classic ham sandwich Available Sandwiches Chicken salad sandwich Chicken salad sandwich Not available Sandwiches Cheeseburger Classic cheeseburger Not available Salads Caesar salad Chunks of romaine heart lettuce dressed with lemon juice Available Salads Asian salad Mixed greens with ginger dressing, sprinkled with sesame Not available Drinks Water…Time Write a Python script that extracts and prints a single record from an input file in which organized by line. Each line contains the name of a person (possibly containing multiple followed by the year of his birth. Abbas ibn Firnas ibn Wirda: 809 Muhammad ibn Musa al - Khwarizmi: 780 Abu Al - Walid Muhammad Ibn Ahmad Rushd: 1126 The program uses function extract DataRecord with the specification: @param infile the input text file object @return pants a list containing the name (string) in the first element and the year of bir the second element. If the end of file was reached, an empty list is returnedPython - Next Birthdate In this task, we will write a program that reads birthdate data from a given CSV file, and given the current date, determines which person's birthday will be celebrated next. Create a function with the following signature: nextBirthdate(filename, date) filename: parameter, which represents the CSV filename. date: parameter, which represents the current date. The function should open the CSV file, read the birthdate data, and determine which person's birthday will be celebrated next, given the current date. The name of the person should be returned. In other words, given a date, find the person whose birthday is next. Sample Run birthdates.csv Draven Brock, 01/21/1952 Easton Mclean, 09/02/1954 Destiny Pacheco, 10/10/1958 Ariella Wood, 12/20/1961 Keely Sanders, 08/03/1985 Bryan Sloan,04/06/1986 Shannon Brewer, 05/11/1986 Julianne Farrell,01/29/2000 Makhi Weeks, 03/20/2000 Lucian Fields, 08/02/2018 Function Call nextBirthdate("birthdates.csv", "01/01/2022") Output…
- Programming Language: C++ Please use the resources included and provide notes for understanding. Thanks in advance. Code two functions to fill an array with the names of every World Series-winning team from 1903 to 2020, then output each World Series winner with the number of times the team won the championship as well as the years they won them. The input file is attached, along with the main function and screenprint. Please note team names that include two words, such as Red Sox, have an underscore in place of the space. This enables you to use the extraction operator with a single string variable. The following resources are included: Here is main. #include <iostream>#include <fstream>#include<string> using namespace std; // Add function declarations and documentation here void fill(string teams[], int size);void findWinner(string teams[], int size); int main(){ const int SIZE = 118;int lastIndex;string team[SIZE]; fill(team, SIZE);findWinner(team, SIZE); return…2. Write a general program that creates a table as seen below. Your program should calculate the grade average. You can only use integer or character multi-dimensional arrays to store or calculate data values. You are only allowed to use loops to calculate and print the table. All calculation and printing should be made in gradecalculator function. Data should be taken in the main function. Names Homework Midterm 1 Midterm 2 Final Grade 10% 20% 20% 50% average Ali 89 70 61 60 Ahmet 78 60 59 88 Ayse 99 70 77 66 Есе 100 68 55 72 Selen 80 55 30 82C++ Create a function that will read the following .txt file contents and put them into an array: "apple", "avocado", "apricot","banana", "blackberry", "blueberry", "boysenberry","cherry", "cantaloupe", "cranberry", "coconut", "cucumber", "currant","date", "durian", "dragonfruit","elderberry",