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
Open a command prompt on PC1. Issue the command to display the IPv6 settings. Based on the output, would you expect PC1 to be ab
Strike441 [17]

Answer:

yes it can communicate with all interfaces on the router.

Explanation:

PC1 has the right default gateway and is using the link-local address on R1. All connected networks are on the routing table.

Netsh may be a Windows command wont to display and modify the network configuration of a currently running local or remote computer. These activities will tell you in how manny ways we can use the netsh command to configure IPv6 settings.

To use this command :

1. Open prompt .

2. Use ipconfig to display IP address information. Observe the  output whether IPv6 is enabled, you ought to see one or more IPv6 addresses. A typical Windows 7 computer features a Link-local IPv6 Address, an ISATAP tunnel adapter with media disconnected, and a Teredo tunnel adapter. Link-local addresses begin with fe80::/10. ISATAP addresses are specific link-local addresses.  

3. Type netsh interface ipv6 show interfaces and press Enter. note the output listing the interfaces on which IPv6 is enabled. Note that each one netsh parameters could also be abbreviated, as long because the abbreviation may be a unique parameter. netsh interface ipv6 show interfaces could also be entered as netsh  ipv6 sh i.

4. Type netsh interface ipv6 show addresses  Observe the results  of the interface IPv6 addresses.

5. Type netsh interface ipv6 show destinationcache and press Enter. Observe the output of recent IPv6 destinations.

6. Type netsh interface ipv6 show dnsservers and press Enter. Observe the results listing IPv6 DNS server settings.

7. Type netsh interface ipv6 show neighbors and press Enter. Observe the results listing IPv6 neighbors. this is often almost like the IPv4 ARP cache.

8. Type netsh interface ipv6 show route and press Enter. Observe the results listing IPv6 route information.

5 0
3 years ago
The intended purpose of the following module is to determine whether the value parameter is within a specified range. The module
BARSIC [14]

The program does not consists of any syntax error but the module contains error in logic especially while placing the condition inside if statement.

Here we are actually planning to check whether the number passed in the “value” variable is within the given lower and upper range which is passed in second and third parameter.

Solution 1:

if value<=lower AND value>=upper Then

Display “The given number is outside the specified range.”

else

Display “The given number is within the specified range.”

End if

Alternate solution:

So for that the condition needs to be value>=lower and value <=lower. so  

if value > lower AND value <upper Then

Display “The given number is within the specified range.”

else  

Display “The given number is within the specified range.”

7 0
4 years ago
In this for loop, identify the loop control variable, the initialization statement, loop condition, the update statement, and th
KATRIN_1 [288]

Answer:

Follows are the solution to these question:

Explanation:

Please find the complete question in the attached file.

For point a:

The "j" is the loop control variable that controls this loop  

For point b:

The initialized statement for the given loop is "j = 1"

For point c:

The loop condition for the given loop is "j<=10" which indicates that the value of j is less than equal to 10.

For point d:

The loop given statement that updates the value of the s is "s = s+j*(j-1)".

8 0
3 years ago
L00000000000000000000000000000000000000000000000000000000l they b00ty tickled
Sidana [21]

Answer:

same bruh

Explanation:

7 0
3 years ago
Read 2 more answers
Nadeen runs a website on vegan lifestyle. She wants to spread the word and make more people visit her site to read her recipes a
pashok25 [27]

What Nadeen needs to do to get people to engage with her web site is to regularly post new content and regularly respond to user comments and questions (options A and C).

<h3>What should Nadeen do to increase visits to her website?</h3>

Currently, social networks and pages have become tools to share information and create a community of people around a topic.

From this trend, many people have developed their own web pages to share their knowledge and experience with other people so that knowledge becomes public and help those who do not have as much knowledge.

However, for a page to have high interactions and visits from the public, the owner of the page must ensure that they comply with some recommendations that will increase the traffic of their page, such as:

  • Post frequently: This is because people are constantly looking for information and like to be up to date with the latest.
  • Respond to user comments and questions: This creates a link between the page owner and their visitors that makes them feel comfortable with this page. This also helps the owner create a community where everyone participates by contributing knowledge.

Note: This question is incomplete because the options are missing. Here are the options:

A. She must post new content on her website regularly.

B. She must increase the number of pay-per-click advertisements on her website.

C. She must regularly respond to user comments and questions.

D. She must use a secure payment gateway.

Learn more about vegan in: brainly.com/question/8708517

3 0
2 years ago
Other questions:
  • Which of the following is FALSE?
    8·1 answer
  • What is basic statement made up of​
    10·2 answers
  • Plane eyes I don't know
    9·1 answer
  • 1. ________ is often defined as using illicit (illegal) drugs, or when the drug is alcohol, tobacco, or a legitimate drug (presc
    13·1 answer
  • Lenny is a cheese packer at Cheddar Express. He is paid $.52 for every case of cheese he packs and loads onto delivery pallets M
    12·1 answer
  • If you enter 234.567 into a cell that is formatted to display 1 decimal place, what is the value stored in the cell?
    13·1 answer
  • Gabe Kelp is a fourteen-year-old goalie for the Soaring Eagles soccer team. He and his teammates are each creating a screen name
    11·1 answer
  • If an engine has four cylinders and a total of 16 valves, how many valves would each cylinder have? A. Two B. One C. Four D. Thr
    12·1 answer
  • A user complains because the social media apps on his mobile device always note his location. The user is worried about privacy,
    12·1 answer
  • ____ can be used to break continuous text to one or more sentences​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!