Question
Asked by:
zkusnierz
zkusnierz
Rating : No Rating
Questions Asked: 2
Tutorials Posted: 1, earned $0.00
 

$25.00 Java Programming

Q:

You are to write a program that reads a positive integer from the keyboard and performs the following :

  1. Finds and prints its least significant digit.
  2. Finds and prints its most significant digit.
  3. Finds and prints  its smallest digit
  4. Finds and prints its largest digit.
  5. Checks to see whether the input  integer is a prime number and prints the result.
  6. Find  and print its Octal representation. (You have to find Octal by deviding the number by 8, like using math instead of using formula) Print the octal number
  7. Checks to see whether the input integer is a palindrome and print the result .
  8. Computes number of cases processed by the program and prints the result.

 

As long as the user desires to repeat the above computation, your program shold ask for another integer and print out the results. At the end of theprogram (when the suer decides to quit), your program should print out the number of cases during that run.

 

You should use self –contained methods to do the subtasks in your program.

 

Example:

Input the Number: 3456

 

Output:

 Least significant digit is 6

Most significant digit is 3

Smallest number is 3

Largest digit is 6

…………..

………..

 

 

Notes: I think, you have to break the integer into single digit and then create int array using %10 .

 


   
   
   
   
 
Available Tutorials to this Question
Posted by:
CMBLUE
CMBLUE
Rating (17): A+
Questions Asked: 0
Tutorials Posted: 74, earned $284.70
 

$15.00 Commented and verrified program

  • This tutorial hasn't been purchased yet.
  • Posted on Sep 12, 2009 at 7:46:02PM
A:
Preview: ... a header comment because I don't ...

The full tutorial is about 34 words long plus attachments.

Attachments:
NumberInfo.java (6K) (Preview)
Posted by:
 

$20.00 Easily Understandable and A+ confirmation tutorial

  • This tutorial was purchased 1 time and rated A+ by students like you.
  • Posted on Sep 13, 2009 at 11:03:55PM
A:
Preview: ... git(a[1]); // passes least significant value   most_significant_digit(a[size-1]); // passes most significant value       smallest_digit(a,size); // passes the array contents and size of the array to find smallest digit   largest_digit(a,size); // passes the array contents and size of the array to find largest digit   }         static void least_significant_digit(int l) // finds least significant digit   {   System.out.print("\n Least Significant Digit: "+l);   }         static void most_significant_digit(int m) // finds most significant digit   {   System.out.print("\n Most Significant Dig ...

The full tutorial is about 200 words long plus attachments.

Attachments:
number.java (3K) (Preview)
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty