Part-B: Problem Description: Consider a four digit number corresponding to number of letters in your full name. Input this number in your program to compute the below: Count the number of digits in the input number: Suppose if the input number is 3561, output should be 4. Compute the sum of digits in the input number: Suppose if the input number is 3561, output should be 3+5+6+1 = 15. Reverse the digits of the given number: Suppose if the input number is 3561, output should be 1653. Count the number of odd numbered digits in the given number. Suppose if the input number is 3561, output should be 3 since there are three odd numbered digits (3, 5, and 1). Include the below in the report: Algorithm for each task Time complexity of each task. Tracing of each task by considering the number formed out of your name as the input. Java program along with screenshot of the solution to all four tasks [Number should correspond to your full name]. How to consider the input number for your name? If your name is Mohamed Said Ali Albalushi “Mohamed” has 7 digits “Said” has 4 digits “Ali” has 3 digits “Albalushi” has 9 digits. So consider 7439 as the input number in Part-B tasks.
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Part-B:
Problem Description:
Consider a four digit number corresponding to number of letters in your full name. Input this number in your
- Count the number of digits in the input number: Suppose if the input number is 3561, output should be 4.
- Compute the sum of digits in the input number: Suppose if the input number is 3561, output should be 3+5+6+1 = 15.
- Reverse the digits of the given number: Suppose if the input number is 3561, output should be 1653.
- Count the number of odd numbered digits in the given number. Suppose if the input number is 3561, output should be 3 since there are three odd numbered digits (3, 5, and 1).
Include the below in the report:
Algorithm for each task- Time complexity of each task.
- Tracing of each task by considering the number formed out of your name as the input.
- Java program along with screenshot of the solution to all four tasks [Number should correspond to your full name].
How to consider the input number for your name?
If your name is Mohamed Said Ali Albalushi
“Mohamed” has 7 digits
“Said” has 4 digits
“Ali” has 3 digits
“Albalushi” has 9 digits.
So consider 7439 as the input number in Part-B tasks.
Step by step
Solved in 2 steps with 2 images