Posts

Create two classes DM and DB which store the value of distances. DM stores distance in meters and centimeters and DB in feet and inches. Write a program that can read values for the class objects and add one object of DM with another object of DB by keeping following in mind. Use friendly function to carry out the addition. The object that stores the results may be a DM or DB object, Depending on the unit in which the results are required.

Q.)  Create two classes DM and DB which store the value of distances. DM stores distance in meters and centimeters and DB in feet and inches. Write a program that can read values for the class objects and add one object of DM with another object of DB by keeping following in mind. Use friendly function to carry out the addition. The object that stores the results may be a DM or DB object, Depending on the unit in which the results are required. #include <iostream>  using namespace std; class DM; class DB { float feet, inches; public: void init() { cout << "Enter The Distance in Feet :"; cin >> feet; cout << "Enter the Distance in inches : "; cin >> inches; } void display() { cout << "After Addition : \n"; cout << "Feet : " << feet << " Inches : " << inches << endl; } friend DB add(DM, DB); }; class DM { float meter, centimeter;      public:      void init() { cout <...

Section 7 DBMS

Image
  Section 7 Database Mangement System  1. You have the following EMPLOYEES table: EMPLOYEE_ID NUMBER(5) NOT NULL PRIMARY KEY FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) ADDRESS VARCHAR2(35) CITY VARCHAR2(25) STATE VARCHAR2(2) ZIP NUMBER(9) TELEPHONE NUMBER(10) DEPARTMENT_ID NUMBER(5) NOT NULL FOREIGN KEY The BONUS table includes the following columns: BONUS_ID NUMBER(5) NOT NULL PRIMARY KEY ANNUAL_SALARY NUMBER(10) BONUS_PCT NUMBER(3, 2) EMPLOYEE_ID VARCHAR2(5) NOT NULL FOREIGN KEY You want to determine the amount of each employee's bonus as a calculation of salary times bonus. Which of the following queries should you issue? SELECT e.first_name, e.last_name, b.annual_salary * b. bonus_pct FROM employees e, bonus b WHERE e.employee_id = b.employee_id; (*) 2. Oracle proprietary JOINS can use the WHERE clause for conditions other than the join-condition. True or False? True (*) False 3. What is the minimum number of join conditions required to join 5 tables together? One more...