Vous êtes sur la page 1sur 5

Shri Vile Parle Kelavani Mandal’s

C.N.M. SCHOOL & N.D.PAREKH PRE-PRIMARY SCHOOL


Std. X Subject: - Computer Application Project [ 2019-2020 ]
1. Cover Page
2. Index
3. Bonafied Certificate
4. Program
5. Source code of a program with comment
6. Output – Screenshot
7. Variable Description
Date of Submission: - Friday, 18th October 2019
List of Programs:-
1. Design a class to overload a function polygon() as follows:
(i) void polygon(int n, char ch) : with one integer argument and one character type argument that draws
a filled square of side n using the character stored in ch.
(ii) void polygon(int x, int y) : with two integer arguments that draws a filled rectangle of length x and
breadth y, using the symbol ‘@’
(iii) void polygon() : with no argument that draws a filled triangle shown below:
*
**
***
2. Design a class to overload a function check() as follows:
(i) void check(String str, char ch) – to find and print the frequency of a character in a string.
Example: Input : str = “success” ch=’s’
Output : number of s present is =3
(ii) void check(String s1) – to display only vowels from string s1, after converting it to lower case.
Example: Input : “computer”
Output : oue
(iii)void check(String s1, char ch1, char ch2) – display string s1 after converting ch1 character with ch2.
Example: Input : “Application” ch1=’p’ ch2=’*’
Output : A**lication
3. Design a class to overload a function area( ) as follows:
i. double area(double a, double b, double c) with three double arguments, returns the area of a

scalene triangle using the formula: area = where s =


ii. double area(int a, int b, int height) with three integer arguments, returns the area of a trapezium

using the formula: area =


iii. double area(double diagonal1, double diagonal2) with two double arguments, returns the area of a

rhombus using the formula: area =


4. Design a class RailwayTicket with following description:
Instance variables/data members :

String name : To store the name of the customer


String coach : To store the type of coach customer wants to travel
long mobno : To store customer’s mobile number
int amt : To store basic amount of ticket
int totalamt : To store the amount to be paid after updating the original amount
Member methods :
void accept() : To take input for name, coach, mobile number and amount.
void update() : To update the amount as per the coach selected
(extra amount to be added in the amount as follows)
Type of Coaches Amount
First_AC 700
Second_AC 500
Third_AC 250
Sleeper None
void display() : To display all details of a customer such as name, coach, total amount and mobile
number.
Write a main method to create an object of a class and call the above member methods.

5. Given below is a hypothetical table showing rates of income tax for male citizens below the age of 65 yrs:
Does not exceed Rs. 1,60,000 - nil
Is > Rs. 1,60,000 & <=Rs. 5,00,000 – (TI- 1,60,000)*10%
Is >Rs.5,00,000 & <=Rs. 8,00,000 - [(TI-5,00,000)*20%]+34,000
Is >Rs. 8,00,000 – [(TI-8,00,000)*30%]+94,000
Write a program to input the age, gender (male or female) and taxable income(TI) of a person.
If the age is more than 65 yrs or the gender is female, display “wrong category”.
If the age is less than or equal to 65 yrs and the gender is male, compute and display the income tax payable
as per the table given above.

6. Design class to overload a function Print() as follows:


i) void Print(String str) to input a word from the user and remove the duplicate characters present
in it. Eg. INPUT Mississppi OUTPUT Misp
ii) void Print(char c int n) to print the char ch n times.
iii) void Print(int n) to print the series: 1, 11, 111, 1111, …. upto 'n' terms

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


i) int series(int n) with one int argument and returns the factorial of the number n.
ii) double series(int x, int a) with two int argument and returns the sum of the series
sum = x+x2+x3………..xa
2 3 a
iii) double series(double a, double n) with two double arguments and returns the sum of the series :
sum=1 + 4 + 7 + 10 ……… n terms
a2 a5 a8 a11
8. Write a program to create class ArrangeLetters and convert the word into uppercase form. Arrange each
letter of the word in alphabetical order and print the word before and after arrange letters in A- Z order.
Example : Input : LanGuAge
Output
Original word : LanGuAge
Words in Capitals : LANGUAGE
Words after sorting : AAEGGLNU
9. Define a class called mobike with the following description:
Instance variables/data members:
int bno – to store the bike’s number
int phno – to store the phone number of the customer
String name – to store the name of the customer
int days – to store the number of days the bike is taken on rent
int charge – to calculate and store the rental charge
Member methods:
void input( ) – to input and store the detail of the customer.
void computer( ) – to compute the rental charge
The rent for a mobike is charged on the following basis.
First five days Rs 500 per day;
Next five days Rs 400 per day
Rest of the days Rs 200 per day
void display ( ) – to display the details in the following format:
Bike No. PhoneNo. No. of days Charge
Write a main method to create an object of the class and call the above member methods.
10. Write a program using the following specification:
Class Name Electricity
Data members
int omr Old Meter Reading
int nmr New Meter Reading
int cr Current Meter Reading (nmr-omr)
int rent Monthly Rent
double cost Billing Cost
double sc Surcharge
Data Members
Electricity( ) Initialized all data members empty.
input( ) Method to get the old meter reading and new meter reading
calculate( ) Method to calculate the total billing cost on the basic of unit consumed.
display( ) Method to display the total billing cost.
main( ) Invoke all methods.
Note :
 Monthly Rent is Rs. 200/-.
 Surcharge is 5% on the total billing cost.
 Units are to be charged on the following basis.
Units consumed Charges
First 100 Re. 0.80 P
Next 101 to 250 Re. 1.20 P
251 and above Rs. 2.00 P

11. WAP to accept the String and print all capital letters followed by small letter and followed by digits.
If Input : MuMbAi-53
Output : MMAubi53
12. Write a program to accept a string from user and create a new word formed out of the first letter of each
word and convert the new word into Uppercase.
Example: Input : Mangoes are delivered after Midday
Output : MADAM

13. Using switch statement write a menu driven program:


(i) To print the following pattern
1
1 0
1 0 1
1 0 1 0
1 0 1 0 1
(ii) To display the following pattern
A
BC
DEF
GHIJ
KLMNO
For an incorrect option an appropriate error message should be displayed.
14. Write a program to accept a string. Convert it to uppercase. Count and output the number of double letter
that exist in the string.
Sample Input: “SHE WAS FEEDING THE LITTLE RABBIT WITH AN APPLE”
Sample Output: 4
15. WAP to accept a sentence. Print all the words that start with a vowel and end with a consonant.
For example : Input :“the purpose of education is to replace an empty mind with an open one”
Output : of
education
is
an
empty
an
open
16. Write a program to accept a string and display all those words of the string which begins with a capital
letter and end with a small letter.
Input : We all lovE JavA for School Students because of its Uniqueness
Output : We School Students Uniqueness
17. Write a program to accept the number from user to check for Narcissistic number.
A Narcissistic number is one which is equal to the sum of each of its individual digits raised to the number of
digits in that number. For example, 153 has 3 digits, so 13 + 53 + 33 = 1 + 125 + 27 = 153; and hence 153 is a
Narcissistic number.

18. Write a menu driven program to do following task as per user choice:
1. Check for Amicable number (Note: Amicable number are pair of numbers such that one is the sum of
proper factors of the other. For example : 220 and 284 , since
sum of factors of 220 = 1+2+4+5+10+11+20+22+44+55+110=284
sum of factors of 284=1+2+7+71+142=220)
2. Check for Twisted Prime number (Note: A prime number is said to be ‘Twisted Prime’, if the new number
obtained after reversing the digits is also a prime number. Example: 167)
19. Write a program to accept the number. Display the accepted number after removing all zeros (0) from the
number. Example: Input 40809 Output 489
20. An emirp number is a number which is prime backwards and forwards.
Example: 13 and 31 are both prime numbers. Thus, 13 is an emirp number. Design a class Emirp to check
if a given number is Emirp number or not.

21. Write menu driven program to print the following patterns using iteration(loop) statements :
1. 2.

22. Write a program to accept a number. Count and print the frequency of each digit present in that number.
The output should be given as:
Sample Input: 44514621
Sample Output: =====================
Digit Frequency
=====================
1 2
2 1
4 3
5 1
6 1

23. Using switch write a menu driven program for the following task:
1. Automorphic number: An automorphic number is the number which is contained in the last digit(s)
of its square. Example: 25 is an automorphic number as its square is 625 and 25 is present as the last
two digits.
2. To find the smallest digit of an integer that is that.
Sample input: 6524
Sample output: Smallest digit is 2
For an incorrect an appropriate error message should be displayed.

24. Write a program to accept the names of 10 countries in a single dimension string array and their famous
place in another single dimension array. Search for a name of a country input by the user in the list. If
found, display “search successful” and print the name of the country along with famous place, or else
display the message” search unsuccessful, no such country in the list”.
25. Write a program to accept the year of graduation from school as an integer value from the user. Using the
Binary Search technique on the sorted array of integers given below, output the message “Record exists”
if the value input is located in the array. If not, output the message “Record does not exist”.
{1982, 1987, 1993, 1996, 1999, 2003, 2006, 2007, 2009, 2010}
26. Define a class and accept 10 students’ names in a single dimensional array. Sort these names in
alphabetical order using the Bubble Sort technique only.

27. Write a program to accept 35 integers from the keyboard. Perform selection sort on the integers and then
print them in descending order.

*************************

Vous aimerez peut-être aussi