Answer:
I have done this program in both C and C++ Programming Language
CODE: C Programming Language
#include<stdio.h>
int main(){
int n, sum = 0, count = 0;
FILE *fp;
fp= fopen("numbers.txt", "r"); // reading text
file
//the sum part
// reading the integers from file
while( EOF != fscanf(fp, "%i", &n)){
if(n > 0 && n <=
1000){
sum = sum + n;
// Incrementing the sum between the values 0 to
1000(including)
count++; // Incrementing count
}
}
printf("The Average is :%d", sum/count); //
Printing the average
fclose(fp);
return 0;
}
SCREENSHOT OF THE CODE:

INPUT:
numbers.txt

OUTPUT:

===========================================================================
CODE: C++ Programming Language
#include <iostream>
#include <fstream>
using namespace std;
int main(){
fstream fp; // declare a file
fp.open("numbers.txt", ios::in); // open the
file
int sum = 0;
int count = 0;
string line;
while (getline(fp, line)){ //reading a line from
the file while possible
if(stoi(line) > 0
&& stoi(line) <= 1000){
sum = sum + stoi(line); // convert string to number and add it to
the sum
count ++;
}
}
// closing the file
cout << "The average is: " << sum /
count; // print the sum
cin.get();
fp.close();
return 0;
}
SCREENSHOT OF THE CODE:

INPUT:
numbers.txt

OUTPUT:

Thank you. Please ask me if you have any doubt.
Question 3 (2 points) Suppose, you have a file called 'numbers.txt' where each line of the...
Write a C++ program that open the text file “numbers.txt”. (the numbers.txt looks like: ' 1. 6 8 ') Have a “output.txt” If summation of the numbers is bigger than 10, your code must write the first number inside “numbers.txt” in another file called “output.txt”. (use conditional statement for comparison)
In python Attached is a file called sequences.txt, it contains 3 sequences (one sequence per line). Also attached is a file called AccessionNumbers.txt. Write a program that reads in those files and produces 3 separate FATSA files. Each accession number in the AccessionNumbers.txt file corresponds to a sequence in the sequences.txt file. Remember a FASTA formatted sequence looks like this: >ABCD1234 ATGCTTTACGTCTACTGTCGTATGCTTTACGTCTACTGACTGTCGTATGCTTACGTCTACTGTCG The file name should match the accession numbers, so for 1st one it should be called ABCD1234.txt. Note:...
In python Attached is a file called sequences.txt, it contains 3 sequences (one sequence per line). Also attached is a file called AccessionNumbers.txt. Write a program that reads in those files and produces 3 separate FATSA files. Each accession number in the AccessionNumbers.txt file corresponds to a sequence in the sequences.txt file. Remember a FASTA formatted sequence looks like this: >ABCD1234 ATGCTTTACGTCTACTGTCGTATGCTTTACGTCTACTGACTGTCGTATGCTTACGTCTACTGTCG The file name should match the accession numbers, so for 1st one it should be called ABCD1234.txt. Note:...
Description: Create a program called numstat.py that reads a series of integer numbers from a file and determines and displays the name of file, sum of numbers, count of numbers, average of numbers, maximum value, minimum value, and range of values. Purpose: The purpose of this challenge is to provide experience working with numerical data in a file and generating summary information. Requirements: Create a program called numstat.py that reads a series of integer numbers from a file and determines...
How to write a Java file out that that reads from numbers.txt with these numbers 2 6 7 9 5 4 3 8 0 1 6 8 2 3 and write to a file called totalSum.txt that looks like: 2+6+7+9=24 and so on using this code import java.io.*; import java.util.Scanner; public class FileScanner { public static void main(String[] args) { /* For Homework! Tokens*/ Scanner file = null; PrintWriter fout= null; ...
Basic C program Problem: In this assignment, you have to read a text file (in.txt) that contains a set of point coordinates (x,y). The first line of the file contains the number of points (N) and then each line of the file contains x and y values that are separated by space. The value of x and y are an integer. They can be both negative and positive numbers. You have to sort those points in x-axis major order and...
Write a Java program called EqualSubsets that reads a text file, in.txt, that contains a list of positive and negative integers (duplicates are possible) separated by spaces and/or line breaks. Zero may be included. After reading the integers, the program saves them in a singly linked list in the same order in which they appear in the input file. Then, without changing the linked list, the program should print whether there exists two subsets of the list whose sums are...
Write a program in C++ that reads in integer numbers from a file called scores.txt until the sentinel value -999 is read. The program should then output the total and average of the numbers read and output each of the numbers incremented by the overall average to a file called or scoresout.txt along with the sentinel value of -999 at the end So if 10, 20, 30 and -999 are read in then the program would display a total of...
Assume a text file called film_reviews.txt exists with the following contents: 7 Wall-E 5 The Martian 4 Wall-E 4 The Intern 3 ... The first line of the input file shows the number of reviews in the file. Afterward, each film/review p0ari is then written in subsequent lines in the file. Write a Java application which will read the contents of film_reviews.txt and produce an output file named review_averages.txt which contains the film name and the average of reviews in...
C
language
6. You pilot a small plane. Your plane receives the following information from nearby planes: their three digit ID, and distance away in the x, y, and z directions Write a program that reads in the information from the file air test.txt and prints out the ID and distance of the nearby planes. If the distance is less than 12 miles print a warning message. (The file has one aircraft entry per line in the format 123 45...