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
Xelga [282]
3 years ago
8

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

Computers and Technology
2 answers:
Sophie [7]3 years ago
6 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.

mina [271]3 years ago
4 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.)

You might be interested in
Choose the assistive technology that best completes each sentence.
aksik [14]

Answer:

A then B

Explanation:

i got the qeshtoin wrong to get the anwser

5 0
3 years ago
What does it mean when #DIV/0! is displayed and a green triangle is added to the upper-left corner of a cell? A. The formula can
bazaltina [42]
The answer to the question is B.
4 0
4 years ago
Read 2 more answers
Create an application that lets the user enter the food charge for a meal at a restaurant. When a button is clicked, the applica
Art [367]

Answer:

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

       Dim foodCharge, tax, tip, totalCharge As Double

       foodCharge = Val(TextBox1.Text)

       tax = 0.07 * foodCharge

       tip = 0.15 * 100

       totalCharge = foodCharge + tax + tip

       Label5.Text = tax

       Label6.Text = tip

       Label7.Text = totalCharge

   End Sub

End Class

Explanation:

  1. This is implemented using Visual Basic programming language
  2. Firstly we declared all the variables using DIM key word
  3. Then the calculation for each variable is done according to the specification of the question
  4. On the form (See attached Image) the controls for receiving the user input is created as well as the controls for the output.
  5. See the attached sample run below:

4 0
4 years ago
A slide in Olivia's presentation has the Title and Content layout applied. The bulleted list on the slide contains 14 items and
Harrizon [31]

Answer:

1) Right-click the slide, select Layout, and select Two Content

2) <em>*While on the same slide* </em>-go to the Ribbon, select Layout and select Two Content.

Explanation:

Either of these options will change the layout of the slide. After this is done, select 8-14 and cut and paste them in the second text box. Then format them to look aesthetically pleasing.

8 0
4 years ago
Engineers must ______ with clients to show how their solution is the best one possible.
DIA [1.3K]
Hi there!

Since there are no options given in your question I will say that the answer is as follows.

<span>Engineers must communicate with clients to show how their solution is the best one possible.

Communication is key in business when trying to get your point across or when you need to know what a client or partner wants or has planned. Without communication, we could not explain or show anyone how your solution is the best one there is available no matter what else competition might have to offer.

-Sincerely your friend in tech, 
</span><span>ASIAX </span><span>  </span><span>Frequent Answerer</span>
3 0
3 years ago
Other questions:
  • Which of these devices must be installed in every indevidual computing device on the network
    14·1 answer
  • Use pseudocode to specify a recursive algorithm to compute the nth value of the harmonic series, for some integer n.
    5·1 answer
  • A predictive data analyst ___
    11·1 answer
  • A _____ miniature battery operated transmitter that can be propelled through a non-metallic pipe or purpose of locating
    6·1 answer
  • How to do row of circles in phyton programming ?
    11·1 answer
  • Definition of data redundancy​
    8·1 answer
  • Computer programming 5
    10·1 answer
  • Why is color important for all objects drawn ?​
    5·1 answer
  • Fundamental of Computer Science
    15·1 answer
  • Purchase computing resources as an outsourced service from suppliers who own and maintain all the necessary equipment and softwa
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!