1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
levacccp [35]
2 years ago
12

This program will read integers from a file and find results from these integers. Open the file, test to make sure the file open

ed. Use a loop to read the integers and process each integer as it is read. When End Of File is reached, close the file. After all of the integers have been read and processed, print the results for the following output: The integer count: The sum of the integers: The smallest integer: The largest integer: The average of the integers: Use notepad, vim, or other simple text editor to create a file named file1.txt containing the following, with one integer per line. Test the program two times. Use the following data in the first test: 11 9 18 22 27 33 21 For the second test add an additional line containing the number 40.
Computers and Technology
1 answer:
erma4kov [3.2K]2 years ago
4 0

Answer:

this is in cpp

#include <bits/stdc++.h>

#include<fstream>

using namespace std;

int main()

{

ifstream myfile;

myfile.open ("file1.txt");

// Check if file is opened

if (!myfile.is_open())

{

cout<<"Error: File could not be opened"<<endl;

}

else{

// variable to stor count,sum, minimum and maximum

int ct=0,sm=0,mn=INT_MAX,mx=INT_MIN;

// variable for taking input

int x;

// reading and processing in loop until there are more integers

while(myfile>>x){

ct++;

sm+=x;

mn= min(mn,x);

mx=max(mx,x);

}

// close the file when End of file is reached

myfile.close();

//printing results

cout<<"The integer count: "<<ct<<endl;

cout<<"The sum of the integers: "<<sm<<endl;

cout<<"The smallest integer: "<<mn<<endl;

cout<<"The largest integer: "<<mx<<endl;

cout<<"The average of the integers: "<<((sm*1.0)/ct)<<endl;

}

return 0;

}

Explanation:

You might be interested in
Which of the following is a full selector?
Romashka-Z-Leto [24]

Answer:

need picture i have to see picture

Explanation:

3 0
2 years ago
A collision volume is called ____
Phoenix [80]

C IS THE CORRECT ANSWER NOT A I PROMISE ITS REGION!!!

6 0
3 years ago
Sigma Technology is a company based in Singapore, with branches in 24 countries. It needs multiple CAs in different locations to
seropon [69]

PKI trust model that should be used, is a distributed trust model.

  • A distributed trust is a trust model that gives power to different source while taking the power away from a single source and thereafter, shares that responsibility to the wide range of sources. It is important as it allows trust to flows through network, marketplaces and forums.

  • With the use of this distributed trust model, Sigma Technology can have multiple CAs in different locations to work on behalf of the company. And even if one is absence, other CAs can still issue certificate without any hindrances.

Conclusively, we can say that PKI trust model that should be used is a distributed trust model.

Learn more from:

brainly.com/question/14837773

8 0
3 years ago
Assuming that we only support BEQ and ADD instructions, discuss how changes in the given latency of this resource affect the cyc
sertanlavr [38]

Answer:

Refer below.

Explanation:

Because we are inserting commands to beq, we will need an execution of the ALU, and then a register write. This result in and increase cycle time of the PC relative branch:

440+90=530ps.

As it is the longest time to execute, so its a critical path

6 0
2 years ago
Which PowerPoint options can users customize?
Zielflug [23.3K]

Answer:

Customized Toolbar,  theme, design, autosave file location, ribbon tabs and groups, quick access buttons, username

Explanation:

5 0
3 years ago
Other questions:
  • Nonvolatile in the context of data storage means ________________. a. the data can't be changed in a data warehouse. b. the data
    11·1 answer
  • Written and artistic expressions are protected by
    8·1 answer
  • How a computer encodes text, how it is processed and how computer data is represented.
    6·1 answer
  • How to do this button ?
    14·1 answer
  • On the Format tab, which group allows you to select a different font for a chart?
    7·2 answers
  • Differentiate between patent and copyright.
    6·2 answers
  • ____ the most popular word processing applications software<br><br>​
    12·1 answer
  • How to create create a database in mysql using clv files
    11·1 answer
  • The best way to deal with crying children in the car is to ignore them or pull off the road
    15·1 answer
  • The classes Person and Airplane shall have the property to print information about themselves on a printer. Draw class and inter
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!