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
marin [14]
2 years ago
10

Write a program to input a number.Find the sum of digits and number of digits

Computers and Technology
2 answers:
BaLLatris [955]2 years ago
8 0

Answer:

<em>#Sum of Digits</em>

a = int(input("Enter a number: "))

sumofdigits = sum(int(dig) for dig in str(number))  

print("Sum of digits: ", sumofdigits)

<em># Number of digits</em>

count = 0  

print ("Total number of digits : ",len(str(abs(a))))

Explanation:

It is pretty self-explanatory however, I will tell it to you anyways. So, the sum of digits iterates to each digit and adds them up. For the number of digits, it uses in-built functions (length, string and absolute)

ki77a [65]2 years ago
7 0

omg a computer program

i love it

okay so i will assume taht you want the program to be in python

here we go

a = int(input("Enter a number ")

b = int(input("Enter another number ")

sum = a + b

def Digits(sum):

count = 0

while sum != 0:

sum //= 0

count += 1

return count

print(f"Sum is {sum} \nnumber of digits are {Digits(sum)}")

You might be interested in
Question 1 :George, a user, is having trouble connecting to network resources, including shared folders on the local network and
vazorg [7]

Complete Question:

George, a user, is having trouble connecting to network resources, including shared folders on the local network and Internet resources. Yesterday he was able to connect with no problems. You need to ensure that he can connect to these resources. Which tool should you use FIRST?

Group of answer choices

A. ipconfig

B. Device Manager

C. My Network Places

D. Control Panel

Answer:

A. ipconfig

Explanation:

As a network administrator, to ensure that George can connect to the network resources, shared folders, and internet resources, the tool you should use first is the "ipconfig" in the command line. This is a troubleshooting process that would help to identify the problem and to establish a theory of probable cause.

<em>Since George could connect the previous day without any problem, it is most likely that the TCP/IP settings has been altered. Therefore, to view this settings you'll have to use an ipconfig command. </em>

4 0
3 years ago
Assume that a large number of consecutive IP addresses are available starting at 198.16.0.0 and suppose that two organizations,
Fiesta28 [93]

Answer & Explanation:

An IP version 4 address is of the form w.x.y.z/s

where s = subnet mask

w = first 8 bit field, x = 2nd 8 bit field, y = 3rd 8 bit field, and z = 4th 8 bit field

each field has 256 decimal equivalent. that is

binary                                        denary or decimal

11111111      =        2⁸      =             256

w.x.y.z represents

in binary

11111111.11111111.11111111.11111111

in denary

255.255.255.255

note that 255 = 2⁸ - 1 = no of valid hosts/addresses

there are classes of addresses, that is

class A = w.0.0.0 example 10.0.0.0

class B = w.x.0.0 example 172.16.0.0

class C = w.x.y.0 example 198.16.8.1

where w, x, y, z could take numbers from 1 to 255

Now in the question

we were given the ip address : 198.16.0.0 (class B)

address of quantity 4000, 2000, 8000 is possible with a subnet mask of type

255.255.0.0 (denary) or

11111111.11111111.00000000.00000000(binary) where /s =  /16 That is no of 1s

In a VLSM (Variable Length Subnet Mask)

Step 1

we convert the number of host/addresses for company A to binary

4000 = 111110100000 = 12 bit

step 2 (subnet mask)

vary the fixed subnet mask to reserve zeros (0s) for the 12 bit above

fixed subnet mask: 11111111.11111111.00000000.00000000            /16

variable subnet mask: 11111111.11111111.11110000.000000                /20

now we have added 4 1s in the 3rd field to reserve 12 0s

<u><em>subnet mask: 255.255.</em></u><u><em>16.</em></u><u><em>0 (where the 1s in each field represent a denary number as follows)</em></u>

<u><em>1st 1 = 128, 2nd 1 = 64 as follows</em></u>

<u><em>1        1       1      </em></u><u><em> 1 </em></u><u><em>      1     1     1     1</em></u>

<u><em>128  64     32    </em></u><u><em>16</em></u><u><em>    8    4     2    1</em></u>

step 3

in the ip network address: 198.16.0.0/19 <em>(subnet representation)</em> we increment this using 16

that is 16 is added to the 3rd field as follows

That means the ist Valid Ip address starts from

          Ist valid Ip add: 198.16.0.1 - 198.16.15.255(last valid IP address)

Company B starts<u><em>+16: 198.16.</em></u><u><em>16</em></u><u><em>.0 - 198.16.31.255</em></u>

<u><em>                   +16: 198.16.</em></u><u><em>32</em></u><u><em>.0- 198.16.47.255 et</em></u>c

we repeat the steps for other companies as follows

Company B

Step 1

we convert the number of host/addresses for company B to binary

2000 = 11111010000 = 11 bit

Step 2

vary the fixed subnet mask to reserve zeros (0s) for the 11 bit above

fixed subnet mask: 11111111.11111111.00000000.00000000            /16

variable subnet mask: 11111111.11111111.11111000.000000                /21

now we have added 5 1s in the third field to reserve 11 0s

<u><em>subnet mask: 255.255.</em></u><u><em>8.</em></u><u><em>0 (where the 1s in each field represent a denary number as follows)</em></u>

<u><em>1st 1 = 128, 2nd 1 = 64 as follows</em></u>

<u><em>1        1       1       1       </em></u><u><em>1 </em></u><u><em>    1     1     1</em></u>

<u><em>128  64     32    16    </em></u><u><em>8 </em></u><u><em>   4     2    1</em></u>

Step 3

Starting from after the last valid Ip address for company A

in the ip network address: 198.16.16.0/21 (<em>subnet representation</em>) we increment this using 8

That means the ist Valid Ip address starts from

           Ist valid Ip add: 198.16.16.1 - 198.16.23.255(last valid IP address)

Company C starts <u><em>+16: 198.16.</em></u><u><em>24</em></u><u><em>.0- 198.16.31.255</em></u>

<em>                             </em><u><em> +16: 198.16.</em></u><u><em>32</em></u><u><em>.0- 198.16.112.255 et</em></u>c

Company C

Step 1

we convert the number of host/addresses for company C to binary

4000 = 111110100000 = 12 bit

Step 2

vary the fixed subnet mask to reserve zeros (0s) for the 12 bit above

fixed subnet mask: 11111111.11111111.00000000.00000000            /16

variable subnet mask: 11111111.11111111.11110000.000000                /20

now we have added 4 1s in the 3rd field to reserve 12 0s

<u><em>subnet mask: 255.255.</em></u><u><em>16.</em></u><u><em>0 (where the 1s in each field represent a denary number as follows)</em></u>

<u><em>1st 1 = 128, 2nd 1 = 64 as follows</em></u>

<u><em>1        1       1       1       1     1     1     1</em></u>

<u><em>128  64     32    16    8    4     2    1</em></u>

Step 3

Starting from after the last valid ip address for company B

in the ip network address: 198.16.24.0/20 (subnet representation) we increment this using 16

That means the ist Valid Ip address starts from

           Ist valid Ip add: 198.16.24.1 - 198.16.39.255(last valid IP address)

Company C starts <u><em>+16: 198.16.40.0- 198.16.55.255</em></u>

<em>                          </em><u><em>    +16: 198.16.56.0- 198.16.71.255 et</em></u>c

Company D

Step 1

we convert the number of host/addresses for company D to binary

8000 = 1111101000000 = 13 bit

Step 2

vary the fixed subnet mask to reserve zeros (0s) for the 13 bit above

fixed subnet mask: 11111111.11111111.00000000.00000000            /16

variable subnet mask: 11111111.11111111.11100000.000000                /19

now we have added 3 1s in the 3rd field to reserve 13 0s

<u><em>subnet mask: 255.255.</em></u><u><em>32.</em></u><u><em>0 (where the 1s in each field represent a denary number as follows)</em></u>

<u><em>1st 1 = 128, 2nd 1 = 64 as follows</em></u>

<u><em>1        1      </em></u><u><em> 1 </em></u><u><em>      1       1     1     1     1</em></u>

<u><em>128  64     </em></u><u><em>32  </em></u><u><em>  16    8    4     2    1</em></u>

Step 3

Starting from after the last valid ip address for company C

in the ip network address: 198.16.40.0/20 (subnet representation) we increment this using 32

That means the ist Valid Ip address starts from

           Ist valid Ip add: 198.16.40.1 - 198.16.71.255(last valid IP address)

Company C starts <u><em>+16: 198.16.72.0- 198.16.103.255</em></u>

<em>                          </em><u><em>    +16: 198.16.104.0- 198.16.136.255 et</em></u>c

5 0
3 years ago
What are some elements commonly included in forms in Word? Check all that apply.
MArishka [77]

Answer:

dates

text

drop-down lists

8 0
3 years ago
Which of the following is a quality of a mixed economy?
tekilochka [14]

Answer:

Image result for Which of the following is a quality of a mixed economy? 1. Businesses have complete control of what they import. 2. Individuals have complete control of what they export. 3.Leaders determine the wages of individuals without any input from businesses. 4. Government encourages free trade of specific products.

'One main characteristic of a mixed economy is the ownership of goods by both private and government/state-owned entities. Monopolies have the potential to occur in this type of economy, but the government closely monitors this. For the economy to be mixed, the government can control some parts but not all.

Explanation:

6 0
2 years ago
How do you design and create video games for what console game That you want To have it in
Yakvenalex [24]

Answer

Making a video game is much less daunting than it might seem. While you likely aren’t going to go from having no experience to making the next Grand Theft Auto, it has actually never been easier to get started making games. Game development tools and resources have become increasingly accessible to the average person, even if they have no programming experience. Often these tools are also available for free.

To try to make things easier for those looking to get started making games, we’ve put together a list of 11 game engines / editors. Some are designed for a specific genre of game or to be incredibly easy for newcomers. Others are professional development tools for AAA games, but are effectively free to use for hobbyists and still offer a lot of learning tools to help those with limited programming experience get started.

There are, of course, a lot of things that go into game development — music, animation, sound, writing, texturing, modeling, etc. — however, the game engine / editor you choose is going to have the biggest effect on what kind of game you can make. If you have suggestions for other engines, software, or learning tools for the other aspects of development, post it in the comments.

7 0
2 years ago
Other questions:
  • Which items may interfere with a wireless connection and may cause disruptions or delays in submitting assignments in blackboard
    9·2 answers
  • What are the functions of online gaming communities?
    12·1 answer
  • With which type of social engineering attack are users asked to respond to an email or are directed to a website where they are
    9·1 answer
  • What is the correct order of headers, from left to right, in a completed frame?
    8·1 answer
  • Which media device uses the characteristic continuous?
    10·1 answer
  • Assuming 8-bit 2's complement notation, what is the result of subtracting 00001001 from 00001101?
    11·1 answer
  • What are the names of different types of tablets<br>​
    13·1 answer
  • Hiya people. I am a game developer and I need an idea for a new game. If you have any ideas, pls feel free to tell me. Best idea
    6·2 answers
  • Create a program that allows the user to pick and enter a low and a high number. Your program should generate 10 random numbers
    14·1 answer
  • When you type in text in an image in a photo-editing software, where is it created?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!