Vous êtes sur la page 1sur 1

PRACTICAL ASSIGNMENT ON STRUCTURES

Q.1 WAP a menu driven program in c++ to do following task on complex numbers having real and
imaginary part as integers
1. Add two complex numbers
2. Substract two complex numbers
3. Multiply two complex numbers
4. Devide two complex numbers
5. Exit
Q.2 WAP in c++ having a structure date with data members day, month, year as integers . Write a
UDF VALID_DATE( ) having date as a parameter passéd to it and find whether the date is valid or
not. (NOTE – Do the for check for leap year ). If valid display it otherwise print a error message
Q.3 WAP in c++ having a structure date with data members day, month, year as integers . Write a
UDF CHECK_DATE( ) having two dates as its parameter . The function will return 1, -1, 0 if first
date is greater than second, if first date is less than second, or if first date is same as second,
Q.4 WAP in c++ having a structure date with data members day, month, year as integers . Write a
UDF NEW_DATE( ) having date as its parameter and an integer n . The function will generate a new
date after adding n days to it. Check the validity of the new date and display it.
Q.5 Define a structure ACCOUNT with data members accno of type integer, customername of type
string, balance of type float, account_type of type char having values ‘S’ or ‘C’ . WAP in c++ using
menu driven program for 4 customers by using UDF for following purposes –
- initialize() – to initialize/ input data members
- withdraw() – to withdraw the money ( note- the withdraw is possible if the minimum
balance in account is Rs. 500)
- deposit() – to deposit money in account
- display(int accountno) – to display the information of a particular customer whose account
number is passed as a parameter
- status() – to show the status of all the customers

Vous aimerez peut-être aussi