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.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section4.3: Nested If Statements
Problem 7E
icon
Related questions
Question

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:

  1. Count the number of digits in the input number: Suppose if the input number is 3561, output should be 4.

 

  1. Compute the sum of digits in the input number: Suppose if the input number is 3561, output should be 3+5+6+1 = 15.

 

  1. Reverse the digits of the given number: Suppose if the input number is 3561, output should be 1653.

 

  1. 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:

  1. Algorithm for each task
  2. Time complexity of each task.
  3. Tracing of each task by considering the number formed out of your name as the input.
  4. 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.

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning