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

non paramertized questions

Uploaded by

Disha Jaggi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

non paramertized questions

Uploaded by

Disha Jaggi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Wap to make a class name student which has the following

data members like


Name, add, m1,m2,m3,tot, per;
Initilaize the value of all data members using non
parameterized constructor
Member methods
Void input() to input name, add, m1,m2, m3
Void calculate() to calculate total and percentage
Void display() to display name , address total and
percentage.
Wap to define a class reserveTicket having following details
Data Members
Name : to store name
Not : to store number of tickets bought
Cost : to store cost of ticket
Tc : to store total cost
Reserveticket() non parameterized constructor to initial
datamembers with their default value and cost by
130.50
Void accept() to accept name and number of tickets
bought
Void process() to compute total cost and provide a
discount of 10% if the total cost exceeds rs 1800
void display() to display all the information with proper
messages

write main function to ca ll above functions


Define a class employee having the following description
Data Members
int pan to store pan number
String Name to store name
double income to store income
double tax to calculate tax
Member functions
void input() to input name, pan no, and income
void calculate() to calculate tax according to given criteria
void display() to display name, pan, income and tax.
Total Annual taxable income tax rate
Upto 100000 No tax
From 100001 to 150000 10% of income exceeding Rs 100000
From 150001 to 250000 5000+ 20% of income exceeding Rs
150000
Above 250000 25000+30% of income exceeding Rs
250000
Define a class salary
Data Members
Name, add, phone, subject specialization, monthlysalary, tax

Member methods

Void accept() to accept the details of the teacher including monthly


salary
Void display() to display the details of the teacher
Void compute() to compute the annual tax as 5% of the annual salary
exceeding rs 175000
Define a class Library

Data members
Int acc_num : to store the accession number of book
String title : stores title of the book
String author : stores the name of the author
Member methods
Void input() to input acc_num , title and author name
Void compute() to accept the number of days late and
Calculate the fine charges @ 2 rs per day
Void display() to display the details in the following format:

Accession number title Author


1 Macbeth Shakespeare
Define a class Market as given below:

Data Members:

Name : to store name of salesman


Monsal : to store monthly sales

Member Function:
Void input()
Double calcommission() computes and returns the commission as
per the monthly sales:

Monthlysales Commission
Upto 5000 5%
5000 to 10000 10%
10000 to 20000 20%
Above 20000 30%
Void display() to display details along with commission.

You might also like