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).
The default RDP port is 3389 but can be configured in the range of <span>49152-65538</span>
Answer:
int sumAll(int n)//function definition.
{
if(n==1)//if condition.
return 1;
else//else condition.
{
return n+sumAll(n-1);//return the value and call the function in recursive manner.
}
}
Explanation:
- The above-defined function is a recursive type function that is written in the c language, which holds the if and else condition.
- When the user passes the largest value from 1, then the else condition will be executed which adds the largest value and pass the value after the decrement of the value as an argument.
- When the value will become 1, then the function if-block will be executed which returns the value and ends the calling function recursively.
Firstly we explain the variable and the declaration rule for the variable and further separating the valid and invalid variables.
- Whenever a user is given a question, variables are data values that can vary. for example age, CSL, etc.
- It may alter and during the execution of the program.
- It's a storage space for memories.
- It has a name that corresponds to the location.
- Data is stored in the memory location.
The rule for variable declaration:
- The names of your variables should be based on the phrases used in the subject area, and they should reflect the variable's function.
- By removing spaces between the words, you can make variable names. Each word in the name should be capitalized, including prepositions and pronouns that are one letter long.
- An underscore should never be used to start a variable name.
- Single-character variable names should be avoided. For loop counters, only short variable names are permitted.
- After the state that equals the "true" value, name variables that describe binary states ("true" or "false").
The valid variable is:
CSL, Age,CLS,SEE,Stop5for,Give, $shopping, and United.
The invalid variable is:
Mark-sheet, Tel $, Simple Interest, and 545Newton.
Learn more:
brainly.com/question/2684763
Answer:
To protect the computer network of a large organization, network engineers monitor network traffic. Malware detection method of data mining best being used to protect the network.
Explanation:
Data mining has excellent potential as a malware detection tool. It allows us to analyze vast sets of information and gives an opportunity to extract new data from it. It also provides the ability to identify both known and zero-day attacks.