Sei sulla pagina 1di 29

Project 1

Q1. Create a class grocery to calculate the purchase bill. (Assume that this s/w caters for at the max 5 items in the
bill)
Member variables :
Items[] – names of five items.
RATE[] – per unit rate of five items. (can be in decimals)
Qty[] – Quantity purchased of each item. (Can be in decimals)
Bill amount - Net Bill amount after giving the discount .
Discount of decimal type
Member Methods :
i. intput( ) : To accept the various values
ii float calcdisc(float ) : To calculate the discount on the bill amount
iii void calcbill( ) : To calculate the bill
iii void display( ) : To display the final bill in the following format

Item Name PerUnit Rate Units purchased Amount


---- ---- --- ---
---- ---- --- ---
---- ---- --- ---
---- ---- --- ---
Total Amount -----
Disc ---
Net Bill Amount ----
[ Note : Customer can buy any number of items, and at the max five ]
Crieteria for Disc calculation

Bill amount Discount


< 400 5% of bill amount
>= 400 and < 800 8% of bill amount
> 800 10% of bill amount
Create another class which has main function, and use all the above functions

Q2. Read a list of numbers in a terminal window and display sum of even and odd numbers.
Q3.
a. Sum= ½ + 1/3 + ¼ ….. 1/n
b. 1
12
123
Q4. Display a menu with the following options
1. Prime number check
2. Palindrome number check
3. Exit
Depending on the choice do the needful
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 2 – Geometry

Q1. Define a class Point to model in the X-Y plane. Define a function to translate a point along the X and Y axis
respectively. Define a function that calculate the distance from the other point.

Member variables : x, y of integer type


Member Methods :
i point( ) : To initialize a point with (0, 0)
ii point( int, int ) : Constructor to initialize a point object
iii int distance ( point ) : To calculate the distance between two points.
iv. Read (int,int) : Accepts x and y co-ordinates and assigns to the instance variables.
Create another class which has main function, and use all the above functions.
Q2. Read a list of numbers in a terminal window and display count of even and count of odd numbers.
Q3.
a. Sum= ½ + 1/4 +1/ 6 ….. 1/n
b. 1
22
333
Q4. Display a menu with the following options
1. Reverse a number
2. Palindrome number check
3. Exit
Depending on the choice do the needful
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 3 – Electricity Consumption

Q1. Problem Description :


The motivation for this project is to encourage people to make greener choices when they buy computers, by
encouraging them to more accurately go for self-interest and to more fully appreciate the value of low-power
computing.
When large companies buy computer server farms, they factor in the cost of the electricity the computer will use
over the life of the computer, the rent for the space to house the computer, and the cost of air conditioning. However
when people buy home computers, they ignore these costs, even though they amount to a substantial proportion of
the total cost.
Let it work like this: The user answers a number of questions:
1. Total cost of candidate computer, including case, motherboard, CPUs, RAM, hard disk, DVD reader/writer,
keyboard, mouse, screen, OS, but not printer.
2. Laptop or desktop?
3. Size of screen
4. Speed of CPU in MHz
5. Number of cores
6. Brand/line of CPU
7. MB of RAM
8. Size of hard disk
9. Does the mouse need a battery?
10. Country/State/Province where you live (to lookup electricity cost).
11. How long you expect to keep the computer?
12. How many hours a day do you leave the power on?
You then estimate the cost of electricity over the life of the computer, and display four numbers: computer cost,
electricity cost, battery cost and total cost.
Create another class which has main function, and use all the above functions.
Q2. Read a list of numbers in a terminal window and display sum of positive and negative numbers.
Q3.
a. Sum= ½ - 1/3 + ¼ - 1/5….. 1/n
b. 1
1 2
1 2 3
Q4. Display a menu with the following options
1. HCF
2. LCM
3. Exit
Depending on the choice do the needful
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 4 – Number conversion

Q1.Write a class with name Convrtr with following members :

Member functions :
Deci2bin( int n) It will convert decimal number to its binary equivalent
Bin2Deci(int a) will convert binary number a to its decimal equivalent
KmtoM(int k) will convert kilometers to meters
MtoKm(int m) will convert Meters to Kilo meters
HourstoMin(int h) will convert hours to minutes
MintoHrs(int min) will convert minutes to hours
FeettoInches(int f) will convert feet to inches
Inchestofeet(int i) will convert inches to feet

