0% found this document useful (0 votes)
93 views2 pages

Java Assignment

This document contains 15 Java programming assignments ranging from sorting and manipulating arrays to string manipulation, loops, pattern printing, and number puzzles. Some of the key tasks include: writing a program to sort an array in ascending and descending order; removing duplicate numbers from an array; implementing a menu-driven program with options for 2D arrays, 1D arrays, string manipulation; counting palindromic numbers between two values; calculating the Fibonacci series and sum; and multiplying two 3x3 matrices. It also includes assignments involving loops, number guessing games, character case conversion, and nested pattern printing based on user input.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
0% found this document useful (0 votes)
93 views2 pages

Java Assignment

This document contains 15 Java programming assignments ranging from sorting and manipulating arrays to string manipulation, loops, pattern printing, and number puzzles. Some of the key tasks include: writing a program to sort an array in ascending and descending order; removing duplicate numbers from an array; implementing a menu-driven program with options for 2D arrays, 1D arrays, string manipulation; counting palindromic numbers between two values; calculating the Fibonacci series and sum; and multiplying two 3x3 matrices. It also includes assignments involving loops, number guessing games, character case conversion, and nested pattern printing based on user input.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1/ 2

Java Assignments.

1. Write a program scan array and arrange an Ascending and


descending order.
2. Write a program scan array and find minmum and maximum number with index.
3. Write a program scan array remove all duplicates number and arrange the array
index wise.
for example
10 2 44 2 21 2 10 3
New Array 10 2 44 21 3

4, Write a menu driven program menu as


1. Two D Array ( In this replace all negative numbers by 0)
2. One D Array ( In this store float values and calculate the sum and average
of elements)
3. String ( Scan two strings and stored alternate character into third string)
4. String (Scan two string and check string is equal or not without using
function)

5. Write a program count total palindrom numbers between 300 to 800.

6. Write a program which print the fibonacci series up to n and calculate sum of
all term.

7. Write a program scan two matrx for 3X3 and print the multiplication.

8. Write a program scan value and stored as ASCII format inside the string.
for example input 65 stored A

9. Write a do-while loop that asks the user to enter two numbers. The numbers
should be added and the sum displayed. The loop should ask the user whether he
or she wishes to perform the operation again. If so, the loop should repeat;
otherwise it should terminate.

10.Write a program to enter the numbers till the user wants and at the end it
should display the count of positive, negative and zeros entered.

11. Write a program to print out all Armstrong numbers between 1 and 500. If sum of
cubes of each digit of the number is equal to the number itself, then the
number is called an Armstrong number.
For example, 153 = ( 1 * 1 * 1 ) + ( 5 * 5 * 5 ) + ( 3 * 3 * 3 )
12.Write a program that will print a box of #�s taking from user the height and
width values.

Program Starts:
Enter height:
3
Enter width:
5

Output
###
###
###
###
###

13.You have to design the code such that the user has only three tries to guess the
correct pin of the account. You set the pin as a constant with a final
attribute. When correct display �Correct, welcome back.� When incorrect display
�Incorrect, try again.�. When ran out of tries display �Sorry but you have been
locked out.�

14.Write a program scan string and convert alternate character as upper case.

15.Write a program which print the patteren as


Enter Input 4

* * * *
* * *
* *
*
* *
* * *
* * * *

4 4 4 4
4 4 4
4 4
4
4 4
4 4 4
4 4 4 4

(both pattern print in one program.)

You might also like