1. Write a class “employee” to store following information Name, employee ID, Age, Marital Status, and Salary. WAP to store information for 3 employees and display the results.
2. Implement a class “number” having data members value This class has a member function FindDigit() to count the occurrences of each digit in number object. Ex-If value = 1123, O/P = 1-Two times, 2 – One times and 3- One times
3.Define a class named Complex for representing complex numbers. A complex
number has the general form a + ib, where a is the real part and b is the imaginary
part (i stands for imaginary). Complex arithmetic rules are as follows:
(a + ib) + (c + id) = (a + c) + i(b + d)
(a + ib) – (c + id) = (a + c) – i(b + d)
(a + ib) * (c + id) = (ac – bd) + i(bc + ad)
Define these operations as member functions of Complex.
4. Create a string by using class , encrypt it & display it according to given instructions. A-Z, a-z, 0-9,’=’, ’,’, ’.’------- No changes. The space is replaced by ‘+’. Any other character is replaced by ‘%’ followed by ASCII value of that character.
Friday, January 23, 2009
Wednesday, January 21, 2009
OOPS ASSIGNMENT - 3
1. Write a program which inputs a positive integer n and outputs 2 raised to the power of n.
2. WAp to calculates the weekly gross pay for a worker, based on the total number of hours worked and the hourly payrate.
Hint. weeklyPay = workDays * workHours * payRate
3. Write a program which inputs a temperature reading expressed in Fahrenheit and outputs its equivalent in Celsius, using the formula:
°C = 5/9 (° F - 32)
Compile and run the program. Its behavior should resemble this:
Temperature in Fahrenheit: 41
41 degrees Fahrenheit = 5 degrees Celsius
4. Create a class to find the sum of two numbers. This includes two data members, three member functions to input , output the data members and to find the sum of two data members.
5. Create a class to find the multiplication of two matrices. This include three data members of type arrays, three member functions, one is to accept two matrices, other to display two matrices and 3rd one is to find the multiplication of two matrices and display the result.
6. Create a class time with data members to store hours, minutes and seconds. WAP to input two times and find their sum.
7. Implement a class “number” having data members value and include following member functions
(i) IsEven()->Checks whether the value is even or odd
(ii) Findfactorial()->to calculate the factorial of the number
2. WAp to calculates the weekly gross pay for a worker, based on the total number of hours worked and the hourly payrate.
Hint. weeklyPay = workDays * workHours * payRate
3. Write a program which inputs a temperature reading expressed in Fahrenheit and outputs its equivalent in Celsius, using the formula:
°C = 5/9 (° F - 32)
Compile and run the program. Its behavior should resemble this:
Temperature in Fahrenheit: 41
41 degrees Fahrenheit = 5 degrees Celsius
4. Create a class to find the sum of two numbers. This includes two data members, three member functions to input , output the data members and to find the sum of two data members.
5. Create a class to find the multiplication of two matrices. This include three data members of type arrays, three member functions, one is to accept two matrices, other to display two matrices and 3rd one is to find the multiplication of two matrices and display the result.
6. Create a class time with data members to store hours, minutes and seconds. WAP to input two times and find their sum.
7. Implement a class “number” having data members value and include following member functions
(i) IsEven()->Checks whether the value is even or odd
(ii) Findfactorial()->to calculate the factorial of the number
Saturday, January 17, 2009
OOPS Concepts-1
1.Describe the principles of OOPS
2.Explain the advantages of OOPs with the examples.
3.What are OOPS concepts? Explain with examples?
4.what do you mean by Generalization & realization in oops
5.What is method Overriding ? What is it in OOPS
6. What is method Overriding ? What is it in OOPS
7.what are the advantages of oops over traditional programming?
8.What are the advantages of inheritance?
2.Explain the advantages of OOPs with the examples.
3.What are OOPS concepts? Explain with examples?
4.what do you mean by Generalization & realization in oops
5.What is method Overriding ? What is it in OOPS
6. What is method Overriding ? What is it in OOPS
7.what are the advantages of oops over traditional programming?
8.What are the advantages of inheritance?
Wednesday, January 14, 2009
OOPS ASSIGNMENT-2
Structure
1. Input student Name, Rollno, Branch, Age and telephoneno as a record through structure and display all the information.
2. Input Name, Degignation, Basic Salary of employee into the employee record and calculate
TA = 55% of Basic
DA = 65% of Basic
HRA = 35% of Basic
PF = 12% of Basic
Also calculate Group Salary and net salary
a) Use Array to structure to input minimum 3 records (3 persons data) and display all the records sequentially.
b Use pointer to structure to input minimum 3 records (3 persons data) and display all the records sequentially.
3. Input your date of Birth and current date through structure and calculate your age in Year, Month and days assume that 1 year = 365 days and 1 month = 30 days.
4. Create a student structure having data members roll, class & address, mark structure having data members roll, sub1, sub2, sub3 and a student detail structure having data members roll, class total marks, no of subject pass & overall pass. Those students who have appeared the exam, their information only stored in the mark structure array. Write a program which will collect the information & fill the data in student detail array depending on the pass criteria.
1. Input student Name, Rollno, Branch, Age and telephoneno as a record through structure and display all the information.
2. Input Name, Degignation, Basic Salary of employee into the employee record and calculate
TA = 55% of Basic
DA = 65% of Basic
HRA = 35% of Basic
PF = 12% of Basic
Also calculate Group Salary and net salary
a) Use Array to structure to input minimum 3 records (3 persons data) and display all the records sequentially.
b Use pointer to structure to input minimum 3 records (3 persons data) and display all the records sequentially.
3. Input your date of Birth and current date through structure and calculate your age in Year, Month and days assume that 1 year = 365 days and 1 month = 30 days.
4. Create a student structure having data members roll, class & address, mark structure having data members roll, sub1, sub2, sub3 and a student detail structure having data members roll, class total marks, no of subject pass & overall pass. Those students who have appeared the exam, their information only stored in the mark structure array. Write a program which will collect the information & fill the data in student detail array depending on the pass criteria.
Saturday, January 10, 2009
OOPS ASSIGNMENT-1
Function and Array
1. WAP to swap two numbers using function.
2. WAP using function which outputs all the prime numbers between 2 and a given positive integer n:
Hint:
void Primes (unsigned int n);
A number is prime if it is only divisible by itself and 1.
3. WAP to define an enumeration called Month for the months of the year and use it to define a function which takes a month as argument and returns it as a constant string.
4. WAP to define a recursive version of the Power function
5. WAP to write a function which returns the sum of a list of real values
Hint:
double Sum (int n, double val ...);
where n denotes the number of values in the list.
6. The following table specifies the major contents of four brands of breakfast cereals.
Define a two-dimensional array to capture this data:
------------Fiber ----Sugar-----Fat------Salt
Top Flake--12g------25g -------16g-----0.4g
Cornabix---22g-------4g --------8g-----0.3g
Oatabix-----28g ------5g---------9g-----0.5g
Ultrabran---32g------7g---------2g------0.2g
Write a function which outputs this table element by element.
1. WAP to swap two numbers using function.
2. WAP using function which outputs all the prime numbers between 2 and a given positive integer n:
Hint:
void Primes (unsigned int n);
A number is prime if it is only divisible by itself and 1.
3. WAP to define an enumeration called Month for the months of the year and use it to define a function which takes a month as argument and returns it as a constant string.
4. WAP to define a recursive version of the Power function
5. WAP to write a function which returns the sum of a list of real values
Hint:
double Sum (int n, double val ...);
where n denotes the number of values in the list.
6. The following table specifies the major contents of four brands of breakfast cereals.
Define a two-dimensional array to capture this data:
------------Fiber ----Sugar-----Fat------Salt
Top Flake--12g------25g -------16g-----0.4g
Cornabix---22g-------4g --------8g-----0.3g
Oatabix-----28g ------5g---------9g-----0.5g
Ultrabran---32g------7g---------2g------0.2g
Write a function which outputs this table element by element.
Monday, November 10, 2008
ORACLE Assignment-7
1.Write a query to display the current date. Label the column Date.
2.For each employee, display the employee number, last_name, salary, and salary increased by 15% and expressed as a whole number. Label the column New Salary. Place your SQL statement ina text file named lab3_2.sql.
3.Modify your query lab3_2.sql to add a column that subtracts the old salary fromthe new salary. Label the column Increase. Save the contents of the file as lab3_4.sql.Run the revised query.
4.Write a query that displays the employee’s last names with the first letter capitalized and all otherletters lowercase and the length of the name for all employees whose name starts with J, A, or M.Give each column an appropriate label. Sort the results by the employees’ last names.
5.For each employee, display the employee’s last name, and calculate the number of monthsbetween today and the date the employee was hired. Label the column MONTHS_WORKED. Orderyour results by the number of months employed. Round the number of months up to the closestwhole number.
6.Create a query to display the last name and salary for all employees. Format the salary to be 10characters long, left-padded with $. Label the column SALARY.
7.Using the DECODE function, write a query that displays the grade of all employees based on thevalue of the column JOB_ID, as per the following data:
JOB GRADE
AD_PRES A
ST_MAN B
IT_PROG C
SA_REP D
None of the above 0
2.For each employee, display the employee number, last_name, salary, and salary increased by 15% and expressed as a whole number. Label the column New Salary. Place your SQL statement ina text file named lab3_2.sql.
3.Modify your query lab3_2.sql to add a column that subtracts the old salary fromthe new salary. Label the column Increase. Save the contents of the file as lab3_4.sql.Run the revised query.
4.Write a query that displays the employee’s last names with the first letter capitalized and all otherletters lowercase and the length of the name for all employees whose name starts with J, A, or M.Give each column an appropriate label. Sort the results by the employees’ last names.
5.For each employee, display the employee’s last name, and calculate the number of monthsbetween today and the date the employee was hired. Label the column MONTHS_WORKED. Orderyour results by the number of months employed. Round the number of months up to the closestwhole number.
6.Create a query to display the last name and salary for all employees. Format the salary to be 10characters long, left-padded with $. Label the column SALARY.
7.Using the DECODE function, write a query that displays the grade of all employees based on thevalue of the column JOB_ID, as per the following data:
JOB GRADE
AD_PRES A
ST_MAN B
IT_PROG C
SA_REP D
None of the above 0
Subscribe to:
Posts (Atom)