Sony TV Manufacturer want you to design a program that will help their customers to check the price along with the dimensions for their products to be purchased. For this Carefully read all the instructions and follow the requirements. o Create a class called SONY_TV along with two constructors as follows: o A Default constructor to set the length of TV. o A parameterized constructor that will receive the width in float. o By using a friend function calculate the area of the SonyTV o Create a member function to calculate the price of the sony TV by multiplying the area with Rs 100. o Create a show( ) function to show the details of the purchased sony TV. In the main you will construct three objects that will show the use of the two constructors. After calling the constructor it will call the area function, and then the price calculation function.
Initialize the class members using constructors and destroy the objects by using destructor
Define a class Student with the following specification:
PRIVATE DATA MEMBERS:
regno integer sname 20 character s1, s2. s3 float total float
PUBLIC MEMBER FUNCTIONS:
Student() Default constructor to initialize data members, s1 = s2 = s3 = 0
Student(rn, sn, m, p, c) Parameterized constructor accept values for regno, sname, s1, s2 and s3
calculate() Function to calculate the student total marks
putdata() Function to display all the data members of student
~student() Destructor to destroy the data objects
Runtime Input :
12
Ramesh
60
70
65
Output :
12
Ramesh
60
70
65
195
Let’s assume we have a class ‘Arithmetic’ with two member functions Add() and Subtract(). Suppose Add() function is defined within class then how will the subtract() function be defined out of the class boundary. Explain it with the help of some suitable program.
Consider relation EMPLOYEE. Suppose there are two applications that access EMPLOYEE. The first is issued at four sites and attempts to find the Salary of employee by given their numbers. Assume that we have set the simple predicates for application 1 are P1: Job-Title= PRESIDENT,P2: Job-Title= MANAGER, P3: Job-Title= ANALYST The second application is issued at two sites where the employee with a salary less than 15,00 USD are managed at one site, whereas those with salary grater then 15, 00 USD are managed at a second site. Suppose we set the simple predicates for site 2 are P4: Salary<15,00 USD, P5: Salary>=15,00 USD and P6: Commission= 400.00 USD. 1. Perform a horizontal fragmentation of relation EMP with respect to the predicates above. 2. Explain why the resulting fragments of Employee does not fulfill the correctness rules of fragmentation.
Given three variables x, y, z write a function to circularly shift their values to right. In other words if x = 5, y = 8, z = 10 after circular shift y = 5, z = 8, x =10 after circular shift y = 5, z = 8 and x = 10. Call the function with variables a, b, c to circularly shift values.
Mr. Hadi sent an email using 01 Gbps network bandwidth which contained a message size of 2.5-KB (Kilobyte) . Mr. John is X km away from sender (where X is 558) who received email at speed of light travels at 2.4 × 108 m/s. You may need to calculate propagation time and the transmission time for the entire communication, and also discuss the dominant factor in this communication. Draw the figure by labelling all above mentioned values and add screen shot in your answer along with your solution.
Write a program to manage the book store in which there is a class BOOK with five data members BookID, Title, Author, price and quantity. It also contains the following member functions:
• Input () function is used to input the values of data members.
• Display () function is used to display the values.
• Purchase () function is used to add to numbers of books in quantity.
• Sold () function is used to minus from the number of books from the quantity of book.
Create an object of BOOK. Input the values in data members of object and then display the data of object. In main () function, also use switch statement to prompt the user for choice of operations either to purchase or sell a book. Sold () function must also check the quantity available to sell.
A designer in 3D graphics company wants to design a matrix as a two-dimensional array. The size of 2D array could be the last two digit of arid number. Initially he creates a class matrix that provides the member function to check that no array index is out of bounds. Make the member data in the matrix class a 10-by-10 array. A constructor should allow the programmer to specify the actual dimensions of the matrix (provided they’re less than 10 by 10). The member functions that access data in the matrix will now need two index numbers: one for each dimension of the array. Here’s what a fragment of a main() program that operates on such a class might look like:
If my Arid Number is 20-Arid-254 then: // in case of zero consider next digit
matrix m1(5, 4); // define a matrix object
int temp = 12345; // define an int value
m1.putel(7, 4, temp); // insert value of temp into matrix at 7,4
temp = m1.getel(7, 4); // obtain value from matrix at 7,4
Q.No.2: A designer in 3D graphics company wants to design a matrix as a two-dimensional array. The size of 2D array could be the last two digit of arid number. Initially he creates a class matrix that provides the member function to check that no array index is out of bounds. Make the member data in the matrix class a 10-by-10 array. A constructor should allow the programmer to specify the actual dimensions of the matrix (provided they’re less than 10 by 10). The member functions that access data in the matrix will now need two index numbers: one for each dimension of the array. Here’s what a fragment of a main() program that operates on such a class might look like:
If my Arid Number is 20-Arid-254 then: // in case of zero consider next digit
matrix m1(5, 4); // define a matrix object
int temp = 12345; // define an int value
m1.putel(7, 4, temp); // insert value of temp into matrix at 7,4
temp = m1.getel(7, 4); // obtain value from matrix at 7,4
Q.No.3: Define a class called token number that incorporates a token’s number (could be the last 3 digits of your arid number) and its location. Number each token object as it is created. Use two variables of the angle class to represent the token’s latitude and longitude. A member function of the token class should get a position from the user and store it in the object; another should report the serial number and position. Design a main() program that creates three token, asks the user to input the position of each, and then displays each token’s number and position.