Create another class which has main function, and use all the above functions.
Q2. Read a list of numbers in a terminal window and display count of positive and negative numbers.
Q3.
a. Sum= ½ + 2/3 + 3/4 ….. n/n+1
b. 1
2 2
3 3 3
Q4. Display a menu with the following options
1. HCF
2. Reduce to a smaller fraction
3. Exit
Depending on the choice do the needful
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 5 – Water Bill Calculation

Q1.Problem Description : To calculate the monthly Water bill.

Write a class with name water with following members :


Date members :
String name subscriber’s name
int units No. of units of water consumed
float bill Total bill
Member functions
water( ) constructor to initialize the object
water(String, int) constructor to initialize the object
calc( ) to calculate the bill as per the following crieteria:-
units consumed Charges
First 100 units 1/-
100 to 300 units Rs. 1.50/-
300 to 500 units Rs. 2.00/-
Above 500 units Rs. 3.00/-
Surcharge will be charges at the rate of 5% of the bill amount, from every subscriber.
show( ) To display all the details.
Create another class which has main function, and use all the above functions.
Q2. Read a list of numbers in a terminal window and display sum of even and odd numbers.
Q3.
a. Sum= ½ + 2/4 + 3/6 ….. n
b. 1
1 2
1 2 3
1 2
1
Q4. Display a menu with the following options
1. Even odd check
2. Positive negative check
3. Exit
Depending on the choice do the needful
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 6 – Telephone Bill

Q1.Problem Description : To calculate the monthly telephone bill.

Write a class with name telephone with following members:


Date members :
String name subscriber’s name
int calls No. of calls made by the person
boolean staff true if a person is working in telephone dept. otherwise false
float bill Total telephone bill
Member functions
telephone( ) constructor to initialize the object
telephone(String, int, Boolean) constructor to initialize the object
calc( ) to calculate the phone bill as per the following crieteria:-
Calls made Charges
First 100 calls Free
100 to 200 calls Rs. 0.80/-
200 to 400 calls Rs. 1.00/-
Above 400 calls Rs. 1.20/-
Surcharge will be charges at the rate of 5% of the bill amount, from every subscriber. Note : if person is staff, will
get first 400 calls free.

Create another class which has main function, and use all the above functions.
Q2. Read a list of numbers in a terminal window and display count of even and odd numbers.
Q3.
a. Sum= ½! + 2/4! + 3/6! ….. n
b. 1
2 2
3 3 3
2 2
1
Q4. Display a menu with the following options
1. addition
2. subtraction
3. Exit
Depending on the choice do the needful
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 7 – Temperature Conversion

Q1.Create a class Conversion to do the various temperature conversions. The member functions should be as
follows:

Degree2Celcius( ) – to convert the temperature from degree to Celsius


Celcius2Degree( ) – to convert the temperature from Celsius to degree
Deci2bin( int n) It will convert decimal number to its binary equivalent
Bin2Deci(int a) will convert binary number a to its decimal equivalent

Create another class which has main function, and uses all the above functions.
Q2. Read a list of numbers in a terminal window and display count of positive and negative numbers.
Q3.
a. Sum= ½! + 1/4! + 1/6! ….. n
b.
7531
753
75
7
Q4. Display a menu with the following options
1. Reverse a string
2. Palindrome check of a string
3. Exit
Depending on the choice do the needful
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 8 – Payroll

Q1. Problem Description : To calculate the monthly salary of an employee .

Define a class employee having the following description :-


Data Member/ int empNo to store employee number
Instance variables String name to store name
int bp to store basic salary of an employee
double gross to store the gross salary
double netsal to store the net salary
Member Functions :
input( ) To accept the employee number, name, basic pay
calc( ) To calculate the gross and net salary of an employee based on the following parameters :
Allowances Deductions
HRA 20% of basic pay PF 12% of basic pay
DA 51% of basic pay Staff Club fund 150/-
Med. Allowance 2000/-

disp( ) To output details of an employee

Write another class, and create main( ) function and use the above functions to calculate the salary of any
employee.

