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
Veseljchak [2.6K]
3 years ago
11

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
Computers and Technology
1 answer:
Dmitriy789 [7]3 years ago
5 0

Answer:

The solution code is written in Python 3

  1. count = 0
  2. sum = 0
  3. num = input("Enter a number: ")
  4. while(num != ''):
  5.    sum += float(num)
  6.    count += 1
  7.    num = input("Enter a number: ")
  8. print("Sum : " + str(sum))
  9. print("Average: " + str(sum / count))

Explanation:

Firstly, we declare two variables count and sum to hold the number of input number and the total of the input number, respectively (Line 1-2)

Next, we prompt user to input the first number (Line 4). While the num is not ' ' (This means it is not "Enter" key), accumulate the num to sum variable and increment count by one (Line 6-8) and then prompt the user to input the next number (Line 9).

At the end, display the sum and average using print function (Line 11 -12).

You might be interested in
In the well-known ____________________ attack, an attacker monitors (or sniffs) packets from the network, modifies them, and ins
Oduvanchick [21]

Answer:

MAN IN THE MIDDLE

Explanation:

Man in the middle attack is an attack where the attacker secretly relays and possibly alters the communications between two parties. When data is sent between a computer and a server, a cybercriminal can get in between and spy or eavesdrop.

A man in the middle attack can positions himself in a conversation between a user and an application in other to impersonate one of the parties, making it appear as if a normal exchange of information is underway.

In a man-in-the-middle cyber-attack, the attacker places themselves in between two devices and monitor packets from the network, modifies them, and inserts them back into the network without the other parties knowing.

3 0
3 years ago
Write a program that reads in a temperature value in °F. Create a function ConvertFahrenheit that takes that value as a paramete
larisa86 [58]

Answer:

#include<stdio.h>

void ConvertFahrenheit(float);

void main()

{

float fahrenheit_temp;

printf("Input the temperature in Fahrenheit: ");

 

scanf("%f", &fahrenheit_temp);

 

ConvertFahrenheit(fahrenheit_temp);

}

void ConvertFahrenheit(float fahren) {

float c, k;

 

c = (fahren - 32)/1.8;

k = (fahren + 459.67)/1.8;    

 

printf("Celsius = %f\n", c);

printf("Kelvin = %f", k);

}

Explanation:

  • Inside the main function, take the temperature in Fahrenheit as an input from user and call the ConvertFahrenheit function by passing it the  fahrenheit_temp variable as an argument.
  • Create the ConvertFahrenheit function for the conversion  and convert the fahrenheit value to the Celsius and Kelvin by using their conversion formulas respectively.
  • Lastly, display the result in Celsius and Kelvin.
8 0
3 years ago
Write the application of computer in education and communication​
daser333 [38]

Answer:

Technology has profoundly changed education in many ways. Technology has greatly expanded access to education. In medieval times, books were rare and only an elite few had access to educational opportunities. Individuals had to travel to centers of learning to get an education. Today, massive amounts of information (books, audio, images, videos) are available at one’s fingertips through the Internet, and opportunities for formal learning are available online worldwide through online learning, podcasts, traditional online degree programs, and more. Access to learning opportunities today is unprecedented in scope thanks to technology.

Technology is a gift of God. After the gift of life, it is perhaps the greatest of God's gifts. It is the mother of civilizations, of arts, and sciences. Technology has certainly changed the way we live. It has impacted different facets of life and redefined living. Undoubtedly, technology plays an important role in every sphere of life. Several manual tasks can be automated, thanks to technology. Also, many complex and critical processes can be carried out with ease and greater efficiency with the help of modern technology. Thanks to the application of technology, living has changed and it has changed for the better. Technology has revolutionized the field of education. The importance of technology in schools cannot be ignored. In fact, with the onset of computers in education, it has become easier for teachers to impart knowledge and for students to acquire it. The use of technology has made the process of teaching and learning all the more enjoyable.

Technology has also begun to change the roles of teachers and learners. In the traditional classroom, the teacher is the primary source of information, and the learners passively receive it. This model of the teacher as the “sage on the stage” has been in education for a long time, and it is still very much in evidence today. However, because of the access to information and educational opportunity that technology has enabled, in many classrooms today we see the teacher’s role shifting to the “guide on the side” as students take more responsibility for their learning using technology to gather relevant information. Schools and universities across the country are beginning to redesign learning spaces to enable this new model of education, foster more interaction and small group work, and use technology as an enabler.

Explanation:

7 0
3 years ago
Why is it worth remembering “All people seem to need data processing”?
Rzqust [24]
The answer is .........C
3 0
3 years ago
Read 2 more answers
Angelina wants her text to look less crowded on the page, so she decides to decrease the length of the space the text occupies.
ratelena [41]

Answer:

She can go to the Layout tab and then to the Page setup command group to increase the margins of the page.

Explanation:

Because margin decides from the text should start ie. it decides how much space should be left on the top of the page, bottom, left and right. If you increase the margin automatically the amount of space in all the four sides gets increased and hence the contents gets automatically adjusted and the text will look better readable than before.

The crowd that it has created before automatically gets adjusted and will give a better look.

8 0
3 years ago
Read 2 more answers
Other questions:
  • In a case where electrical current leakage from the circuit occurs,
    7·2 answers
  • We have to calculate the percentage of marks obtained in three subjects (each out of 100) by student A and in four subjects (eac
    11·1 answer
  • An administrator working on a Windows Server 2016 Server Core installation needs to disable DHCP on all interfaces on the server
    12·1 answer
  • Press the ____ key(s) to erase one character to the left of the insertion point.
    10·2 answers
  • Compare and contrast the following network types: Personal Area Network (PAN) Local Area Network (LAN) Metropolitan Area Network
    14·1 answer
  • Use induction on n to prove that fir all n&gt;=2, 2^n+3^n&lt;5^n
    11·1 answer
  • c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive
    5·1 answer
  • Given that add, a function that expects two integer parameters and returns their sum, and given that two variables, euro_sales a
    7·1 answer
  • What do mobile platforms utilize to stream voice, IP telephony, mobile internet access, video calling, gaming services, cloud co
    15·1 answer
  • Jerry purchased 25 dozens of eggs. He used 6 eggs to bake 1 cake. How
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!