0% found this document useful (0 votes)
14 views19 pages

SC Working With Array and String 01

The document outlines a series of Java programming tasks involving arrays and strings, including operations such as sorting, averaging, and matrix manipulation. It also includes tasks related to date and time handling, as well as string methods and palindrome checking. Each task specifies input and output requirements for the programs to be developed.

Uploaded by

patelkalapana54
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views19 pages

SC Working With Array and String 01

The document outlines a series of Java programming tasks involving arrays and strings, including operations such as sorting, averaging, and matrix manipulation. It also includes tasks related to date and time handling, as well as string methods and palindrome checking. Each task specifies input and output requirements for the programs to be developed.

Uploaded by

patelkalapana54
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Working with Array and String

1. Write a java program to declare marks as array variable, assign the


different values and print these array elements.

Input:

Output:
2. Write a Java program to sort the 10 array elements using
[Link]()

Input:

Output:
3. Write a Java program to find the average of 10 array elements.

Input:

Output:
4. Write a Java program to find maximum marks from 20 array elements.

Input:

Output:
5. Write a Java program to print matrices of 2x2, 4x5.

Input:

output:
6. Write a java program to add two matrices

Input:

Output:
7. Write a java program to subtract two matrices

Input:

Output:
8. Write a java program to multiply two matrices.

Input:
Output:

9. Write a Java program to demonstrate String class

Input:
Output:

10. Write a Java program to show the uses of string methods


( equals(),equalignoreCase(),compareTo(), compareToignoreCase(),
toLowerCase(), toUpperCase(), concat(), length()).

Input:
Output:

11. Java program to Print current system date.

Input:

Output:
12. Java program to print current system time.

Input:

Output:

13. Java Program to show the uses of Calendar

Input:
Output:
14. Write a program that uses an array to store 12 values of hourly
temperature of a day from 6 am to 6 pm. Use either initialization or
assignment statements to assign these values. Print maximum and
minimum temperature of the day.

Input:

Output:
15. Write a program that stores weekly sale of five salespersons. A sales
person is given a weekly incentive depending upon his/her average weekly
sale. Incentive is: 10% if average weekly sale is up to Rs. 10000, 15% if
average weekly sale is above Rs.10000 but less than or equal to Rs 30000
and 20% if average weekly sale is above Rs. 30000. Compute total daily
sale of all salespersons combined together. Also compute weekly incentive
for each salesperson.

Input:
Output:
16. Write a program to see whether a string is palindrome or not. (String is
palindrome if its reverse is same as original, example "1771", "madam")

Input:

Output:
17. Write a program to print current date in the format "DD-MMM-
YYYY". For example, 17th November 2013 should be printed as 17-Nov-
2013. Also print the day of week in words.

Input:

Output:
18. Write a program to set the date and time as per your birth date and
time. Print the week day on your birthday.

Input:

Output:

You might also like