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
trasher [3.6K]
3 years ago
7

Write a program that receives a series of numbers from the user and allows the user to press the enter key to indicate that he o

r she is finished providing inputs. After the user presses the enter key, the program should print: The sum of the numbers The average of the numbers An example of the program input and output is shown below:
Computers and Technology
1 answer:
Whitepunk [10]3 years ago
7 0

Answer:

Below program is in C++ Programming Language

Explanation:

Code explanation is in comments, the line starts with // .

// Import all necessory files

#include<iostream>

#include<string>

#include<sstream>

using namespace std;

int main()

{

//Declaring input string to get data from user

string myinput="";

// getline will get input string from user through command prompt

getline(cin, myinput);

//stringstream will be used to get one by one inputed number //seperated by space

//stringS is the name we set for stringstream

stringstream stringS(myinput);

// num will be used to get space seperated number from stringstream

int num = 0;

int sum=0;

// we need to count total numbers enterd by user to get the average

int count=0;

// this if is to prevent any error if user does not provide any number

if(myinput == ""){

cout<< "Nothing entered";

return 0;

}

// while loop iterates up to total inputed numbers entered by user

while (stringS >> num) {

sum += num;

count++;

}

// Output the desired result

cout << "Sum :"<<sum << "\n";

cout << "Average :" << sum/count <<endl;

return 0;

}

You might be interested in
Suppose we eliminate tcp and instead rely exclusively on udp as our only transport layer protocol. ⢠how does this impact opera
evablogger [386]
TCP is a reliable protocol. Verification of the data (to an extent) is performed. UDP is an unreliable protocol. It's a "fire and forget" protocol. Since the verification ( packet counts, checksums ) isn't being done, the application[s] have to do it.
8 0
3 years ago
For computer forensics, ____________ is the task of collecting digital evidence from electronic media.
Zanzabum

For computer forensics, <u>data acquisition</u> is the task of collecting digital evidence from electronic media.

<h3>What is data acquisition?</h3>

Data acquisition is the process of gathering digital evidence from electronic media for computer forensics. Static acquisitions and live acquisitions are the two different categories of data acquisition.

You learn how to carry out static acquisitions from digital material in this chapter. It is the process of digitalization of data from the world.

Thus, <u>data acquisition</u> is the task of collecting digital evidence from electronic media.

To learn more about data acquisition, refer to the link:

brainly.com/question/28233320

#SPJ4

7 0
2 years ago
I need help, who is a great phone pin lock screen cracker?
svlad2 [7]

Answer:

738159

now it's depend on you.

4 0
3 years ago
What is a cyber crime?<br><br>help
algol [13]

Answer:

cyber crime, also called computer crime, the use of a computer as an instrument to further illegal ends, such as committing fraud, trafficking in child p0®n0graphy and intellectual property, stealing identities, or violating privacy. Cyber crime, especially through the Internet, has grown in importance as the computer has become central to commerce, entertainment, and government.

3 0
3 years ago
Read 2 more answers
ARP only permits address resolution to occur on a single network.could ARP send a request to a remote server in an IP datagram?w
romanna [79]

Answer:

The answer to this question is Yes it is possible

Explanation:

It can be done In the case where a special server is required in each network that would forward the request to the  remote ARP(Address Resolution Protocol) server and will receive the response from the server and send it to the requesting host.So we conclude that we can do that hence the answer is Yes.

5 0
4 years ago
Other questions:
  • Discus the pros and cons of Internal cloud service and External cloud service for both Infrastructure as a service and Applicati
    11·1 answer
  • Ok, so this isn't a tech question it's about a game, moomoo.io so don't hate on this if you don't know it, 40 points to whoever
    12·2 answers
  • The _______ of a secondary storage device indicates how much data the storage medium can hold.
    13·1 answer
  • A bluetooth network consists of _____ primary device(s) and up to ____ secondary devices.
    8·1 answer
  • As technology advances, does technology become more of less complex?
    14·1 answer
  • Which is an advantage of using a flat file instead of a relational database?
    9·1 answer
  • Help me guys plssssss​
    10·1 answer
  • Computer science - algorithms - flowcharts
    11·1 answer
  • A. Suppose a CPU with a write-through, write-allocate cache achieves a CPI of 2. What are the read and write bandwidths (measure
    13·1 answer
  • List at least 5 disadvantages caused by computer viruses?​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!