Answer:
- def calcSum(d):
- sum = 0
- for x in d:
- sum += int(x)
- return sum
-
- digits = input("Please enter your digits: ")
- print(calcSum(digits))
Explanation:
The solution code is written in Python.
Firstly, create a function that take one input digit string (Line 1).
In the function, create a sum variable with initial value 0.
Use a for loop to traverse through each character in the digit string and in the loop use int method to convert each character to integer and add it to sum variable (Line 3-5) and return the sum as output.
Next, use input function to prompt user enter a digit string (Line 7).
Lastly test the function by passing the input digit as argument and print the result (Line 8).
Answer:
The answer to this question is given below in the explanation section.
Explanation:
First, we need to convert these hexadecimal numbers into decimal numbers, then we can easily identify which one is the lowest hexadecimal.
The hexadecimal numbers are F2, 81, 3C, and 39.
F2 = (F2)₁₆ = (15 × 16¹) + (2 × 16⁰) = (242)₁₀
81 = (81)₁₆ = (8 × 16¹) + (1 × 16⁰) = (129)₁₀
3C = (3C)₁₆ = (3 × 16¹) + (12 × 16⁰) = (60)₁₀
39 = (39)₁₆ = (3 × 16¹) + (9 × 16⁰) = (57)₁₀
The 39 is the lowest hexadecimal number among the given numbers.
Because 39 hex is equal to 57 decimal.
39 = (39)₁₆ = (3 × 16¹) + (9 × 16⁰) = (57)₁₀
Answer:
Explanation:
I noticed the \n, \n will cause the new line break, delete it.
try code below:
<em>System.out.println(" " + " " + "NO PARKING");</em>
<em>System.out.println("2:00 - 6:00 a.m.");</em>
Answer: Let you organize and summarize your data.
Explanation: Data grouping is referred as the making a collection or cluster of data in a report .The group is made for the summarization of the information and makes easily understandable according to the subject or field due to the proper organization.
Other given options are incorrect because it does not provide the total of the report content,attractive form of the data or editing function in report.Thus the correct option is summarizing and organizing the data.