sum_even Write a program that reads an integer 0 < n < 2^32, returns the sum of all digits in n that are divisible by 2. For example, if n = 341238 the output would be 14, because it is the sum of 4 + 2 + 8. Hint: a signed int may not be enough.

Answers

Answer 1

Answer:

Written in Python

n = int(input("Num: "))

sum_even = 0

if n > 0 and n < 2**32:

     strn = str(n)

     for i in range(0,len(strn)):

           if int(strn[i])%2 == 0:

                 sum_even = sum_even+ int(strn[i])

print(sum_even)

Explanation:

This line prompt user for input

n = int(input("Num: "))

This line initializes sum_even to 0

sum_even = 0

This line checks for valid input

if n > 0 and n < 2**32:

This line converts input to string

     strn = str(n)

This line iterates through each digit of the input

     for i in range(0,len(strn)):

This if condition checks for even number

           if int(strn[i])%2 == 0:

This adds the even numbers

                 sum_even = sum_even+ int(strn[i])

This prints the sum of all even number in the user input

print(sum_even)


Related Questions

B1:B4 is a search table or a lookup value

Answers

Answer:

lookup value

Explanation:

China is selling school supplies in the United States for very low prices, even lower than the
preventing prices in China, and thus making it extremely difficult for American manufacturers to
compete. This is referred to as

Answers

Answer:

dumping.

Explanation:

dumping. China is selling school supplies in the United States for very low prices, even lower than the prevailing prices in China, and thus making it extremely difficult for American manufacturers to compete. This is referred to as DUMPING.

