Skip to content

A simple command-line Java application for checking various special numbers (Palindrome, Armstrong, etc.) and performing basic calculations like factorial, mean, and median.

License

Notifications You must be signed in to change notification settings

EPIC-SID/Special_Numbers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Special Numbers Calculator

A simple, robust, command-line Java application for checking various types of "special" numbers and performing a few common mathematical calculations.

Features

This application allows you to check if a given number is:

  • Palindrome: Reads the same forwards and backward (e.g., 121).
  • Spy Number: The sum of its digits equals the product of its digits (e.g., 1124).
  • Armstrong Number: The sum of its own digits, each raised to the power of the number of digits (e.g., 153).
  • Pronic Number: The product of two consecutive integers (e.g., 42 = 6 * 7).
  • Perfect Number: The sum of its proper divisors equals the number itself (e.g., 28).
  • Happy Number: A number which eventually reaches 1 when replaced by the sum of the square of its digits (e.g., 19).
  • Prime Number: A number greater than 1 with only two factors: 1 and itself (e.g., 7).
  • Ugly Number: A positive integer whose prime factors are limited to 2, 3, and 5 (e.g., 6, 10).

It can also perform the following calculations:

  • Factorial: The product of all positive integers up to a given number.
  • Fibonacci Sequence: Generates the first 'n' terms of the Fibonacci sequence.
  • Statistics: Calculate Mean, Median, and Mode of a series of numbers.
  • Number Conversion: Convert between Decimal, Binary, and Hexadecimal.
  • GCD and LCM: Calculate the Greatest Common Divisor and Least Common Multiple of two numbers.
  • Guess the Number Game: A mini-game to guess a random number between 1 and 100.

How to Use

  1. Compile the code:

    javac Special_Numbers.java
  2. Run the application:

    java Special_Numbers
  3. Follow the on-screen menu to select a calculation. The application includes input validation to prevent crashes from non-numeric input.

Technologies Used

  • Java

About

A simple command-line Java application for checking various special numbers (Palindrome, Armstrong, etc.) and performing basic calculations like factorial, mean, and median.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages