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
(10 points) 5.12. Discuss how the following pairs of scheduling criteria conflict in certain settings. a. CPU utilization (effic
Novosadov [1.4K]

Answer:

Check the explanation

Explanation:

  1. CPU utilization and response time: CPU utilization is amplified if the overheads that are connected with context switching or alternating are minimized. The context switching outlay can be reduced by performing context switches occasionally. This could on the other hand lead to increasing the response time for processes.
  2. The Average turnaround time and maximum waiting time: Average turnaround time is reduced by implementing the shortest or simple tasks first. Such a scheduling and arrangement strategy could nevertheless starve long-running tasks and in so doing boost their overall waiting time.
  3. I/O device utilization and CPU utilization: CPU utilization is maximized by executing a list of long-running CPU-bound tasks not including the performing context switches. This is maximized by setting up I/O-bound tasks as early as they become ready to run, thus sustaining the overheads of context switches.

3 0
3 years ago
Help? brainliest and point
stiks02 [169]

Answer: second one

Explanation:

sorry lol

7 0
3 years ago
What adaptation Judy and her parents have that help them run from predators coming?​
Elza [17]

Answer:

.57

Explanation:

3 0
3 years ago
What happens when you print a document with red, green, and blue underline?
Olegator [25]
They will not show up on pages

8 0
3 years ago
Read 2 more answers
Joe has just started the Security Module. He wants to get through it as quickly as possible and take the Quiz. As he clicks thro
Scorpion4ik [409]

Answer:

Joe should read the explanatory text and complete the learning activities.

Explanation:

Given

See attachment for options

Required

Best strategy to get through the module

First off, rushing through the activities and taking guess for each question (as suggested by (a)) will not help him;

He may complete the activities but sure, he won't learn from the module.

Also, reading through the units without completing the activities is not an appropriate method because Joe will not be able to test his knowledge at the end of the module.

The best strategy to employ is to read through the units and complete the activities, afterwards (option (b)).

4 0
3 years ago
Other questions:
  • . Electricians will sometimes call ______ "disconnects" or a "disconnecting means."
    12·1 answer
  • A text-only forum accessed through a bulletin board service (BBS) is known as a _____.
    14·1 answer
  • What are the characteristics of the Global Address List? Check all that apply.
    13·1 answer
  • You have dinner with your family and tell them that you have taken bcis. your mother tells you that she is proud of you and that
    9·1 answer
  • Help me on this question
    14·1 answer
  • There is an application which inputs hundred numbers from the user, if user enters a positive number it increments valid numbers
    6·1 answer
  • What does a wholesaler do?
    12·1 answer
  • The user does not need to highlight data within an Excel worksheet in order to remove conditional formatting. True or false
    14·1 answer
  • What feature is available to add a suggestion in the margin of someone else's document?​
    15·1 answer
  • A large computer software firm promised a client that it could deliver a new operating system on a tight deadline and put Keith
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!