QUICK!! URGENT!! I'll provide more point if u give me the right code for this specific program. I truly don't understand if statements :( ​

Answers

Answer:

5467373737474737377474747

what is 9x9x9? pls help

Answers

Answer:

729. is answer...........

Answer:

729

Explanation:

Which part of the formula is the argument?

=COUNTIF(A1:E59, "Greene City")

=

()

COUNTIF

A1:E59

Answers

Answer:

e on edege

Explanation:

just took the question on edge

Answer:

Guy above is right!

Explanation:

describe how to get started on a formal business document by using word processing software

Answers

Answer:Click the Microsoft Office button.

Select New. The New Document dialog box appears.

Select Blank document under the Blank and recent section. It will be highlighted by default.

Click Create. A new blank document appears in the Word window.

Explanation:

Create a survey questionnaire with at least 10 questions to find out how teens are using social networking sites. Your data should contain a minimum of 30 valley questionnaires in each respondent must answer all the questions for that questionnaire to be valid. Analyze the data collected using charts or graphs. What are your findings from the survey? Collate the findings by summarizing the answers for each question. Present a graph or chart to represent the data you collected.

Answers

Possible Questions:

- What social media platforms do you use on a daily basis?

- Where did you hear about these social media platforms?

- What made you join these social media platforms?

- What social media platform(s) do you prefer the most?

- Why might you suggest these social media platforms to a friend?

- What does having and using this platform mean to you?

- What does your preferred platform allow you to do?

- Has using this platform changed you in any way? (Are you more connected, concerned, aware, etc.)


A____server translates back and forth between domain names and IP addresses.
O wWeb
O email
O mesh
O DNS

Answers

Answer:

DNS

Explanation:

Hope this helps

DNS I thin hope that helps

In Microsoft windows which of the following typically happens by default when I file is double clicked

Answers

Answer:

when a file is double clicked it opens so you can see the file.

Explanation:

40 POINTS IF YOu ANSWER FOR EACH STEP.
When your friend DaJuan turns on his computer, he hears four beeps. The computer won’t fully boot. DaJuan has a Dell computer with a quad core processor and has recently upgraded his RAM.

Apply the troubleshooting methodology to help DaJuan understand and resolve his problem. The steps of the methodology are listed for you. Copy them into a document and use them to write suggestions for DaJuan at each step.

1.Identify the Problem
2.Internet Research
3.Establish a Theory of Probable Cause
4.Test the Theory
5.Establish a Plan of Action
6.Implement the Solution or Escalate
7.Verify Full System Functionality
8.Document Findings.

Answers

Answer:

4 beeps indicate a Memory Read / Write failure. Try re-seating the Memory module by removing and reinserting it in the slot. This could mean it could've just jiggled loose after a while or dust, there could be a hundred other problems but those are the two most common.n

Explanation:

A Windows user is locked out of her computer, and you must log into the local administrator account HelpdeskAdmin. Which would you use in the username field?

Answers

Answer: .\HelpdeskAdmin

Explanation:

If you wanted to log in as the local administrator then for the Username put a dot (.) and a backslash (\) in front of the Admin username.

The dot(.) will ensure that Windows knows that you are logging into a local computer as the administrator and so will grant you access. The relevant username therefore is, ''.\HelpdeskAdmin''.

I will use  .\HelpdeskAdmin as the username field.

What is a username field?

The username-field is known to be a kind of command that is said to specifies the value for the name that shows the characteristics in the login form and it is one that identifies the username field.

Note that the use of the .\HelpdeskAdmin as the username field is the right thing to do as the dot(.) will make sure that the Windows knows that the user is logging into a computer as the administrator.

Learn more about  local administrator from

https://brainly.com/question/14364696

Which of the following is NOT solely an Internet-based company?
Netflix®
Amazon®
Pandora®
CNN®

Answers

Answer:

I think it's Pandora, though I am familiar with others

Answer:

CNN

Explanation:

In HTML5, the
(line break) tag does not require a closing tag.


true or false

Answers

True in HTML 5 line break tag doesn’t require closing tag

in your own experience,imagine if someone gained access to any of your social media accounts they could changed your account name,password and recovery data in order to lock you out and take total control. they could even go as far as pretending to be you and send out compromised messages to your contacts and this list is endless really. To help you stay safe from hackers and protect your social media accounts​

Answers

Answer: yes

Explanation: because they now have your info

Write a program that asks the user to enter a 10-character telephone number in the format XXX-XXX-XXXX. The application should display the telephone number with any alphabetic characters that appeared in the original translated to their numeric equivalent. For example, if the user enters 555-GET-FOOD, the application should display 555-438-3663.

Answers

In python:

number = input("Enter a 10-character phone number: ")

for i in number:

   if i.isalpha():

       if i == "A" or i == "B" or i == "C":

           i = "2"

       elif i == "D" or i == "E" or i == "F":

           i = "3"

       elif i == "G" or i == "H" or i == "I":

           i = "4"

       elif i == "J" or i == "K" or i == "L":

           i = "5"

       elif i == "M" or i == "N" or i == "O":

           i = "6"

       elif i == "P" or i == "Q" or i == "R" or i == "S":

           i = "7"

       elif i == "V" or i == "T" or i == "U":

           i = "8"

       elif i == "W" or i == "X" or i == "Y" or i == "Z":

           i = "9"

   print(i, end="")

I hope this helps!

Code:

def phonenumber():

alpha = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']

n =[2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,9]

phone = input('Enter phone number in format of XXX-XXX-XXXX : ').upper()

index = 0

for index in range(len(phone)):

if phone[index].isalpha():

print (n[alpha.index(phone[index])], end = ' ')

else:

print (phone[index], end = ' ')

phonenumber()

Compilation output is attached below:

Learn More:https://brainly.com/question/15687460

"Jean-luc Doumont notes that slide software is an effective presentation tool, especially when the speech goal is to:"

Answers

Hi, your question is incomplete. Here are the options:

A. persuade the audience.

B, encourage critical thinking.

C. increase discussion.

D. relay detailed information

Answer:

D. relay detailed information

Explanation:

Indeed, slide software (like MS Powerpoint) would be an effective presentation tool, especially when the speech goal is to relay detailed information.

For example, a graph showing the exponential growth in the number of smartphone users in the United States for the last 15 years would be effectively presented using a slide that shows this data because it will allow the audience to easily see the detailed information.

The intentional defacement or destruction of a website is called: Group of answer choices spoofing. cybervandalism. cyberwarfare. phishing. pharming.

Answers

Answer:

cybervandalism

Explanation:

The intentional defacement or destruction of a website is called cybervandalism. This ultimately implies that, cybervandalism is carried out or done by someone through the use of computer technology such as an internet to destroy data (informations).

Additionally, the defacement or destruction of a website simply means changing the appearance and data relating a website. Some of the tools use for cybervandalism is a file transfer protocol (FTP), structured query language (SQL) injection etc.

In may 2005, President Donald Trump's Wikipedia web page was vandalized by an attacker.

It should be noted that intentional defacement or destruction of a website is called cybervandalism.

Cybervandalism can be regarded as the damage or destruction which is been carried out in digital form.

It may involves the cyber vandals which involves the defacing of a website.

Therefore, cybervandalism serves as intentional defacement or destruction of a website.

Learn more about cybervandalism at;

https://brainly.com/question/11408596

Write a program whose inputs are three integers, and whose output is the smallest of the three values. Use else-if selection and comparative operators such as '<=' or '>=' to evaluate the number that is the smallest value. If one or more values are the same and the lowest value your program should be able to report the lowest value correctly. Don't forget to first scanf in the users input.

Ex: If the input is: 7 15 3
the output is: 3

You should sketch out a simple flowchart to help you understand the conditions and the evaluations needed to determine what number is the correct answer. This type of tool can help determine flaws in a logical design.

Answers

Answer:

The Program written in C is as follows:

#include <stdio.h>

int main() {

   int num1, num2, num3, smallest;

   printf("Enter any three numbers: ");

   scanf("%d", &num1);    scanf("%d", &num2);    scanf("%d", &num3);

   if(num1 <= num2 && num1 <= num3) {

       smallest = num1;

   }

   else if(num2 <= num1 && num2 <= num3) {

       smallest = num2;

   }

   else {

       smallest = num3;

   }

   printf("Smallest: ");

   printf("%d", num3);

   return 0;

}

Explanation:

This line declares necessary variables

int num1, num2, num3, smallest;

This line prompts user for input of three numbers

   printf("Enter any three numbers: ");

This lines get input for the three numbers

   scanf("%d", &num1);    scanf("%d", &num2);    scanf("%d", &num3);

The following if/else statements determine the smallest of num1, num2 and num3 and assigns to variable smallest, afterwards

   if(num1 <= num2 && num1 <= num3) {

       smallest = num1;

   }

   else if(num2 <= num1 && num2 <= num3) {

       smallest = num2;

   }

   else {

       smallest = num3;

   }

The next two lines print the smallest value

   printf("Smallest: ");

   printf("%d", num3);

The two statements belowchar dance1[ ] = {'F','o','x','t','r','o','t'};String dance2 = new String(dance1);will generate an error message:

a. because char variables and String variable do not mix.
b. will generate an error message because char variables and String variable do not mix.
c. show that a String variable, like dance2, is an array.
d. demonstrate that a character array can be used to construct a String object.
e. prove that character variables and String variables are identical.

Answers

Answer:

D. Demonstrate that a character array can be used to construct a String object.

Explanation:

Option D answers the question.

This is so because:

The first line of the code segment creates a char array element i.e. dance1

The second line of the code segment creates a String variable, dance2.

dance2 is then initialised by concatenating the elements in dance1.

i.e. The value of dance2 is

dance2 = "Foxtrot"

Hence, option D answers the question

what is scientific and​

Answers

Answer:

And what??????????????

And what? You didn’t finish

create a boolean variable called sucess that will be true if a number is between -10 and 10 inclusively python

Answers

Answer:

success = -10 <= number <= 10

Explanation:

I check that -10 is less than or equal to number, and number is less than or equal to 10.

Write code that Uses the range() in a for loop to iterate over the positions in user_names in order to modify the list g

Answers

Answer:

Explanation:

The range() function is a built-in function in the Python programming language. In the following code, we will use this function to iterate over all the positions in the array called user_names and add them to the list g. (assuming that is what was meant by modifying the list g)

for i in range( len(user_names) ):

   g.append(user_names[i])

This simple 2 line code should do what you are asking for.

James uses a database to track his school's football team. Which feature in a database allows James to find a specific player by name?

Grid
Filter
Search
Sort

Answers

Search if he knows the players name

Answer:

search

Explanation:

Jax needs to write a block of code that will organize a list of items alphabetically. Which function should he use? append() print() sort() order()

Answers

In python, the sort() function will alphabetically sort a list of strings

To write a block of code that will organize a list of items alphabetically  In python, the sort() function will alphabetically sort a list of strings.

What is python?

A high-level, all-purpose programming language is Python. Code readability is prioritized in its design philosophy, which makes heavy use of indentation. Python uses garbage collection and has dynamic typing. It supports a variety of paradigms for programming, including functional, object-oriented, and structured programming.

Python is a popular computer programming language used to create software and websites, automate processes, and analyze data. Python is a general-purpose language, which means it may be used to make many various types of applications and isn't tailored for any particular issues.

Sorting in Python simply means putting the data in a specific format or order. The order of the data pieces can be sorted either ascendingly or descendingly. Python programming contains certain built-in functions that allow you to sort the list's elements, just like C++ and Java.

Therefore, Thus option (C) is correct.

Learn more about python here:

https://brainly.com/question/18502436

#SPJ2

If the propagation delay through a full-adder (FA) is 150 nsec, what is the total propagation delay in nsec of an 8-bit ripple-carry adder

Answers

Answer:

270 nsec

Explanation:

Ripple-carry adder is a combination of multiple full-adders. It is relatively slow as each full-adder waits for the output of a previous full-adder for its input.

Formula to calculate the delay of a ripple-carry adder is;

  = 2( n + 1 ) x D

delay in a full-adder = 150 nsec.

number of full-adders = number of ripple-carry bits = 8

 = 2 ( 8 + 1 ) x 150

 = 18 x 150

 = 270 nsec

Given the dictionary, d, find the largest key in the dictionary and associate the corresponding value with the variable val_of_max. For example, given the dictionary {5:3, 4:1, 12:2}, 2 would be associated with val_of_max. Assume d is not empty.

Answers

Answer:

Here is the Python program:

d = {5:3, 4:1, 12:2}

val_of_max = d[max(d.keys())]

print(val_of_max)

Explanation:

The program works as follows:

So we have a dictionary named d which is not empty and has the following key-value pairs:

5:3

4:1

12:2

where 5 , 4 and 12 are the keys and 3, 1 and 2 are the values

As we can see that the largest key is 12. So in order to find the largest key we use max() method which returns the largest key in the dictionary and we also use keys() which returns a view object i.e. the key of dictionary. So

max(d.keys()) as a whole gives 12

Next d[max(d.keys())]  returns the corresponding value of this largest key. The corresponding value is 2 so this entire statement gives 2.

val_of_max = d[max(d.keys())] Thus this complete statement gives 2 and assigns to the val_of_max variable.

Next print(val_of_max) displays 2 on the output screen.

The screenshot of program along with its output is attached.

Plz answer me will mark as brainliest ​

Answers

Answer:

True

Operating System

Booting

True or false? The following deterministic finite-state automaton recognizes the set of all bit strings such that the first bit is 0 and all remaining bits are 1’s.

Answers

Answer:gjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj

Explanation:

The purpose of performance profiling (experimental analysis) is to measure the program/algorithm performance. Assume that you have performed an experimental analysis of an algorithm, and profiling returned the following
times: for instances of sizes 2^10, 2^11, 2^12, 2^13, 2^14
the corresponding times are approximately 300 , 510 , 905 , 1750 , 3305 milliseconds.
In these collected running times, there is an extra overhead resulting from clocking program performance and OS functions calls, and this overhead has to be considered in analyzing data. That is, the measured time consists of two components: the time for executing the operations, plus the overhead from profiling.
The estimated overhead due to profiling is about 100 milliseconds independently of the input size. (that is, 100 is always an additive ``constant'' in the collected times).
Based on these experimental results, what is the running time, as a function of the problem size, for executing this algorithm? (c is a constant).
A. O(underroot(n)).
B. O(n^2).
C. O(n).
D. None of the listed.
E. O(n log n).

Answers

Answer:

C. O(n).

Explanation:

for better understanding, the os is a program that helps in telling how much resources can be used and when processor can be accessed.

to each programme data structures would load and unload every time that a programme is to be run.

while a programme is being managed there would be extra overheads and based on whatever type of os or programme that this is, it may or may not have fixed overhead

from our question overhead is fixed at 100ms

we have,

net time as: 300-100, 510-100, 905-100, 1750-100, 3305-100,

which is, 200, 410, 805, 1650, 3205

when we double 2¹ to 2¹¹ to 2¹² etc, the programme ran is also doubling

this says that run time is same as size of instance n

O(n)

Write a program which:

Allows the user to input any of the following string: A1, A2, B1, B2, C1, C2

If the input is from the A category, the program must output "Footwear: ". And if the input is A1 it should output "Shoes" and if A2 it should output "Trainers"

B should output "Tops: "

B1 "Jackets"

B2 "TShirts"

C "Pants: "

C1 "Trousers"

C2 "Shorts"

If the user has not entered the correct data, the program must output "Incorrect input"

Answers

Answer:

Ill do this in C# and Java

Explanation:

C#:

public static void Main(string[] args)

       {

           string input = Console.ReadLine();

               switch (input)

               {

                   case "A1":

                       Console.WriteLine("Footwear:");

                       Console.WriteLine("Shoes");

                       break;

                   case "B1":

                       Console.WriteLine("Tops:");

                       Console.WriteLine("Jackets");

                       break;

                   case "C1":

                       Console.WriteLine("Pants:");

                       Console.WriteLine("Trousers");

                       break;

                   case "A2":

                       Console.WriteLine("Footwear:");

                       Console.WriteLine("Trainers");

                       break;

                   case "B2":

                       Console.WriteLine("Tops:");

                       Console.WriteLine("TShirts");

                       break;

                   case "C2":

                       Console.WriteLine("Pants:");

                       Console.WriteLine("Shorts");

                       break;

                   default:

                       Console.WriteLine("Incorrect Input");

                       break;

               }

       }

Java:

public static void main(String[] args)

   {

       Scanner myObj = new Scanner(System.in);  // Create a Scanner object

       String input = myObj.nextLine();

       {

           switch (input)

               {

                   case "A1":

                       System.out.println("Footwear:");

                       System.out.println("Shoes");

                       break;

                   case "B1":

                       System.out.println("Tops:");

                       System.out.println("Jackets");

                       break;

                   case "C1":

                       System.out.println("Pants:");

                       System.out.println("Trousers");

                       break;

                   case "A2":

                       System.out.println("Footwear:");

                       System.out.println("Trainers");

                       break;

                   case "B2":

                       System.out.println("Tops:");

                       System.out.println("TShirts");

                       break;

                   case "C2":

                       System.out.println("Pants:");

                       System.out.println("Shorts");

                       break;

                   default:

                       System.out.println("Incorrect Input");

                       break;

               }

       }

Other Questions
does symbolic interactionsim make sense? How? For a given recipe, 12 cups of flour are mixed with 24 cups of sugar. How many cups of sugar should be used if 21 cups of flour are used?Assuming a constant ratio, fill out the table of equivalent ratios until you have found the value of x. PLEASE ANSWER THIS QUICK This goal describes the goal of keeping things peaceful inside America:APromote the general welfareBestablish justiceCinsure domestic tranquilityDsecure the blessings of liberty Help me please............... i mark as brainliest Commutative property can be expressed as Journalize the following business transactions in general journal form. Identify each transaction by number. You may omit explanations of the transaction. (Credit account titles are automatically indented when the amount is entered. Do not indent manually. If no entry is required, select "No Entry" for the account titles and enter 0 for the amounts.) 1. Stockholders invest $40,000 in cash in starting a real estate office operating as a corporation. 2. Purchased $500 of supplies on credit. 3. Purchased equipment for $25,000, paying $3,500 in cash and signed a 30-day, $21,500, note payable. 4. Real estate commissions billed to clients amount to $4,000. 5. Paid $700 in cash for the current month's rent. 6. Paid $250 cash on account for office supplies purchased in transaction 2. 7. Received a bill for $800 for advertising for the current month. 8. Paid $2,500 cash for office salaries. 9. Paid $1,200 cash dividends to stockholders. 10.Received a check for $2,000 from a client in payment on account for commissions billed in transaction 4. i need the correct conjugation of verb in present tense 21. A toy car starts from rest and begins to accelerate at 11.0 m/s2. What is the toycar's final velocity after 6.0 seconds? If you could change one thing in the world what would it be?1 Paragraph 3x + 22x + 35Factor the trinomialHelp guys asp!! Please solve that problem my homework is due -3(2t - 1) = t + t + t + 3 Conjugate the following verbs to the present tense. 1. Comer: Yo_________, Tu ______________, El/Ella/Usted ________________, Nosotros/as ____________, Ustedes, Ellos/as ____________.2. Bajar: Yo_________, Tu ______________, El/Ella/Usted ________________, Nosotros/as ____________, Ustedes, Ellos/as ____________.3. Pintar: Yo_________, Tu ______________, El/Ella/Usted ________________, Nosotros/as ____________, Ustedes, Ellos/as ____________.4. Aburrir: Yo_________, Tu ______________, El/Ella/Usted ________________, Nosotros/as ____________, Ustedes, Ellos/as ____________.5. Partir: Yo_________, Tu ______________, El/Ella/Usted ________________, Nosotros/as ____________, Ustedes, Ellos/as ____________.6. Fingir: Yo_________, Tu ______________, El/Ella/Usted ________________, Nosotros/as ____________, Ustedes, Ellos/as ____________.7. Beber: Yo_________, Tu ______________, El/Ella/Usted ________________, Nosotros/as ____________, Ustedes, Ellos/as ____________.8. Patinar: Yo_________, Tu ______________, El/Ella/Usted ________________, Nosotros/as ____________, Ustedes, Ellos/as ____________.9. Correr: Yo_________, Tu ______________, El/Ella/Usted ________________, Nosotros/as ____________, Ustedes, Ellos/as ____________.10. Saltar: Yo_________, Tu ______________, El/Ella/Usted ________________, Nosotros/as ____________, Ustedes, Ellos/as ____________. In her science classroom Jane noticed that the lengths (in inches) and the weights (in ounces) of the class's pet snakes were directly related by the equation y = kx, where x is the length and y is the weight. Use the information in the table to find k, the constant of proportionality?A.25.0 B.27.5 C.30.0 D.32.5 Fluids fill in the spaces between the particles of sediment andcrystallize to create a rock bya Clasticb CompactionC Crystallizationd Cementation Find the total surface area of this cuboid.5 cm4 cm6 cm need someone to draw this pls not the background just the fabric and the shapes. It would help me alot thanks. Pls in pencil How did a network of roads maintain peace and unity in the Persian empire? what medical career is this? a health care professional who focuses on ensuring proper alignment of the spine and normal operation of the nervous system to maintain health