subject

Write a program that will take an integer and add up each of the number’s digits, count the number of digits in the number, and then average the digits. you must use a while loop and % to access each of the individual digits. use / to reduce the number so that you can average all of the digits. example: num = 123 can be taken apart with tempnum = 123 % 10 (which will pull off the 3), then tempnum = tempnum / 10 (will result in 12). do this in a loop while the number is > 0.   sample data : 234 10000 111 9005 84645 8547 123456789      be sure to include print statements that will format the output as below. sample output : 234 has a digit average of 3.0   10000 has a digit average of 0.2   111 has a digit average of 1.0   9005 has a digit average of 3.5   84645 has a digit average of 5.4   8547 has a digit average of 6.0   123456789 has a digit average of 5.0

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 16:30, jngonzo1226
Which of the following statements best describes it careers?
Answers: 2
image
Computers and Technology, 22.06.2019 20:00, serellehunt
Which type of file can be used to import data into a spreadsheet?
Answers: 1
image
Computers and Technology, 23.06.2019 15:30, jasssp
Write a program in plp assembly that counts up by one starting from zero (or one) inside a loop and writes this value to the leds every time the value is increased. the memory address of the leds is 0xf0200000. the table below shows the meaning and an example usage of the instructions covered in the video, plp instructions for project 1. instruction example usage meaning load immediate li $t0, 8 register $t0 is set to the value, 8. store word sw $t2, 0($t1) the value in register $t1 is used as the memory address. the value in register $t2 is copied into this memory address. add addiu $t4, $t3, 29 register $t4 is assigned the sum of 29 and the value in register $t3. jump j your_label_name the program jumps to the line following the label, "your_label_name: ". label your label name: defines a label called "your_label_name: " that can be jumped to
Answers: 2
image
Computers and Technology, 24.06.2019 13:00, brusawerin5969
Refer to the figure and match the theorem that supports the statement.1.if chords are =, then arcs are =.if bc = de, then arc bc = arc de2.if arcs are =, then chords are =.if arc bc = arc de, then bc = de3.diameters perpen
Answers: 3
You know the right answer?
Write a program that will take an integer and add up each of the number’s digits, count the number o...

Questions in other subjects: