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
MAXImum [283]
3 years ago
11

Write a program that accepts three decimal numbers as input and outputs their sum​

Computers and Technology
2 answers:
Natali [406]3 years ago
7 0

Answer:

a = float(input("Enter an integer: "))

b = float(input("Enter an integer: "))

c = float(input("Enter an integer: "))

print (a + b + c)

Explanation:

Takes three numbers that user inputs and outputs their sum (of whatever numbers are given.)

Alex73 [517]3 years ago
4 0

Answer:

sum = 0.0

for i in range(0,3):

   sum += float(input("Enter a decimal number to sum: "))

print ("Sum: ", sum)

*** Sample Input ***

Enter a decimal number to sum: 1.1

Enter a decimal number to sum: 2.2

Enter a decimal number to sum: 3.3

*** Sample Output ***

Sum:  6.6

Explanation:

For this problem, a method was devised in python to create the sum of three individual decimal numbers.

The first line of code, <em>sum = 0.0</em>, initializes a variable to the float type in which we will store the value of our sum.  Note, it is initialized to 0.0 to start from a value of 0 and be considered a float.

The second line of code, <em>for i in range(0,3):</em>  is the creation of a for loop control structure.  This will allow us to repeat a process 3 amount of times using the iterator i, from value 0 to 3 in this case.  Note, 0 is inclusive and 3 is exclusive in the python range.  This means the for loop will iterate with, i=0, i=1, and i=2.

The third line of code, <em>sum += float(input("Enter a decimal number to sum: "))</em>  is simply asking the user for a number, taking that input and converting it from a string into a float, and then summing the value with the previous value of sum and saving that into sum.

The fourth line of code, <em>print ("Sum: ", sum)</em> is simply displaying the final value that was calculated by adding the three user inputs together which were stored into the variable <em>sum</em>.

Cheers.

You might be interested in
Which of the following is true about binary search. A. It uses binary numbers in its algorithm B. It is slower than sequential s
trapecia [35]

Answer:

<u> A. It uses binary numbers in its algorithm</u>

Explanation:

A Binary search is a type of algorithm designed to look through <em>only </em>a sorted array of data for a particular item.

It is<em> more efficient (faster) </em>than sequential search since the algorithm doesn't have to look up the entire array of data, but simply repeatedly divide in half the section of the array that could contain the searched item.

4 0
3 years ago
What does ‘‘negotiation’’ mean when discussing network protocols? give an example?
rewona [7]
Some protocols have multiple algorithms to choose from for e.g., cryptographic purposes. During connection set up, client and server negotiate which one they'll use.

One example is the set up of a TLS connection. During the handshake, the client shares a list of its supported ciphers (the 'ciphersuites'). The server responds by indicating the best one that both sides support.

4 0
3 years ago
This isn't an academic question, but it's a question about something I am consistently seeing on Brainly, so please don't delete
s344n2d4d5 [400]
Yes it does. Hope that answers
3 0
2 years ago
Read 2 more answers
Which of the following is not included in the manufacturing industry cluster?
max2010maxim [7]
Printing is not included in the manufacturing industry cluster
6 0
3 years ago
Read 2 more answers
The UNIX operating system started the concept of socket which also came with a set of programming application programming interf
VMariaS [17]

Answer:

(a). as the combination of IP address and port number to allow an application within a computer to set up a connection with another application in another computer without ambiguity.

Explanation:

The explanation is in the answer.

3 0
3 years ago
Other questions:
  • Consider the following method.
    13·1 answer
  • How must you rect to a flashing<br> Yellow traffic light?
    9·1 answer
  • ________ is the abbreviation for the place in the computer where the programs and data the computer is currently using are store
    8·1 answer
  • Microsoft access does not create n:m relationships because microsoft access creates databases based on
    7·1 answer
  • What is meant by backing up files through cloud computing?
    5·2 answers
  • How designers have created products from waste materials?
    7·1 answer
  • What is the Matlab command to create a column vector with 11 equally spaced elements, whose first element is 2 and whose last is
    8·1 answer
  • Select four tasks associated with operating system maintenance. Cleaning inside the computer Defragmenting the hard drive Deleti
    11·1 answer
  • EASY What does the Backspace key do?
    6·1 answer
  • Hola, alguien aquí me podría ayudar dándome ideas a cerca de office (Word, PowerPoint o Excel) estoy desesperada no puedo pensar
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!