0% found this document useful (0 votes)
20 views

Topic

The document contains 17 questions asking to write programs in Java to perform various tasks like calculating student divisions based on percentages, determining character types, nested for loops, prime and composite number counting, ASCII values, recursive factorials, linear searches, array reversals, bubble sorts, Fibonacci series, random number generation, duplicate removal, simulating a cricket game between two teams, and a number guessing game.

Uploaded by

Syed Ahmad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Topic

The document contains 17 questions asking to write programs in Java to perform various tasks like calculating student divisions based on percentages, determining character types, nested for loops, prime and composite number counting, ASCII values, recursive factorials, linear searches, array reversals, bubble sorts, Fibonacci series, random number generation, duplicate removal, simulating a cricket game between two teams, and a number guessing game.

Uploaded by

Syed Ahmad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Questions Statement

1. Write a program to calculate the percentage that is obtained by a student


in 5 different subjects then return division. The student gets a division
as per the following rules:
Percentage above or equal to 60 - First division
Percentage between 50 and 59 - Second division
Percentage between 40 and 49 - Third division
Percentage less than 40 – Fail
2. Write a program to find whether a given character is a number, upper
case alphabet, lower case alphabet or a special symbol.
3. Write a program to print tables from 1 to 10 till 12 max number by using
nested for loop.
4. Write a program to enter the numbers till the user wants and at the end it
should display the total number of prime and composite numbers.
5. Write a program to print the prime numbers between 5 and 1000 and also
count them.
6. Write a program to print all the ASCII values and their equivalent
characters using a while loop. The ASCII values vary from 0 to 255.
7. Write a program to enter the numbers till the user wants and at the end it
should display the total number of prime and composite numbers!
8. WAP to find the area, circumference and diameter of a circle through
using individual functions with just one parameter radius.
9. Write a program to find the factorial of a number using recursive function
10. Write a program to find an element in an array by using linear
search algorithm.
11. Write a program to reverse all the elements of the array i.e.
1,2,3,4,5 becomes 5,4,3,2,1.
12. Write a program to sort the elements of array in ascending order or
descending order using Bubble sort.
13. Write a program to show the Fibonacci series to a given extent.
14. Write a program to generate random numbers between 1 and 6 for
a number of 20 times.
15. Write a program to delete all the duplicates of a value from an array
(by deletion means make the duplicates zero)
16. Create a cricket game between two teams with 5 overs. Suppose
there are only 5 batsman allowed per team and there are no wide and no
balls. Batsman can score 0 to 6 per ball. If he scores 0 he is out. Play both
teams 5 overs and the team with greater score wins.
17. Create a guess game in java. Computer will generate a number
between the ranges given by the user. The user will guess a number
between the given range and the computer will tell if it is correct guess
or wrong. If the user number is greater than the generated number then
the computer will tell him that the user number is greater than the original
number. There will be only 5 tries.

You might also like