Create another class which has main function, and uses all the above functions.
Q2. Read sides of a triangle in a terminal window and display the type of the triangle.
Q3.
a. Sum= ½! + 2/4! + 3/6! ….. n
b.
7654321
765432
76543
7654
765
76
7
Q4. Display a menu with the following options
1. Two strings are equal or not
2. Display length of a string
3. Exit
Depending on the choice do the needful
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 9 – Income Tax

Q1.
Problem Description : To calculate the Income Tax of an employee .

Define a class employee having the following description :-


Data Member/ int pan to store personal account number
Instance variables String name to store name
double taxincome to store annual taxable income
double tax to store tax that is calculated
Member Functions :
input( ) To accept the pan number, name, taxable income
calc( ) To calculate tax for an employee
disp( ) To output details of an employee
Write a program to compute tax according to the given conditions and display the output as per given
format.

Total Annual Taxable Income Tax Rate


Upto Rs. 1,00,000 No tax
1,00,001 to 1,50,000 10% of the income exceeding 1,00,000
1,50,001 to 2,50,000 Rs. 5000 + 20% of the income exceeding 1,50,000
Above 2,50,000 Rs. 25,000 + 30% of the income exceeding 2,50,000
Output :
Pan Number Name Tax-Income Tax
- - - -
- - - -
- - - -
Create another class which has main function, and uses all the above functions.
Q2. Read two numbers and an operator(+,-,*,/) in a terminal window and display the result accordingly.
For example if the numbers are 4 and 5 and the operator is + then the result should be 9.
Q3.
a. Sum= x/2! + x/4! + x/6! ….. n
b.
1111
2222

Q4. Display a menu with the following options


1. Power of a number( eg 23 is 8)
2. Square root of a number
3. Exit
Depending on the choice do the needful
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 10 – Shares

Q1. Problem Description : Share handling

Write a class with name shares with following members :


Date members :
String nm to store the name of the buyer
int no to store the number of shares
int unitprc to store the price of one share
int totval total value of shares

Member functions
shares( ) constructor to initialize the object
shares(String , int , int ) constructor to initialize the object
void buy( int no) reads number of shares to be bought and make changes in member variables
void sell( int no ) reads number of shares to be bought and make changes in member variables
calc( ) to calculate the total value of shares
show( ) to show the details.
Note : buy( ) and sell( ) functions will increase or decrease the number of shares, and accordingly the Total value
of shares should be changed.

Create another class and write main( ) function and use the above functions.
Q2. Read length and breadth in a terminal window and display area of a rectangle.
Q3.
a. Sum= x!/2! + x!/4! + x!/6! ….. n
b.
1
23
456

Q4. Display a menu with the following options


1. Sum of digits of a number
2. Count of digits of a number
3. Exit
Depending on the choice do the needful
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 11 – Working with Date

Q1. Problem Description : To calculate the number of days passed till date in the current year.

Write a class with name date with following members :


Date members :
int dd date part of today’s date
int mon month part of today’s date

Member functions
date( ) constructor to initialize the object
date(int d, int m ) constructor to initialize the object
countdays( ) to count the number of days from 1st Jan of the current year.
Create another class and write main( ) function and use the above functions.
2. Read length, breadth and height in a terminal window and display volume of a cuboid.
Q3.
a. Sum= x!/2! - x!/4! + x!/6! –x!/8!….. n
b.
1
23
456

Q4. Display a menu with the following options


1. Product of digits of a number
2. Count of digits of a number
3. Exit
Depending on the choice do the needful.
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 12 – Time

Q1.Problem Description : To calculate difference between two times

Write a class with name time with following members :


Date members :
int hh to store hours
int min to store minutes
String str to store “am” or “pm”

Member functions
date( ) constructor to initialize the object
date(int d, int m) constructor to initialize the object
void timeOfDay( ) based on the time you have to show whether it is Morning/AfterNon/Evening/Night
void incrs_time(int mnts) Increase the time by mnts minutes.
time diff(time t1) Find out the difference of two times and return it to the calling function.
Create another class and write main( ) function and use the above functions.
2. Read two numbers in a terminal window and display the greater number.
Q3.
a. Sum= 1/12 +2/22 +3/32+n/n2
b.
1
35
7 9 11

Q4. Display a menu with the following options


1. Volume of a cuboid
2. Volume of a cube
3. Exit
Depending on the choice do the needful.
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 13 – Geometric Figures
Q1.Problem Description : Handling of different kinds of figures.
Q1.Display the following menu :

***** Main Menu *****


1. Square
2. Circle
3. Triangle
4. Exit
Select any figure.
Based on the figure selected, further show the menu as following :
If option selected is 1 (i.e. Square) menu is
(a) Area of square
(b) Perimeter of square

If option selected is 2 (i.e. Circle) menu is


(a) Area of Circle
(b) Circumference of Circle
If option selected is 3 (i.e. Triangle) menu is
(a) Area of Triangle
(b) Type of triangle (equilateral/isosceles/other)
If option selected is 4 (i.e. Exit), program will terminate.
Make the appropriate choices and do the needful. Try to modularize the program (by creating the functions)
wherever it is possible. For any wrong input, give the proper error messages.
Q2. Read two numbers in a terminal window and display the smaller number.
Q3.
a. Sum= 1/11 +2/22 +3/33+n/nn
b.
1
3 5
7 9 11
Q4. Read an array of 5 integers in a terminal window and display the same.
Q5. Write a class with name shares with following members :
Date members :
String nm to store the name of the buyer
int no to store the number of shares
int unitprc to store the price of one share
int totval total value of shares
Member functions
shares( ) constructor to initialize the object
shares(String , int , int ) constructor to initialize the object
void buy( int no) reads number of shares to be bought and make changes in member variables
void sell( int no ) reads number of shares to be bought and make changes in member variables
calc( ) to calculate the total value of shares
show( ) to show the details.
Note : buy( ) and sell( ) functions will increase or decrease the number of shares, and accordingly the Total value
of shares should be changed.

Create another class and write main( ) function and use the above functions.
Project 14 – Electric Heater

Q1. Problem Description : Electric Heater

Create a class heater that contains a following members.

Data members :
temperature - integer field
min - possible minimum temperature setting
max - possible maximum temperature setting

Member functions :
heater( ) set the temperature to 20 degree
heat( ) , cool( ) functions to increase or decrease the temperature by 5 degree
Take care of min & max temperature settings.
temp( ) function to return the current temperature.

2. Read three numbers in a terminal window and display the greatest number.
Q3.
a. Sum= 1/12 +3/22 +5/32+.. n
b.
1
2 3
4 5 6

Q4. Display a menu with the following options


1. Area of a circle
2. Circumference of a circle
3. Exit
Depending on the choice do the needful.
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 15 – Calculator

Q1. Computer Science Project on Calculator


Member Variables:
Result, op1(operand 1), op2 (operand 2)
Functions used :
Default constructor
Parameterized constructor
int add( int , int ) // Function to add two integers and return the result
float add( float , int ) // Function to add one float and one integer and return the result
double add(double , int) // Function to add one double and one integer and return the result
void subtract( int , int ) // Function to subtract two integers and display the result
void divide(int, int )// // Function to divide two integers and display the result
int return_op1( ) // To return the operand 1
int return_op2()//To return the operand 2
void reset() // to reset the state of the object
sin()
cos()
max()
min()
round()
ceil()
floor()

Class Use_calculator
Write a main method which creates an object of the above class and call all the methods.
2. Read a number in a terminal window and display even or odd.
Q3.
a. Sum= 1/12 +3/22 +5/32+…..n
b.
1
35
7 9 11

Q4. Display a menu with the following options


1. Area of a square
2. Area of a rectangle
3. Exit
Depending on the choice do the needful.
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 16 – Student

Q1. Computer Science Project on Student


Class : Student
Member Variables:
rollno, Name, marks in 10 subjects(array), avg
Functions used :
Default constructor
Parameterized constructor
void new_student( int , String, int, int , int) // Function to accept roll no, name, eng, maths, science
void display_details( )// Function to display the details
void calcavg() // to calculate the average marks and store in avg
double return_average( ) // To return the average marks
String return_name()//To return the name
Class Usestudent
Write a main method which creates an object of the above class and call all the methods

2. Read a number in a terminal window and display area of a square.


Q3.
a. Sum= 1/22 +2/42 +3/62+….n
b.
1
35
7 9 11

Q4. Display a menu with the following options


1. Surface Area of a cube
2. Surface Area of a cuboid
3. Exit
Depending on the choice do the needful.
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 17 – Item

Q1. Class : Item


Member Variables:
id, Name, price , qty, total
Member Functions :
Default constructor
Parameterized constructor
void new_item( int , String, int, int) // Function to accept id name price and quantity of the item
void display_details( )// Function to display the details
void calc_total() // to calculate the total bill and stores in total
int return_total( ) // To return the total
String return_name()//To return the name
int return_price( ) // To return price
Class Useitem
Write a main method which creates an object of the above class and call all the methods.
2. Read 3 sides of a triangle in a terminal window and display area of a triangle.
Q3.
a. Sum= 1/22 +1/42 +1/62+….n
b.
1
2 2
3 3 3
2 2
1

Q4. Display a menu with the following options


1. Area of a cube
2. Area of a cuboid
3. Exit
Depending on the choice do the needful.
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 18 – Password Checking

Q1. Computer Science Project on password checking


Class : password
Member Variables:
Id, password
Member Functions :
Default constructor
Parameterized constructor
void new_password()throws IOException // Function to create a new id and password
void check(String , String)// Function to accept id and password and check they match with the data stored in
instance variables. (Check at the most 3 times )If id and/or password not matched with the data quit checking after
3 times then display a message SORRY!!!!
Class Usepassword
Write a main method which creates an object of the above class and call all the methods

2. Display Fibonacci series till n. N should be accepted in a terminal window.


Q3.
a. Sum= 1/22 +1/43 +1/64+….n
b.
1
1 2
1 2 3
1 2
1

Q4. Display a menu with the following options


1. Convert kilometers to meters
2. Convert hours to minutes
3. Exit
Depending on the choice do the needful.
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 19 – Result Calculation

Q1. Computer Science Project on result


Class : Result
Member Variables:
rollno, Name, marks in 5 subjects array(eng, maths, science, art, geo) ,avg ,grade
Functions used :
Default constructor
Parameterized constructor
void new_student( int , String, int, int , int, int, int) // Function to accept rollno, name, eng, maths, science, art, geo
marks from user.
void display_details( )// Function to display the details
void calcavg() // to calculate the average marks and store in avg
void calcgrade()// to calculate the grade using the following formula
avg grade
>90 A
>70 &<= 90 B
>60 & <=70 C
>40 & <=60 D
<40 F
double return_average( ) // To return the average marks
String return_name()//To return the name
char return_grade( ) // To return the grade
Class Useresult
Write a main method which creates an object of the above class and call all the methods

2. Display all twin prime numbers till N.


Q3.
a. Sum= 1/22 +1/43 +1/64+….n
b.
a
a a
a a a
a a
a

Q4. Display a menu with the following options


1. Convert meters into centimeters
2. Convert feet into inches
3. Exit
Depending on the choice do the needful.
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 20 – Hospital Bill

Q1. Computer Science Project on Bill


Class : Patient
Member Variables:
Id, Name, disease, roomno, advancepaid, doctorid ,roomcharges, doctorcharges, operationcharges
Functions used:
Default constructor
Parameterized constructor
void new_patient( int , String, String, int ,int , int, int, int, int) // Function to create a new doctor by accepting id,
name, disease name, room no, advance paid, doctor id, room charges, doctor charges, operation charges
void display_details( )// Function to display the details
int calc() // to calculate the charges i.e.
doctorcharges + operationcharges + roomcharges-advancepaid and return amount to be paid
int return_advancepaid( ) // To return the advance
String return_name()//To return the name
int return_disease( ) // To return the disease name
Class Usepatient
Write a main method which creates an object of the above class and call all the methods.
2. Display all prime palindrome numbers till N.
Q3.
a. Sum= 1/22 +1/43 +1/64+….n
b.
a
a a
a a a
a a
a

Q4. Display a menu with the following options


1. Convert meters to centimeters
2. Convert feet to inches
3. Exit
Depending on the choice do the needful.
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 21 – Disease (Diabetes , Hypertension) Diagnosing s/w

Q1.Computer Science Project on diagnosing diseases (diabetes and hypertension)


