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
Bad White [126]
3 years ago
14

Write a fragment of code that reads in integers from standard input, until end-of-file and sends their (floating point) average

to standard output. If no numbers are input, the message "no values to average" is printed instead (while loops, end-of-file processing, mixed-mode arithmetic, basic conditional)
Computers and Technology
1 answer:
nydimaria [60]3 years ago
6 0

Answer:

float number=-1;

float count=0;

float sum=0;

while(cin.eof()==false){

cin >> number;

sum += number;

count++;

}

if(number==-1){

cout << "no values to average";

}

else{

if (count>0)

cout << sum/count;

}

You might be interested in
If you wish to maintain a consistent style to all the documents you create, it would be helpful to use a _​
kakasveta [241]

Answer:Apply a consistent look across the whole document instead of having to format each section individually.Automatically number section headers.Apply same font to the entire text body.Apply the same font to header sections.Use a consistent paragraph spacing.Pick a default color scheme for SmartArt, charts, and shapes.Pick from a number of pre-designed styles use them as your own and modify them.

Read more on Webcache.googleusercontent.com - https://webcache.googleusercontent.com/question/1639566#readmore

Explanation:

tht is the answer

7 0
3 years ago
Ujqwgydft frrhyy4e uvbw vhrwbhv vbyrewblv?
pishuonlain [190]

Answer:

??

Explanation:

can you be more specific please! i can't read gibberish

8 0
3 years ago
An index purports to speed data retrieval. you, therefore, index every attribute in each table. select the likely consequence.
stira [4]

Answer:

b. data entry slows as every INSERT , UPDATE, or DELETE statement must also update every index.

Explanation:

This process help to improve the speed of get data , it takes each element in the indexed column and save the location to get faster the data. But if you index every attribute in a table it going to take a lot of time locating each column in the respective index in each query(update, delete and insert). For that reason is necesary be carefull with this process and only put index in the relevant columns

4 0
3 years ago
Give big-O estimate for the number of operations (multiplication or addition) used in the following algorithm segment (ignore co
Novay_Z [31]
<span>'m pretty sure the big O is actually O(log n) Not really a proof but anyway. If you write out the values before each iteration of the loop you get. L - iteration number L i t 1 1 0 2 1 2 3 3 6 4 9 18 5 27 54 6 81 162 So if n was 80 it would take 6 iterations You can see i is growing like 3^(L-2) So if n was 1000 1000 = 3^(L-2) log(1000) [base 3] = L - 2 log(1000) [base 3] + 2 = L 8.287709822868152 = L and if you ceil the answer you get L = 9 and just to check with the table 6 81 162 7 243 486 8 729 1458 9 2187 ... The table isn't perfect but hopefully you get the main idea.</span>
6 0
4 years ago
What type of image digital image is shown here?
madreJ [45]

Answer:

soccer tournament youth league

6 0
3 years ago
Read 2 more answers
Other questions:
  • A network TAP serves what purpose on a network?
    7·1 answer
  • Does any body like animal jam
    11·2 answers
  • Ruby is creating a presentation. She wants each slide displayed at intervals of five seconds. Which feature in the presentation
    6·2 answers
  • All of the following are report sections EXCEPT (Points : 4) detail.
    11·1 answer
  • Harvey is creating a presentation for his school project. He wants to have the same look on all the slides of his presentation.
    6·2 answers
  • Write a multi-paragraph Informational essay about a current event in the news. You can develop your topic using
    8·2 answers
  • g What field in the IPv4 datagram header can be used to ensure that a packet is forwarded through no more than N routers? When a
    10·1 answer
  • Write a program that asks the user for several days' temperatures and computes the average temperature for that period and how m
    9·1 answer
  • You want to change your cell phone plan and call the company to discuss options
    7·1 answer
  • Question 4 (5 points) If your social media accounts are___________, college admissions representatives can look at your social m
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!