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

Project 3 STD 10

Uploaded by

thedarklord.sc
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Project 3 STD 10

Uploaded by

thedarklord.sc
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

CLASS X

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 1: Write a program using a method Number() to perform the following


task:
Accept a number from the user and display it in its Binary Equivalents.
For example:
Sample Input: (21)10
Sample Output: (10101)2
1
Question 2:
Design a class to overload a function manip() as follows:
1) void manip(String str, int p) with one String argument and one integer
argument. It displays the characters of even positions of String, if p is an
even number otherwise, it displays the characters of odd positions.
2) void manip(int a, char ch) with one integer argument and one character
argument. It computes the square root of the integer arguments if ch is 's',
else it computes the cube root of the integers.

Question 3:

Design a class to overload a function compare( ) as follows:

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:

Write a program to store 20 numbers in a Single Dimensional Array (SDA). Now,


display only those numbers that are perfect squares.

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:

Write a program using a class with the following specifications:


Multiple Choice Questions
Chapter: String Handling

1)State the output of the following program segment:

String str1= "great"; String str2= "minds";

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.

String s = "4.3756"; int n = s.indexOf('.'); int

characteristic=Integer.parseInt(s.substring(0,n)); int

mantissa=Integer.valueOf(s.substring(n+1));

3) Write the output for the following:

String s="Today is Test" ;

System.out.println(s.indexOf('T'));
System.out.println(s.substring(0,7) + " " +"Holiday");

4) Give the output of the following string functions:

(i) "ACHIEVEMENT".replace('E', 'A')

(ii) "DEDICATE".compareTo("DEVOTE")

5) Consider the following String array and give the output

String arr[]= {"DELHI", "CHENNAI", "MUMBAI", "LUCKNOW", "JAIPUR"};

System.out.println(arr[0].length()> arr[3].length());

System.out.print(arr[4].substring(0,3)); 6)

Write the output for the following:

String s1 = ''phoenix''; String s2 =''island'' ;

System.out.println (s1.substring(0).concat (s2.substring(2) ) );

System.out.println(s2.toUpperCase());

7) String x[] = {"Artificial intelligence", "IOT", "Machine learning", "Big data"};

Give the output of the following statements:

(i) System.out.println(x[3]);

(ii) System.out.println(x.length)

8) Give the output of the following string methods: "MISSISSIPPI".indexOf('S')+

"MISSISSIPPI".lastIndexOf('I')

9) Give the output of the following java statements:

(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.

(ii) Extract the second character of the string str.

Chapter: Revision of Std IX syllabus


1) Predict output of the following:

(i) Math.pow(25,0.5)+Math.ceil(4.2)

(ii) Math.round ( 14.7 ) + Math.floor ( 7.9)

2) What is the output of the following:

String a="Java is programming language \n developed by \t\'James Gosling\'";

System. out. println(a);


3) Write the prototype of a function search which takes two arguments a string

and a character and returns an integer value

4) Rewrite the following condition without using logical operators:

if ( a>b || a>c )

System.out.println(a);

5) n=1000; while (n>10)

{ n=n/10;

System.out.println(n); How many time the loop is executed and what is the
output?

6) Study the method and answer the given questions.

public void sampleMethod()

{ for(int i=0;i<3;i++)

{ for(int j=0;j<2;j++)

{int number = (int)(Math.random() * 10);

System.out.println(number); }}}

(i) How many times does the loop execute?

(ii)What is the range of possible values stored in the variable number? 7)

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" ); }

(i) How many times does the inner loop execute?

(ii) Write the output of the program segment.

8) What are the values stored in variables r1 and r2:

(i) double r1 = Math.abs(Math.min(-2.83, -5.83));

(ii) double r2 = Math.sqrt(Math.floor(16.3));

9) Convert the following if else if construct into switch case

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:

int i; for ( i = 5 ; i > 10;

i ++ )

System.out.println( i );

System.out.println( i * 4 );

You might also like