Project 3 STD 10
Project 3 STD 10
SUBJECT-COMPUTER APPLICATIONS
Assignments to be completed for the academic year(2022-23)
Project 3:
Instructions:
➢ Submission date: 7th November 2022
➢ For the project refer Std X ICSE Understanding Computer Applications
with BlueJ textbook ➢ All written matter will be in black.
➢ You have to write in the same project notebook in which the earlier
assignments are done.
➢ Neat presentation is essential.
Question 3:
1. void compare(int, int) — to compare two integers values and print the
greater of the two integers.
2. void compare(char, char) — to compare the numeric value of two
characters and print with the higher numeric value.
3. void compare(String, String) — to compare the length of the two strings
and print the longer of the two.
Question 4:
Question 5:
Write a program to input and store roll numbers, names and marks in 3 subjects of
n number of students in five single dimensional arrays and display the remark based
on average marks as given below:
Question 6:
To get promotion in a Science stream, a student must pass in English and should
pass in any of the two subjects (i.e.; Physics, Chemistry or Maths). The passing
mark in each subject is 35. Write a program in a Single Dimension Array to accept
the roll numbers and marks secured in the subjects for all the students. The program
should check and display the roll numbers along with a message whether
"Promotion is Granted" or "Promotion is not Granted". Assume that there are 40
students in the class.
Question 7:
Write a class program with the following specifications:
Class Name — Triplet Data
Members — int a, b, c
Member Methods:
void getdata() — to accept three numbers
void findprint() — to check and display whether the numbers are Pythagorean
Triplets or not.
Question 8 :
Define a class Interest having the following description:
Write a program to compute the interest according to the given conditions and
display the output.
Question 9 :
Define a class called 'Mobike' with the following specifications:
Question 10:
System.out.println(str1.substring(0,2).concat(str2.substring(1)));
System.out.println(("WH"+(str1.substring(2).toUpperCase())));
2) State the value of characteristic and mantissa when the following code is
executed.
characteristic=Integer.parseInt(s.substring(0,n)); int
mantissa=Integer.valueOf(s.substring(n+1));
System.out.println(s.indexOf('T'));
System.out.println(s.substring(0,7) + " " +"Holiday");
(ii) "DEDICATE".compareTo("DEVOTE")
System.out.println(arr[0].length()> arr[3].length());
System.out.print(arr[4].substring(0,3)); 6)
System.out.println(s2.toUpperCase());
(i) System.out.println(x[3]);
(ii) System.out.println(x.length)
"MISSISSIPPI".lastIndexOf('I')
(i) "TRANSPARENT".toLowerCase();
(ii) "TRANSPARENT".compareTo("TRANSITION")
10) Write a java statement for each to perform the following task:
(i) Find and display the position of the last space in a string str.
(i) Math.pow(25,0.5)+Math.ceil(4.2)
if ( a>b || a>c )
System.out.println(a);
{ n=n/10;
System.out.println(n); How many time the loop is executed and what is the
output?
{ for(int i=0;i<3;i++)
{ for(int j=0;j<2;j++)
System.out.println(number); }}}
Analyze the given program segment and answer the following questions:
for(int i=3;i<=4;i++ )
{ for(int j=2;j<i;j++ ) {
System.out.print("" ); }
System.out.println("WIN" ); }
if( var==1)
System.out.println("good"); else
if(var==2)
System.out.println("better"); else
if(var==3)
System.out.println("best"); else
System.out.println("invalid")
10) Give the output of the following program segment and also
mention how many times the loop is executed:
i ++ )
System.out.println( i );
System.out.println( i * 4 );