Class : diagnose1
Member Variables:
//store the diseases and symptoms through parameterized constructor
Id(patient id), Name(patient name),
disease1=hypertension, disease2=diabetes,
Symptomd1 (array)( 1st Symptom for disease 1), symptomd12(Second symptom for disease 1),symptomd13(Third
symptom for disease 1)
Symptomd2(array)( 1st Symptom for disease 2), symptomd22( 2nd Symptom for disease 2), symptomd23( 3rd
Symptom for disease 2) (store all the symptoms), disease_detected
Functions used :
Default constructor
Parameterized constructor
void new_diagnose( int , String) // Function to create a new patiens( id and name to be accepted)
void ask() // function to ask symptoms and decide the disease and calls the display_details()
private void display_details( )// Function to display the remedies for the detected disease
String return_disease( ) // To return the disease
String return_name()//To return the name
Class Usediagnose1
Write a main method which creates an object of the above class and call all the methods

2. Read two numbers in a terminal window and display the greater number.
Q3.
a. Sum= 1/12 +2/22 +3/32+n/n2
b.
1
35
7 9 11

Q4. Display a menu with the following options


1. Volume of a cuboid
2. Volume of a cube
3. Exit
Depending on the choice do the needful.
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 22 – Disease (Cancer, Heart prob.) Diagnosing s/w

Q1. Computer Science Project on diagnosing diseases (Heart problem and cancer)
Class : diagnose2
Member Variables:
//store the diseases and symptoms through parameterized constructor
Id(patient id), Name(patient name),
disease1=”heart problem”, disease2=”cancer”,
Symptomd1(array)( 1st Symptom for disease 1), symptomd12(Second symptom for disease 1),symptomd13(Third
symptom for disease 1)
Symptomd2(array)( 1st Symptom for disease 2), symptomd22( 2nd Symptom for disease 2), symptomd23( 3rd
Symptom for disease 2) (store all the symptoms), disease_detected
Functions used :
Default constructor
Parameterized constructor
void new_diagnose( int , String) // Function to create a new patiens( id and name to be accepted)
void ask() // function to ask symptoms and decide the disease and calls the display_details()
private void display_details( )// Function to display the remedies for the detected disease
String return_disease( ) // To return the disease
String return_name()//To return the name
Class Usediagnose2
Write a main method which creates an object of the above class and call all the methods.
Q2. Read two numbers and an operator(+,-,*,/) in a terminal window and display the result accordingly.
For example if the numbers are 4 and 5 and the operator is + then the result should be 9.
Q3.
c. Sum= x/2! + x/4! + x/6! ….. n
d.
1111
2222

Q4. Display a menu with the following options


4. Power of a number( eg 23 is 8)
5. Square root of a number
6. Exit
Depending on the choice do the needful
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 23 – Sales
Q1. Computer Science Project on sales
Class : Sales
Member Variables:
Salesid, name, qty, price, bill
Member Functions :
Default constructor
Parameterized constructor
void new_sales( int, String, int, int ) // Function to accept sales id, name, quantity , price from user
void calcbill() //calculates bill and stores in bill
int returnbill() // which returns bill
String returnname() //returns name
Class Usesales
Write a main method which creates an object of the above class and call all the methods.

Q2. Read a list of numbers in a terminal window and display count of positive and negative numbers.
Q3.
a. Sum= ½ + 2/3 + 3/4 ….. n/n+1
b. 1
2 2
3 3 3
Q4. Display a menu with the following options
1. HCF
2. Reduce to a smaller fraction
3. Exit
Depending on the choice do the needful
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 24 – Banking

Q1. Computer Science Project on Banking


Class : bank
Member Variables:
Accno, name, balance
Member Functions :
Default constructor
Parameterized constructor
void good()//which displays good morning 5 times
void new_account(int, string , int) // to accept account number , name and balance
void display_details( )// Function to display the details
void deposit(int amt ) // To deposit the amount in the account
void withdraw(int amt ) // To with draw the amount from balance
int returnbalance() // it returns the current balance
Class Usebank
Write a main method which creates an object of the above class and call all the methods.
2. Read a list of numbers in a terminal window and display sum of even and odd numbers.
Q3.
a. Sum= ½ + 1/3 + ¼ ….. 1/n
b. 1
12
123
Q4. Display a menu with the following options
1. Prime number check
2. Palindrome number check
3. Exit
Depending on the choice do the needful
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 25 – Book shop
Q1.
Computer Science Project on book
Class : Book
Member Variables:
bookno, Name, price , no of copies
Member Functions :
Default constructor
Parameterized constructor
void new_book( int , String, int, int) // Function to accept bookno,name,price and no of copies
void display_details( )// Function to display the details
int return_copies( ) // To return the no of copies
String return_name()//To return the name of the book
int return_price( ) // To return price
Class Usebook
Write a main method which creates an object of the above class and call all the methods.
Q2. Display all prime palindrome numbers till N.
Q3.
c. Sum= 1/22 +1/43 +1/64+….n
d.
*
**
* * *
* *
*

