Advertisements
Chapters
2: Class as the Basis of all Computation
▶ 3: User-Defined Methods
4: Constructors
Chapter 5: Library Classes
Chapter 6: Encapsulation
Chapter 7A: Arrays - One Dimension
Chapter 7B: Arrays - Sort & Search
Chapter 7C: Arrays - Double Dimension
Chapter 8: String Handling
Chapter 9: Programs Overall
![Rupa Pandit solutions for कम्प्युटर एपलीकेशंस [इंग्रजी] इयत्ता १० आयसीएसई chapter 3 - User-Defined Methods Rupa Pandit solutions for कम्प्युटर एपलीकेशंस [इंग्रजी] इयत्ता १० आयसीएसई chapter 3 - User-Defined Methods - Shaalaa.com](/images/computer-applications-english-class-10-icse_6:a86debec6313407fa84cd182cd5e7e57.jpg)
Advertisements
Solutions for Chapter 3: User-Defined Methods
Below listed, you can find solutions for Chapter 3 of CISCE Rupa Pandit for कम्प्युटर एपलीकेशंस [इंग्रजी] इयत्ता १० आयसीएसई.
Rupa Pandit solutions for कम्प्युटर एपलीकेशंस [इंग्रजी] इयत्ता १० आयसीएसई 3 User-Defined Methods Exercises [Pages 90 - 95]
Choose the correct option.
The method prototype is ______.
the method name
the method argument list
the declaration of the method
the complete method
The most restrictive access specifier is ______.
private
public
protected
default
______ statement is used for taking the control back to the super method.
void
int
new
return
A method name should be ______.
a keyword
an identifier
an object
a class
A method that does not return any value has return type ______.
void
int
none
null
A method is contained by ______.
an object
a class
a data
a value
Member data of a class are available to:
only public methods
only the private methods
all the methods
none of the methods
Write a method prototype name check() which takes an integer argument and returns a char:
char check()
void check (int x)
check (int x)
char check (int x)
The number of values that a method can return is ______.
1
2
3
4
A method which does not modify the value of variables is termed as ______.
Impure method
Pure method
Primitive method
User defined method
Assertion(A): call by value is known as pure method.
Reason(R): The original value of variable does not change as operation is performed on copied values.
Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A).
Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion (A).
Assertion (A) is true and Reason (R) is false.
Assertion (A) is false and Reason (R) is true.
Fill in the blanks.
Local data ______ (can/cannot) be accessed outside the method.
The parameters that are used in the ______ (Calling/Called) method are called formal parameters.
Methods help in ______ (code/program) reusability.
The prototype is the ______ (first/last) line of the method.
A method can return ______ (one/multiple) variables.
When the same method has to be called repeatedly with different values, the method call is placed inside a ______ (loop/conditions).
A class ______ (can/cannot) have multiple methods.
Java implements polymorphism through ______.
Member data of a class are ______ to all the methods of the class.
A ______ consists of member data and methods.
State True or False. Correct the false statement.
A method can accept one or more values as arguments.
State True or False. Correct the false statement.
A Prototype is the way of declaring a program.
State True or False. Correct the false statement.
A Called-method calls a Calling-method.
State True or False. Correct the false statement.
A method is contained by a class.
State True or False. Correct the false statement.
Those data which are declared in a method are called member data.
Differentiate between formal parameter and actual parameter.
Differentiate between local and member data.
Differentiate between calling method and called method.
Differentiate between methods with return type void and int.
Differentiate between main() method and other methods.
Differentiate between the pure method and Impure method.
Answer the following in brief. Give a reason/example wherever applicable.
What is the importance of main() in a program?
Answer the following in brief. Give a reason/example wherever applicable.
What are the types of method prototypes?
Answer the following in brief. Give a reason/example wherever applicable.
What is the role of return_type in a method?
What is meant by method prototype?
Answer the following in brief. Give a reason/example wherever applicable.
Explain Call by Value and Call by Reference.
Answer the following in brief. Give a reason/example wherever applicable.
Give a program example of a method call in a loop.
Write the prototype of a method.
named fnFest, which has a return type of int and takes one int argument.
Write the prototype of a method.
named fnBrit, which has no argument to return and takes no arguments.
Write the prototype of a method.
named fnToast, which returns a data of type double and takes two arguments of data type double.
Write the prototype of a method.
named fnNook, which returns a boolean value and takes a string argument.
Write the prototype of a method.
named fnPen, that returns no value and takes 3 integer arguments.
Observe the following code. It may contain Syntax, Logical or runtime errors. Execute it in Java and identify the error, if any. Rewrite the code without the error. Also write the aim of the code.
void fnMax(int n1, int n2)
{
int max = (n1 > n2) ? n1:n2;
return max;
}Observe the following code. It may contain Syntax, Logical or runtime errors. Execute it in Java and identify the error, if any. Rewrite the code without the error. Also write the aim of the code.
int fnMin(int n1, int n2)
{
return (n1>n2)? n1:n2);
}
Observe the following code. It may contain Syntax, Logical or runtime errors. Execute it in Java and identify the error, if any. Rewrite the code without the error. Also write the aim of the code.
int fnTale(int n)
{
if(n%2=0)
{
return(n*n);
}
return(n*n* n);
}Observe the following code. It may contain Syntax, Logical or runtime errors. Execute it in Java and identify the error, if any. Rewrite the code without the error. Also write the aim of the code.
int int fnWork(int p, intq)
{
int s=p b;
int r=p*q;
return s;
return r;
}Observe the following code. It may contain Syntax, Logical or runtime errors. Execute it in Java and identify the error, if any. Rewrite the code without the error. Also write the aim of the code.
double fnTask(double p, double q)
{
double d = p/q:
double r = p%q;
return d, r;
}Observe the following code. It may contain Syntax, Logical or runtime errors. Execute it in Java and identify the error, if any. Rewrite the code without the error. Also write the aim of the code.
int fnJob(int n)
{
while (n>0)
{
int d = n%10;
n = n/10;
return d;
}
}Observe the following code. It may contain Syntax, Logical or runtime errors. Execute it in Java and identify the error, if any. Rewrite the code without the error. Also write the aim of the code.
int fnTotalDigits(int n)
{
int td=0;
while(n>0)
{
n=n/10;
td++;
}
return td;
System.out.print("total digits=" + td);
}
Observe the following code. It may contain Syntax, Logical or runtime errors. Execute it in Java and identify the error, if any. Rewrite the code without the error. Also write the aim of the code.
int fnConsign(int a, int b)
{
if(a > b)
{
return а;
}
if(b > a)
{
return b;
}
}Observe the following code. It may contain Syntax, Logical or runtime errors. Execute it in Java and identify the error, if any. Rewrite the code without the error. Also write the aim of the code.
import java.util.*;
public class cl Factorial
{
void fn Factorial(int num)
{
for(int k = 1; k <= num; k++)
f = f*k;
}
public void main()
{
int number = 0;
Scanner sc = new Scanner(System.in);
System.out.print("Enter the number:");
number = sc.nextInt();
int cpy = number, dg = 0, facdg = 0;
while(cpy > 0)
{
dg = cpy % 10;
facdg = factorial(dg);
System.out.println("Factorial of "+dg+"="+facdg);
}
}
}Observe the following code. It may contain Syntax, Logical or runtime errors. Execute it in Java and identify the error, if any. Rewrite the code without the error. Also write the aim of the code.
import java.io.*;
class Paper
}
int fnBox(int limit)
{
for(int sum = 0, t= 1; t <= limit;t++)
sum = sum + t;
return sum;
}
void main()
{
int N;
Scanner sc = new Scanner(System.in);
System.out.print("Enter limit:");
N = sc.nextInt();
System.out.print("Result=" + fnBox(N));
}
}Write a program as per the given specification.
Design a class to overload a method Action () given that
- void Action (int, int) - Print the larger variable
- void Action (char, char) - Print the first character in lower case, second character in upper case [assume both are alphabets]
- void Action (String, String) – Print the longer string
Write the above methods and the main () method to call the three overloaded methods.
Write a program as per the given specification.
Design a class to overload a method Series() given that
- long Series (int n) – Returns the product of first n natural numbers (1*2*3 * ... * n)
- long Series (int n1, int n2) – Returns the sum of natural numbers from n1 to n2 10 + 11 + 12 + 13 + 14 + 15, here assuming n1 = 10, n2 = 15
Write the above methods and the main () method to call the two overloaded methods.
Write a program as per the given specification.
Design a class to overload a method, Verify(), given that
- boolean Verify (int n) - return true if n is a Prime number, false otherwise.
- boolean Verify (int v, int f) - return true if f is a factor of v, false otherwise.
Write the above methods and the main() method to call the two overloaded methods.
Write a program as per the given specification.
Design a class called DeptStore with the following description:
| Class Name: | DeptStore | |
| Instance variables/Member Data | ||
| int cust_num | stores the customer number | |
| String name | stores the name of the customer | |
| double amt | stores the amount of purchase made | |
| double vat | stores the value-added tax amount which is 7% of the purchase amount | |
| Member Methods | ||
| i. | void Input () | To input the customer number, name, purchase amount, |
| ii. | void Calculate () | To calculate the value added tax amount and modify the purchase amount accordingly. |
| iii. | void Display() | To display all the member data with proper output statements. |
| iv. | void main () | To create an object of the class and call the member methods. |
Define a class to overload the method display as follows:
| void display(): |
To print the following format using nested |
| void display(int n): | To print the square root of each digit of the given number |
| Example: |
n = 4329 |
Solutions for 3: User-Defined Methods
![Rupa Pandit solutions for कम्प्युटर एपलीकेशंस [इंग्रजी] इयत्ता १० आयसीएसई chapter 3 - User-Defined Methods Rupa Pandit solutions for कम्प्युटर एपलीकेशंस [इंग्रजी] इयत्ता १० आयसीएसई chapter 3 - User-Defined Methods - Shaalaa.com](/images/computer-applications-english-class-10-icse_6:a86debec6313407fa84cd182cd5e7e57.jpg)
Rupa Pandit solutions for कम्प्युटर एपलीकेशंस [इंग्रजी] इयत्ता १० आयसीएसई chapter 3 - User-Defined Methods
Shaalaa.com has the CISCE Mathematics कम्प्युटर एपलीकेशंस [इंग्रजी] इयत्ता १० आयसीएसई CISCE solutions in a manner that help students grasp basic concepts better and faster. The detailed, step-by-step solutions will help you understand the concepts better and clarify any confusion. Rupa Pandit solutions for Mathematics कम्प्युटर एपलीकेशंस [इंग्रजी] इयत्ता १० आयसीएसई CISCE 3 (User-Defined Methods) include all questions with answers and detailed explanations. This will clear students' doubts about questions and improve their application skills while preparing for board exams.
Further, we at Shaalaa.com provide such solutions so students can prepare for written exams. Rupa Pandit textbook solutions can be a core help for self-study and provide excellent self-help guidance for students.
Concepts covered in कम्प्युटर एपलीकेशंस [इंग्रजी] इयत्ता १० आयसीएसई chapter 3 User-Defined Methods are .
Using Rupa Pandit कम्प्युटर एपलीकेशंस [इंग्रजी] इयत्ता १० आयसीएसई solutions User-Defined Methods exercise by students is an easy way to prepare for the exams, as they involve solutions arranged chapter-wise and also page-wise. The questions involved in Rupa Pandit Solutions are essential questions that can be asked in the final exam. Maximum CISCE कम्प्युटर एपलीकेशंस [इंग्रजी] इयत्ता १० आयसीएसई students prefer Rupa Pandit Textbook Solutions to score more in exams.
Get the free view of Chapter 3, User-Defined Methods कम्प्युटर एपलीकेशंस [इंग्रजी] इयत्ता १० आयसीएसई additional questions for Mathematics कम्प्युटर एपलीकेशंस [इंग्रजी] इयत्ता १० आयसीएसई CISCE, and you can use Shaalaa.com to keep it handy for your exam preparation.
