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
marysya [2.9K]
2 years ago
5

4.17 LAB: Varied amount of input data ( C++)

Computers and Technology
1 answer:
stiv31 [10]2 years ago
5 0

Answer:

Written in C++

#include<iostream>

using namespace std;

int main()

{

int num;

int sum = 0;

cout<<"Input: ";

cin>>num;

int count = 0;

int max = 0;

while(num >= 0)

{

 sum+=num;

 cin>>num;

 count++;

 if(num>=max){

  max = num;

 }

}

cout<<(sum/count)<<endl;

cout<<max<<endl;

return 0;

}

Explanation:

<em>I've added the full source code as an attachment where I use comments as explanation.</em>

<em>See Attachment</em>

Download cpp
You might be interested in
If you wanted to detect x-rays coming from the sun,where would you place the detector? Why?
Temka [501]
You would place it in orbit around Earth, as most X-rays are absorbed by the atmosphere, so you would want the detector outside of the atmosphere to accurately detect the X-rays.
5 0
3 years ago
Designers are comparing performance between a multi-core processor equipped with 16 in-order cores and a dual-core superscalar p
Nataly [62]

Explanation:

it will be k because it process faster an it comsume less elecricity

5 0
2 years ago
Help me right now!!!!!!!!!!!!!!!!!!!!!!!!11
PilotLPTM [1.2K]
Word-processing software includes basic applications designed for casual business or home users and powerful, advanced applications capable of meeting the most-demanding needs of businesses. Many word-processing applications are designed for use as part of a suite or integrated group of word-processing, spreadsheet, and presentation programs
4 0
3 years ago
What is the answers please
Gre4nikov [31]
which question are u referring too
6 0
3 years ago
Choose the correct statement:_______.
olga2289 [7]

Answer:

d. A String is a class data type so a String variable holds a reference to a location in memory

It depends on which programing language or scripting language...

Explanation:

If it's Java then D is the correct answer...

6 0
2 years ago
Other questions:
  • If the current through a heater coil is 5 amp and the supply voltage is 120 volts, the coil resistance is A. 0.04 ohm. B. 24 ohm
    6·1 answer
  • Which Access database object asks a question about the data stored in a database and displays specific fields and records that a
    15·1 answer
  • (a) Convert to hexadecimal: 1457.1110. Round to two digits past the hexadecimal point.
    8·1 answer
  • To access your gradebook you click on the __________.
    6·2 answers
  • A string with delimiters can be parsed into separate fields using the _____ class.
    8·1 answer
  • your friend's parent's are worried about going over their budget for the month. Which expense would you suggest is NOT a need?
    11·1 answer
  • ساعدوني على الإجابة على هذه الأسئلة
    11·1 answer
  • Write a pseudocode to calculate the volume of a cylinder​
    12·1 answer
  • What starts with p and ends with orn
    15·2 answers
  • Most of the energy we use originally came from:
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!