Q4. Display a menu with the following options


4. Convert Centimeters to meters
5. Convert inches to feet
6. Exit
Depending on the choice do the needful.
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 26 – Item Order

Q1.Computer Science Project on ordering in a canteen


Class : canteen
Member Variables:
Qty (quantity), bill
Member Functions :
Default constructor
Parameterized constructor
void good()//which displays good morning 5 times
void new_order() // Function to display the following menu
// Items Price
// 1. T.V20000
// 2. DVD Player 5000
// 3. Tape Recorder 3000
// 4. L. G Mobile 11000
// and take order for at the most 4 items (any combination using a loop) and quantity of each item and stores the
total amount in bill
void display_bill( )// Function to display the bil
int return_bill( ) // To return the current bill
Class Usecanteen
Write a main method which creates an object of the above class and call all the methods
2. Read a list of numbers in a terminal window and display product of all the numbers..
Q3.
c. Sum= 1/3 + 1/5+ 1/6 ….. 1/n
d. 1
22
333
Q4. Display a menu with the following options
4. Prime number check
5. Palindrome number check
6. Exit
Depending on the choice do the needful
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 27 – Book Order

Computer Science Project on order


Class : order
Member Variables:
bookid , customerid no of copies , price per each copy, bill
Member Functions :
Default constructor
Parameterized constructor
void new_order(int, int, int int) // Function to accept bookid, customer id, no. of copies, price
void display_details( )// Function to display the details
void calc_bill() // to calculate the total bill and stores in bill
int return_bill( ) // To return the bill
int return_copies()//To return no of copies ordered
int return_price( ) // To return price
Class Useorder
Write a main method which creates an object of the above class and call all the methods.
Q2. Read a list of numbers in a terminal window and display sum of even and odd numbers.
Q3.
c. Sum= ½ + 1/3 + ¼ ….. 1/n
d. 1
12
123
Q4. Display a menu with the following options
4. Prime number check
5. Palindrome number check
6. Exit
Depending on the choice do the needful
Q5. Read an array of 5 integers in a terminal window and display the same.
Project 28 – Area-Perimeter

Q1.Problem Description : Handling of different kinds of figures.

Display the following menu :

***** Main Menu *****


1. Area
2. perimeter
0. Exit
Select any figure.

Based on the figure selected, further show the menu as following:

If option selected is 1 (i.e. Area) menu is


a) Area of square
b) Area of Rectangle
c) Area of circle

If option selected is 2 (i.e. perimeter) menu is


a) Perimeter of a Triangle
b) Perimeter of a square
c) Perimeter of a rectangle
If option selected is 4 (i.e. Exit), program will terminate.
Make the appropriate choices and do the needful. Try to modularize the program (by creating the functions)
wherever it is possible. For any wrong input , give the proper error messages.
Q2. Read a list of numbers in a terminal window and display sum of positive and negative numbers.
Q3.
c. Sum= ½ - 1/3 + ¼ - 1/5….. 1/n
d. 1
1 2
1 2 3
Q4. Read an array of 5 integers in a terminal window and display the same.
Q5. – Student

Q1. Computer Science Project on Student


Class : Student
Member Variables:
rollno, Name, marks in 10 subjects(array), avg
Functions used :
Default constructor
Parameterized constructor
void new_student( int , String, int, int , int) // Function to accept roll no, name, eng, maths, science
void display_details( )// Function to display the details
void calcavg() // to calculate the average marks and store in avg
double return_average( ) // To return the average marks
String return_name()//To return the name
Class Usestudent
Write a main method which creates an object of the above class and call all the methods

Potrebbero piacerti anche