Variable Listing for Java Programs
Variable Data Type Purpose Scope
Name
n int To store the calc()
input
number
sc Scanner To take user calc()
input
r int To store the calc()
reverse of
the number
i int Loop for loop
variable for
reversing
and prime
checking
c int Count of isPrime()
divisors for
checking
prime
Variable Data Type Purpose Scope
Name
l int Lower calc()
range
u int Upper range calc()
sc Scanner To take user calc()
input
i int Loop for loop
variable to
check each
number in
range
s int Sum of isAbundant(
divisors )
Variable Data Type Purpose Scope
Name
n int 5-digit calc()
number
input
sc Scanner To take user calc()
input
l int Largest digit lar()
in the
number
s int Smallest sma()
digit in the
number
c int Count of isComp()
divisors for
composite
check
i int Loop for loop
variable for
digits and
divisors
Variable Data Type Purpose Scope
Name
n int User's calc()
choice for
pattern
l int Number of calc()
lines for
pattern
sc Scanner To take user calc()
input
i int Loop for loop
variable for
rows
j int Loop for loop
variable for
columns
Variable Data Type Purpose Scope
Name
a int Constant Series(int,in
value in t)
series 1
n int Number of Series(int,in
terms t),
Series(int)
sum double To store the Series
sum of methods
series
fact double To store Series(int,in
factorial of t)
numbers
j int Loop for loop
variable for
factorial
calculation
sign int To alternate Series(int)
signs in
series
i double Loop for loop
variable for
series terms
Variable Data Type Purpose Scope
Name
r int Number of PatOverload
rows for ()
pattern
x char Character PatOverload
for pattern ()
rows int Rows input menu()
by user
character2 char Character menu()
input by
user
choice int Menu choice menu()
i int Loop dispPat()
variable for
rows
j int Loop dispPat()
variable for
columns
k int Additional dispPat()
loop
variable for
pattern 1
Sc Scanner To take user menu()
input
Variable Data Type Purpose Scope
Name
bno int Bill number class level
call int Number of class level
calls
amt double Calculated class level
bill amount
name String Customer class level
name
b int Bill number main()
input by
user
calls int Number of main()
calls input
by user
n String Customer main()
name input
by user
sc Scanner To take user main()
input
Variable Data Type Purpose Scope
Name
n int Array size calc()
a int[] Array to calc()
store
numbers
sc Scanner To take user calc()
input
max int Largest calc()
element
min int Smallest calc()
element
max2 int Second calc()
largest
element
s int Sum of calc()
positive
numbers
i int Loop for loop
variable for
array
traversal
Variable Data Type Purpose Scope
Name
m int Size of first calc()
array
n int Size of calc()
second
array
P int[] First array calc()
Q int[] Second calc()
array
R int[] Merged calc()
array
k int Index for calc()
merged
array
sc Scanner To take user calc()
input
min int Index of sort()
minimum
element in
selection
sort
t int Temporary sort()
variable for
swapping
i int Outer loop for loop
variable for
sorting and
merging
j int Inner loop for loop
variable for
sorting