Thanks to visit codestin.com
Credit goes to www.scribd.com

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

2010-16 Questions of Computer Application

The document contains a series of programming questions from 2010 to 2016 focused on computer applications. It includes tasks such as writing menu-driven programs, designing classes with function overloading, and implementing algorithms for mathematical series and number classifications. Each question specifies input requirements and expected outputs, often with examples.

Uploaded by

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

2010-16 Questions of Computer Application

The document contains a series of programming questions from 2010 to 2016 focused on computer applications. It includes tasks such as writing menu-driven programs, designing classes with function overloading, and implementing algorithms for mathematical series and number classifications. Each question specifies input requirements and expected outputs, often with examples.

Uploaded by

nidhiomer7542
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

2010-16 QUESTIONS OF COMPUTER APPLICATION

2011

Question 9

Write a menu driven program to perform the following tasks by using Switch
case statement:
(a) To print the series:
0, 3, 8, 15, 24, ............ to n terms. (value of 'n' is to be an input by the user)
(b) To find the sum of the series:
S = (1/2) + (3/4) + (5/6) + (7/8) + ........... + (19/20)

Question 6

Write a program to input a number and print whether the number is a special
number or not.
(A number is said to be a special number, if the sum of the factorial of the digits
of the number is same as the original number).
Example:
145 is a special number, because 1! + 4! + 5! = 1 + 24 + 120 = 145.
(Where ! stands for factorial of the number and the factorial value of a number
is the product of all integers from 1 to that number, example 5! = 1 * 2 * 3 * 4 * 5
= 120)

2012

Question 7

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

1. void polygon(int n, char ch) — with one integer and one character
type argument to draw a filled square of side n using the character
stored in ch.
2. void polygon(int x, int y) — with two integer arguments that draws
a filled rectangle of length x and breadth y, using the symbol '@'.
3. void polygon() — with no argument that draws a filled triangle
shown below:
2010-16 QUESTIONS OF COMPUTER APPLICATION

Example:

1. Input value of n=2, ch = 'O'


Output:
OO
OO
2. Input value of x = 2, y = 5
Output:
@@@@@
@@@@@
3. Output:
*
**
***

Question 8

Using a switch statement, write a menu driven program to:


(a) Generate and display the first 10 terms of the Fibonacci series
0, 1, 1, 2, 3, 5
The first two Fibonacci numbers are 0 and 1, and each subsequent
number is the sum of the previous two.
(b) Find the sum of the digits of an integer that is input.
Sample Input: 15390
Sample Output: Sum of the digits = 18
For an incorrect choice, an appropriate error message should be
displayed.

2013

Question 8

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

1. double series(double n) with one double argument and returns the


sum of the series.
sum = (1/1) + (1/2) + (1/3) + .......... + (1/n)
2010-16 QUESTIONS OF COMPUTER APPLICATION

2. double series(double a, double n) with two double arguments and


returns the sum of the series.
sum = (1/a2) + (4/a5) + (7/a8) + (10/a11) + .......... to n terms

Question 9

Using the switch statement, write a menu driven program:

1. To check and display whether a number input by the user is a


composite number or not.
A number is said to be composite, if it has one or more than one
factors excluding 1 and the number itself.
Example: 4, 6, 8, 9...
2. To find the smallest digit of an integer that is input:
Sample input: 6524
Sample output: Smallest digit is 2

For an incorrect choice, an appropriate error message should be


displayed.

2014

Question 5

A special two-digit number is such that when the sum of its digits is
added to the product of its digits, the result is equal to the original two-
digit number.
Example: Consider the number 59.
Sum of digits = 5 + 9 = 14
Product of digits = 5 * 9 = 45
Sum of the sum of digits and product of digits = 14 + 45 = 59
Write a program to accept a two-digit number. Add the sum of its digits
to the product of its digits. If the value is equal to the number input, then
display the message "Special two—digit number" otherwise, display the
message "Not a special two-digit number".

Question 7
2010-16 QUESTIONS OF COMPUTER APPLICATION

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

1. double area (double a, double b, double c) with three double


arguments, returns the area of a scalene triangle using the
formula:
area = √(s(s-a)(s-b)(s-c))
where s = (a+b+c) / 2
2. double area (int a, int b, int height) with three integer arguments,
returns the area of a trapezium using the formula:
area = (1/2)height(a + b)
3. double area (double diagonal1, double diagonal2) with two double
arguments, returns the area of a rhombus using the formula:
area = 1/2(diagonal1 x diagonal2)

2015

Question 5

Write two separate programs to generate the following patterns using


iteration (loop) statements:
(a)
*
* #
* # *
* # * #
* # * # *
(b)
54321
5432
543
54
5

2016

Question 5
2010-16 QUESTIONS OF COMPUTER APPLICATION

Using the switch statement, write a menu driven program for the
following:
(i) To print the Floyd’s triangle [Given below]
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
(b) To display the following pattern:
I
IC
ICS
ICSE
For an incorrect option, an appropriate error message should be
displayed.

Question 7

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


(i) void sumSeries(int n, double x): with one integer argument and one
double argument to find and display the sum of the series given below:

(ii) void sumSeries(): to find and display the sum of the following series:

Question 8

Write a program to accept a number and check and display whether it is


a Niven number or not.
(Niven number is that number which is divisible by its sum of digits.).
2010-16 QUESTIONS OF COMPUTER APPLICATION

Example:
Consider the number 126. Sum of its digits is 1 + 2 + 6 = 9 and 126 is
divisible by 9.

You might also like