Write a C++ program to sum the values in the file with respect to the input of the user. The file contains a set of numerical inputs. Read all the inputs from the file and calculate the sum of odd and even numbers based on the choice of the user.
Q: Program must includes and uses stb_image.h and stb_image_write.h . (You can find them, it is…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: i am just wondering what does this piece of code do, what language is it and what meaning it has…
A: In this question we have to understand what programming language is present in the code given and…
Q: Which statement will open the weeklyPay.dat file for input? Group of answer choices…
A: So, we have to choose the right statement which will open the WeeklyPay.dat file for input. The…
Q: f I want to redirect standard output to the file, and standard error to the terminal, how many…
A: Redirect standard output to the file:- In output redirection the file to which the output is…
Q: Given a valid filepath, you will read a BINARY file that consists of two "columns" of double…
A: The Plot star here is mapped using the binary provided on X and Y Axis.
Q: uce $ python3 main.py - convert: filename y letters at the end of the word should be converted? IE…
A: # request the string to convert from the user original_str = input("Word to convert: ") # request…
Q: Create and run 5 linux scripts using
A: Using awk to split up white spaces $ echo 'I like programming' | awk '{ print $3 }' Using awk…
Q: 2. Variables and literals, Again • Now, using your program from #1, put double quotes around the…
A: - We need to distinguish the outputs of using the variables and as string literals and then…
Q: 5. If the compilations succeed, select Execute>Run or F10 to run your program. A working program…
A: Given: There is given a format for output. To Do: We need to write a working program to given…
Q: How to create/execute a read-in text file as per the requirements below? Show final score to player…
A: import randomp1 = 0p2 = 0cpu = 0tie = 0def main(): #menuSelect = "" print("Welcome to Rock,…
Q: (3) Measure the length of a slash. The marking method is (). A. Linear dimension B. aligned…
A: AS PER INSTRUCTIONS FROM BARTLEBY WE ARE SUPPOSED TO SOLVE ONLY FIRST THREE MCQs THEREFORE I AM…
Q: The command which transcribes the standard input to the standard output and also makes a copy of the…
A: There is only one command that transcribes the standard input to the standard output and also makes…
Q: Can you plaese do these questions for me Our users do not want to have to re-enter the…
A: # Method: Load levelsList using the data in levelsFile # Method: Write levelsList to levelsFile…
Q: Given a valid filepath, you will read a binary file that consists of two "columns" of double…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.…
Q: Which statement correctly opens an existing file if you want to add lines to it? A.…
A: This question comes from Python Programming which is a paper of Computer Science. Let's discuss it…
Q: The following statement is used to capture an image or video by camera Pi and save it in a tile:…
A: answer in step 2
Q: Write an alias named qmake (quiet make) that runs make with both standard output and standard error…
A: Answer: I have given answer in the brief explanation.
Q: Hello. How do I get def automated to read the opened text document and make a playlist with the…
A: The answer is in below steps:
Q: (a) Write a shell script using for loop to output all files that have extension “.sh”. (b)Write…
A: b)Write script using case to see current date, time, username and current directory, until and "e"…
Q: Implementing User Input and Comments in a Script 1. Go to your main.py file. 2. On the first line,…
A: Coded using Python 3.
Q: you will need to create the following textbook specified files. Use vi to create these files: …
A: Answer: The vi editor allows creating, manipulating, closing, and opening files on the Unix systems.…
Q: C++ EXPERT REQUESTED. I just want take provided input and create output.txt files instead of…
A: Answer: We have taken input end user instead of taken form the input.txt file . So in the input file…
Q: Can you see what the problem or what went wrong with this file.sh , shel linux script. They show in…
A: The changes made are highlighted. while true; do case $action in "1") echo echo "<<-Lasses…
Q: Using the tools available from the FORMAT menu can greatly reduce your development time. All of the…
A: According to the asked question, the solution is given below with a proper explanation.
Q: Hi i made this code myself but there are some errors coming in this code i have attached screenshot…
A: Note: Modified code is highlighted in bold Code: #!/bin/shmutex=1full=0empty=3x=0 function…
Q: Help with linux Use positional parameter 1 ($1) as the path to the data file. If the path isn’t…
A: Code: if [ "$*" == "" ]; then echo "Path is not supplied" exit 1else if [ -r $1 ] ; then if…
Q: Using pipes and executing ls, obtain the filenames in a directory and only display the files that…
A: Given that, Using pipes and executing ls, obtain the filenames in a directory and only display the…
Q: 2. Peter likes singing songs and playing music with an electric piano. (a) Peter uses an electric…
A: According to the question : i)Peter uses an electric piano with MIDI file to play and record…
Q: Write a program named filemaker.py that will be used to store the first name and age of some friends…
A: #Open the file with write modefile = open('friends.txt','w') #Run the infinite loop which breaks…
Q: Whats wrong with my code? I have attached the error prompt and the input file. Whenever I follow the…
A: This error is coming up because the the variable word in is not defined in the program and but it is…
Q: Using the following data file (delimited by a space or tab) November 400 January 200 June 400 March…
A: Answer :
Q: Hello. How would I get def automated to read the opened text document and make a playlist with the…
A: Answer: I have done code in python and also I have attached python code
Q: Hello how would I get save.py reading and saving my text document. I have code for save.py but it…
A: The following program reads the text file supplied and saves it to another file verbatim as required…
Q: Which are the methods to exit out of the vi editor? Group of answer choices In command mode, type…
A: 1.) Which are the methods to exit out of the vi editor? Answer - In command mode, :q or :wq or :q!…
Q: Whats wrong with my code? I have attached the error prompt and the input file. Whenever I follow the…
A: So the error here says that, 'word' was not declared in this scope; did you mean 'words'? this is…
Q: I need the output shown in the image. what is missing in this function? there is no loop that asks…
A: 1. To ask file repeatedly i. create one flag and set to false 2. create a while loop with…
Q: Hello. How do I get def automated to read the opened text document and make a playlist with the…
A: 1. save main.py file 2. save sve.py file 3. save start.txt file 4. run main.py import save def…
Q: What must a user do to run cp or mv interactively and be asked if she wants to overwritean existing…
A: Overwriting an existing file In Linux operating system, "cp" command refers to copy and is used to…
Q: Hi. I have a text file (input.txt) that has thousands of lines like this: 0197-MP4-915_VBUUMP-Q9CR7…
A: The following are steps needs to be taken for the given program: Open input.txt for reading and…
Q: If we compile the demo.c file with the command “gcc -c demo.c”, then the output file will be…
A: Answer : demo.o If we compile the demo.c file with the command “gcc -c demo.c”, then the output file…
Q: Write a program that allows the user to enter name and phone number. Have the program accept input…
A: Program: //included header file #include<iostream> #include<fstream> //included…
Q: Many PC games save player's in-game data into files so that the player can pause the current playing…
A: Because the data is saved in one byte, this means 8 bits. Now we know that a single hex value…
Q: Using pipes and executing ls, obtain the filenames in a directory and only display the files that…
A: the program is given below:-
Q: Like to backup all files and subdirectories under /var/www, the output file name is today.tar. The…
A: Given: Like to backup all files and subdirectories under /var/www, the output file name is…
Q: Which of the below statements is true? a. The .mat format is a binary format. i.e if we try to open…
A: The .mat format is not the binary format file. i.e we can open the file using notepad and can read…
Q: Kevin is working on an audio file in his audio editing software for a client. He is done with the…
A: As Kevin working on an audio editing software for a client in that the best practice for Kevin is to…
Q: To combine two text files to form a new text file, we will use the following command: Group of…
A: Explanation: syntax: copy first.txt + second.txt third.txt so following is correct: COPY…
Q: How to solve the -input file not found- error in this jav code: System.out.print("Enter input file:…
A: For the given code, the file which is to be accessed should be present in the directory “C:”,…
QUESTION PROVIDED IN ATTACHMENT . KINDLY CHECK
MATCH QUESTION OUTPUT AS WELL AS BELOW OUTPUT AS IT IS.
--------------------OTHER SAMPLE OUTPUT TO CHECK-------------------
Sample File Input: (Input.txt)
21 22 23 24 25 16 17 18 19 30 11 12 13 14 15
Sample Input and Output 3 :
Enter the choice
1.Odd
2.Even
2
The total of all numbers is 136
Sample Input and Output 4 :
Enter the choice
1.Odd
2.Even
1
The total of all numbers is 144
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Write a C++ program that prompts the user to enter a file name that contains the scores of students in a quiz. Each line in the input file contains a student name followed by the student’s score (as shown in the sample file to the right). The program should then find out the students with the minimum score and the maximum score and display their names and scores. Marks.txt Ahmed 90 Badria 85 Noor 91 Khalid 70 Said 65 Suha 80Write a C++ program that reads a file consisting of students’ test scores in the range 0 – 200. It should then determine the number of students having scores in each of the following ranges: 0 – 24, 25 – 49, 50 – 74, 75 – 99, 100 – 124, 125 – 149, 150 – 174, and 175 – 200. Output the score ranges and the number of students. Run your program with the following input data from file: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 157, 189. The program should have the following functions: • void readData – to read all input values from file. This function has three parameters: the input file variable, an array, and the size. void print – to determine and display the score ranges and the number of students. int main – to call both readData and print functions. Marks are allocated as follows: main function and prototypes void readData void printData indentationWrite a C++ program that reads data from a file containing integers that ends with -999 and Output the numbers that are divisible by 7.
- Write a C++ program that reads a file consisting of students’ test scores in the range 0–200. It should then determine the number of students having scores in each of the following ranges: 0–24, 25–49, 50–74, 75–99, 100–124, 125–149, 150–174, and 175–200. Output the score ranges and the number of students. (Run your program with the following input data: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 35, 157, 189.)Write a C++ program with three different files. Each time that the program guesses a number the user responds by telling the program either the correct answer is higher or lower, or that the program’s guess is correct. A sample run of the program is printed below. In the example the user picks the value 72 for the first game, and then 25 for the second game. The user's input is in bold. Here is how the output might look: > Think of a number between 1 and 100> Is the number 50? (h/l/c): h> Is the number 75? (h/l/c): l> Is the number 62? (h/l/c): h> Is the number 69? (h/l/c): h> Is the number 72? (h/l/c): c> You picked 72? Great pick.> Do you want to play again? (y/n): y> Think of a number Between 1 and 100> Is the number 50? (h/l/c): l> Is the number 25? (h/l/c): c> You picked 25? Great pick.> Do you want to play again: (y/n): n> Goodbye. Notice that the program is guessing numbers, and the user is responding by entering 'h', 'l', or 'c' for…Write a C Program which reads the contents of the attached sequential file - customers.txt Print the surname of people who agreed to share their data. This is denoted by the final field in the file (1 for agree, 0 for not agreed). Print the average age of these people (age is the 4th column in the data) Print the average age for people who live in Dublin and have agreed to share their data. This is denoted by the first field in the file. customers.txt New York Dunne 865463389 21 1New York Milford 865438990 22 0New York Mowlds 876765443 24 1New York Wang 873456789 22 1New York Smith 875432234 25 1New York Henry 876654429 22 0New York Gupta 896765443 24 1Los Angeles Monahan 865432245 22 1Los Angeles Brunsdon 865678894 22 1Alabama Tyson 865434566 22 0Alabama Browne 865564766 20 1New York Dunne 890065443 27 1New…
- Write a complete C program that inputs marks of a student in 5 courses using any loop and writes these marks into an output file named txt. After that, it reads scores from myElements.txt and computes the grades based on the table below using a programmer-defined function char computeGrade(double score), and displays the grades on screen. Score Grade >= 90 A 80-89 B 70-79 C 60-69 D <= 59 F ----- please, write 1. the c program code 2. include comments on your code 3. contents of the file myElements.txt 4. sample output Thank you so muchWrite a C++ program to read data from a file “txt”. The contents of numbers.txt are as following. 99 88 77 66 55 44 Read each number from the file “txt” to calculate the sum and average of all the numbers. Save all numbers, sum, and average to a file “txt”. The output of each number and sum is placed in a field-wide enough to 5 places. The average of numbers will be displayed with two decimal places.You are required to write a C++ program that reads several hundreds of movie ratings from an input file, and output a list of Number of times rated (#Rated), sum of ratings (Total Ratings) and average ratings of the movies.The application program reads in several hundreds of movie ratings from an input file “Rating_list.txt”. Each line in the input file represents one review, indicating the title of the movie and a rating (between 0 and 5) separated by a space. Sample lines from the input file is shown below. Titanic 5 The_Full_Monty 3 Liar_Liar 4 Apollo_13 3 Liar_Liar 3 Titanic 4 The_Silence_of_the_Lambs 2 Star_Wars 1 Men_in_Black 4 Dead_Man_Walking 2 Toy_Story…
- You are required to write a C++ program that reads several hundreds of movie ratings from an input file, and output a list of Number of times rated (#Rated), sum of ratings (Total Ratings) and average ratings of the movies. The application program reads in several hundreds of movie ratings from an input file “Rating_list.txt”. Each line in the input file represents one review, indicating the title of the movie and a rating (between 0 and 5) separated by a space. Sample lines from the input file is shown below. Titanic 5 The_Full_Monty 3 Liar_Liar 4 Apollo_13 3 Liar_Liar 3 Titanic 4 The output must be formatted as shown below (see the columns and decimal places). In addition, the output must include the total number of unique movie titles and the total number of ratings found in the input file as shown in the sample output. Movie Mname #Rated Total Ratings Average…You are required to write a C++ program that reads several hundreds of movie ratings from an input file, and output a list of Number of times rated (#Rated), sum of ratings (Total Ratings) and average ratings of the movies.The application program reads in several hundreds of movie ratings from an input file“Rating_list.txt”. Each line in the input file represents one review, indicating the title of the movie and a rating (between 0 and 5) separated by a space. Sample lines from the input file is shown below.Write a python program, that takes three strings as input parameters. The function reads all the data from the inFile (1st input parameter) and writes data to the outFile (2nd input parameter) as described below. Each line in the input file represents a pet record and has the following format. name, breed, age where name and breed are strings, and age is an integer value. Your function must find the oldest pet of a given breed (3rd input parameter) from the inFile and write the following information to the outFile. breed, total records of this breed name of the oldest pet, age of the oldest pet Note that outFile must only have these two lines of information. Suppose, inFile contains the following data: shadow, longhair, 3 poshi, bangal, 5 mikus, longhair, 4 tigger, calico, 9 If you call this function with breed = "longhair", then the following must be written in the outFile: longhair, 2 mikus, 4 Your function must return True if both reading and writing…