6.1. An organization has two types of employees: regular and adhoc. Regular employees get a salary which is basic + DA + HRA where DA is 10% of basic and HRA is 30% of basic. Adhoc employees are daily wagers who get a salary which is equal to Number * Wage. (1) Define the classes shown in the following class hierarchy diagram: Employee name alary ) Regudor Adhoe wage Bade mber duys dnt n) ealary O valury () Page 38 of 80 (ii) Define the constructors. When a regular employee is created, basic must be a parameter. When adhoc employee is created wage must be a parameter. (iii) Define the destructors. (iv) Define the member functions for cach class. The member function days ( ) updates number of the Adhoc employee. (v) Write a test program to test the classes.
Q: Q: consider a class network of fig(1). The class result derives information from three branch…
A:
Q: Part II: Operator Overloading Given the following class: class WholeNumber { public: WholeNumber():…
A: THe answer is given below for the above given question:
Q: A class Student has Roll No, Branch, class Internal_exam has sub1marks, sub2 marks, class…
A: Given: A class Student has Roll No, Branch, class Internal_exam has sub1marks, sub2 marks, class…
Q: 6.3. An electricity board charges the following rates to domestic users to discourage large…
A: Program Approach: Include necessary header files required create a class electricity and declare…
Q: Assume class Four Wheel Drive implements DrivingUtils and classes Truck, Car, and Bus all inherit…
A: Answer: DrivingUtilities du; // 1 FourWheeler fw; // 2 Truck myTruck = new Truck(); // 3 du…
Q: --My father's data-- His eye: Brown His hair: Bald Family Car: 4 cars. • Write Let have program…
A: class MyFather: eye = "" hair = "" cars = 0 def __init__(self, eye, hair, cars):…
Q: 10.25 LAB: Book information (overriding member methods) Given the base class Book, define a…
A: Here I have created the class named Encyclopedia that extends class Book. In this class, I have…
Q: olve the following question correctly please. In OOP Is there any difference between abstract and…
A: In object-oriented programming, a class is a user-defined data type that contains two types of…
Q: (i) Define the classes shown in the following class hierarchy diagram: Employee name eno salary ()…
A: Hi there, Please find your solution below, I hope you would find my solution useful and helpful.…
Q: An electricity board charges the following rates to domestic users to discourage large consumption…
A: Since no programming language is mentioned, I am using java. Code: class Electricity{ int units;…
Q: Define two class types: Student and Graduate, where Graduate inherits from St udent. Class Student…
A: Sample Response: //C++ programming language//Tested on CodeBlock IDE#include <iostream>using…
Q: using C++ 0OP Q1: Consider a class network of fig(1). The class Result derives information from two…
A: Your C++ program is given below as you required with an output.
Q: 6. Consider the following classes and discuss/evaluate them in terms of Coupling, Cohesion…
A: Bоосh рrороses five metriсs tо meаsure the quаlity оf сlаsses:…
Q: QI: Discuss the following sentences: 1- Several different classes can use the same function name.
A: your question is about classes and function name. let see the solution of the question
Q: C++ Consider the following class definition: class first { public: void setX(); void print()…
A: Object oriented programming is about the creating objects which contains both data and…
Q: 1. Extend the programme in Part 1 (3) so that it has two constructors [Employee(String firstName,…
A: Code: Employee Class import java.util.LinkedList;class Employee{ private String firstName,…
Q: 2. Create a class Person and two derived classes Employee, and Student, inherited from class Person.…
A: Create a class Person and two derived classes Employee, and Student, inherited from class Person.…
Q: indly Give me (OOP) C++ codes for the following question. Question: Consider the following class…
A: PROGRAM CODING: #include<iostream.h>using namespace std;int main(){for(int a=0; a<=1;…
Q: Q: consider a class network of fig(1). The class result derives information from three branch…
A: Approach: In this code, there is used concept of friend function. To create function as friend of…
Q: .An electricity board charges the following rates to domestic users to discourage large consumption…
A: The main objective of the program is to create a c++ program with two classes called Electricity and…
Q: 26. Assume the declaration of Exercise 24. A. Write the staternents that derive the class dummyClass…
A: Dear Student, For inheritance we use the syntax - Class B extends A Here class B is the derived…
Q: Modify the payroll system of Figs. 10.4-10.9 to include an additional Employee subclass…
A: Given data, Modify the payroll system and include an additional Employee subclass…
Q: Q1: Consider a class network of the following figure. The class Result derives information from two…
A: Note :- You have not mentioned the language of the program so, i'm answering your question in C++…
Q: Develop a program having a base class Student with data members rollno, name and Class define a…
A: Code: #include <iostream> using namespace std; class Student{ // this is the student class…
Q: Consider the following class definition class father { protected : int age; public; father (int x)…
A: Given: Consider the following class definition class father { protected : int age; public; father…
Q: Example 1: write C++ program to create class called computer, that contains data members of word…
A: Here is the example of computer and laptop. And requirement is to create a class tablet. After…
Q: Q 1. a) A class Student has RollNo, name, class Internal_exam has sublmark, sub2marks, class…
A: Include the header files Create a class Student with data member rollno and name Define a getdata()…
Q: 4.a. Consider the class network of the following figure. Person Came code Account Admin salary No of…
A: The program is written in C++ #include <iostream>using namespace std;#include <string>…
Q: Define a class Money with proper constructor, accessors, mutators, and other member functions The…
A: Define a class Money with proper constructor, accessors, mutators, and other member functions The…
Q: An organization has two types of employees: regular and adhoc. Regular employees get a salary which…
A: Problem: Define a class Employee Having data members name an eno Define constructor Define…
Q: Q1: Consider a class network of the following figure. The class Result derives information from two…
A: Note :- You have not the language of the program so. i'm answering your question in C++ language.…
Q: T/F 4) Consider the following class hierarchy:Refer to Example Code Ch 09-1:A is a derived class of…
A: 4) Consider the following class hierarchy:Refer to Example Code Ch 09-1:A is a derived class of X.…
Q: 3. a. Define the class bankAccount to store a bank customer’s account number and balance. Suppose…
A: The code is written below for the given problem: #include<iostream> using namespace std;…
Q: Given the following partial class definition: public class A1 { public int x; private int y;…
A: Subclass: A class is said to be a subclass of another class if it is derived from that class. For…
Q: 5. a) Write a Class C which should extend Class B in the below example? class A { class B {
A: Note: There are multiple questions given in one question. According to the rule, you will get the…
Q: T/F 4) Consider the following class hierarchy: Refer to Example Code Ch 09-1: A is a derived…
A: Consider the following class hierarchy A is a derived class of X. T/F
Q: Consider the following code and write the complete definition of the mentioned class according to…
A: Code: #include <iostream>#include<string>using namespace std;class Employee{//class…
Q: Create a class: Doctor, with private data members: id, name, specialization and salary with public…
A: The programming methodology for the program is given by: Including header files class doctor Data…
Q: Ql: Consider a class network of the following figure. The class Result derives information from two…
A: program: #include <iostream> using namespace std;class Sci_info;class emp_info{ public:…
Q: PROBLEM B: Suppose that you want to define a class to group the attributes of an employee. There are…
A: using System;class personType { private string firstName; private string lastName;…
Q: Ql: Consider a class network of fig(1). The class Result derives information from two branch, find:…
A: Note :- You have not mention the language of the program so, i'm answering your question in C++…
Q: Consider a class "Fan" with two integer data members, "state" (0/1 i.e. on or off) and "speed". 1.…
A: UML class diagram of Fan class: Where state and speed are private data members of fan class. The…
Q: Q 1. Consider the following class definition class father { protected : int age; public; father (int…
A: Given:
Q: Create a class test with two private integer data members:x and Y and one member function:getdata ()…
A: #include <iostream> using namespace std;class test { private: //priate x,y int x;…
Q: Q. No.1: a) Implement the following class hierarchy. TEACHER AUTHOR SCHOLAR 1) Add appropriate data…
A: MULTIPLE INHERITANCE: inheriting a class from more then one class is called as multiple inheritance.…
Q: Define two class types: Student and Graduate, where Graduate inherits from Student. Class Student…
A: Code: #include <iostream>using namespace std;class Student{ protected: int id;…
Step by step
Solved in 2 steps with 1 images
- T/F 4) Consider the following class hierarchy: Refer to Example Code Ch 09-1: A is a derived class of X.Assuming a base class ABC has the following class variables. If class XYZ inherits class ABC, what would be the access specifiers for the variables in the derived class?write a phyton code: 1- define a class CommissionEmployee that:a. has a firstName, lastName, socialSecurityNumber, grossSales and commissionRateinstance variablesb. does initialize its properties to the values given at the time of instantiation withdefault valuesc. does provide a string representation when we call print on it2- define a class BaseCommissionEmployee, that is a CommissionEmployee anda. has a " baseSalary " property that tells us the base salary per weekb. does initialize its properties, inherited from CommissionEmployee class and definedin BaseCommissionEmployee, to the values given at the time of instantiation.c. has a method earnings that calculates and returns commission employee's pay(baseSalary + ( commissionRate * grossSales ))d. does provide a string representation when we call print on it3- define a class CommissionTester thata. has a method "main" to test the CommissionEmployee and BaseCommissionEmployeeclassesb. the main method must instantiate the class into…
- 10.11 C++ The base class Pet has protected data members petName, and petAge. The derived class Cat extends the Pet class and includes a private data member for catBreed. Complete main() to: create a generic pet and print information using PrintInfo(). create a Cat pet, use PrintInfo() to print information, and add a statement to print the cat's breed using the GetBreed() function. Ex. If the input is: Dobby 2 Kreacher 3 Scottish Fold the output is: Pet Information: Name: Dobby Age: 2 Pet Information: Name: Kreacher Age: 3 Breed: Scottish FoldExample Code Ch 09-4Given the following partial class definition:public class A1{public int x;private int y;protected int z;...}public class A2 extends A1{protected int a;private int b;...}public class A3 extends A2{private int q;...} 1. Refer to Example Code Ch 09-4: Which of the following is true with respect to A1, A2, and A3?a. A1 is a subclass of A2 and A2 is a subclass of A3b. A3 is a subclass of A2 and A2 is a subclass of A1c. A1 and A2 are both subclasses of A3d. A2 and A3 are both subclasses of A1e. A1, A2 and A3 are all subclasses of the class AAssume that we have four classes: Person, Teacher, Student, and PhDStudent. Teacherand Student are both subclasses of Person. PhDStudent is a subclass of Student.A.Which of the following assignments are legal, and why or why not?Person p1 = new Student();Person p2 = new PhDStudent();PhDStudent phd1 = new Student();Teacher t1 = new Person();Student s1 = new PhDStudent();Suppose that we have the following legal declarations and assignments:Person p1 = new Person();Person p2 = new Person();PhDStudent phd1 = new PhDStudent();Teacher t1 = new Teacher();Student s1 = new Student();B.Based on those just mentioned, which of the following assignments arelegal, and why or why not?s1 = p1;s1 = p2;p1 = s1;t1 = s1;s1 = phd1;phd1 = s1;
- Given the base class Book, define a derived class called Encyclopedia. Within the derived Encyclopedia class, define a print_info() method that overrides the Book class' print_info() method by printing not only the title, author, publisher, and publication date, but also the edition and number of volumes. Ex: If the input is: The Hobbit J. R. R. Tolkien George Allen & Unwin 21 September 1937 The Illustrated Encyclopedia of the Universe James W. Guthrie Watson-Guptill 2001 2nd 1 the output is: Book Information: Book Title: The Hobbit Author: J. R. R. Tolkien Publisher: George Allen & Unwin Publication Date: 21 September 1937 Book Information: Book Title: The Illustrated Encyclopedia of the Universe Author: James W. Guthrie Publisher: Watson-Guptill Publication Date: 2001 Edition: 2nd Number of Volumes: 1 python code to be used: class Book: def __init__(self, title, author, publisher, publication_date):…Create a class named Line: (a) Define private data members p1 and p2 as pointer to Point objects (the one we had in lectures), slope and length as double variables. (b) Define setter and getter functions. (c) Define a null-constructor that initializes numeric variables with zero and allocate dynamic memory for points and initialize them to [0,0] as well. (d) Overload a constructor that allocates memory for points, initilize them with given arguments, and calculate the slope and length. (e) Implement destructor, copy constructor and copy assignment operator. (f) Create a function called ”parallel” that takes too Line objects, returns true when given lines are parallel and returns false otherwise. (g) Overload the less than (<) and greater than (>) and equality (==) operators (compare the length). (h) Write a functions that reads lines in the format provided in the lines.txt from the file (without any change) and stores them in a vector named Lines. (i) Sort the objects of Lines…Let us create the shape class hierarchy. Create a Shape class which must be abstract since we are not going to create any instance of this class. Provide data members for storing area and volume in this class. Provide a virtual function for displaying the data members of this class, a virtual function for computing volume of a shape, and a virtual function for computing area of a shape.Derive two abstract classes TwoDimensional and ThreeDimensional from this class. Provide a virtual member function to display whether an object is 2-dimensional or 3-dimensional. Also include virtual area and volume functions so these calculations can be performed for objects of each concrete class in hierarchy. Implement the hierarchy and write a main program to test the polymorphic behavior of this class.define class by considering the followings: Enlist data members and methods with access specifies. Consider the polymorphism technique for the use of function overriding. Enlist constant and static…
- 10.25 LAB: Book information (overriding member methods) Given the base class Book, define a derived class called Encyclopedia. Within the derived Encyclopedia class, define a print_info() method that overrides the Book class' print_info() method by printing not only the title, author, publisher, and publication date, but also the edition and number of volumes. Ex: If the input is: The Hobbit J. R. R. Tolkien George Allen & Unwin 21 September 1937 The Illustrated Encyclopedia of the Universe James W. Guthrie Watson-Guptill 2001 2nd 1 the output is: Book Information: Book Title: The Hobbit Author: J. R. R. Tolkien Publisher: George Allen & Unwin Publication Date: 21 September 1937 Book Information: Book Title: The Illustrated Encyclopedia of the Universe Author: James W. Guthrie Publisher: Watson-Guptill Publication Date: 2001 Edition: 2nd Number of Volumes: 1 Python, please.Lab 8.1 Declare Card subclasses Consider using the following Card class. public class Card{ private String name; public Card() { name = ""; } public Card(String n) { name = n; } public String getName() { return name; } public boolean isExpired() { return false; } public String format() { return "Card holder: " + name; }} Use this class as a superclass to implement a hierarchy of related classes:Write declarations for each of the subclasses. For each subclass, supply private instance variables. Leave the bodies of the constructors and the format methods blank for now. Class Data IDCard ID number CallingCard Card number, PIN DriverLicesnse Expirationyear Important: DriverLicense is subclass of IDCard class Lab 8.2 Provide constructors for Card subclasses Implement constructors for each of the three subclasses. Each constructor should call the superclass constructor to set the name. Here is one example: public…8.8 LAB: Course information (derived classes) Use Java. Given main(), define a Course base class with methods to set and get the courseNumber and courseTitle. Also define a derived class OfferedCourse with methods to set and get instructorName, term, and classTime. Ex. If the input is: ECE287 Digital Systems Design ECE387 Embedded Systems Design Mark Patterson Fall 2018 WF: 2-3:30 pm the output is: Course Information: Course Number: ECE287 Course Title: Digital Systems Design Course Information: Course Number: ECE387 Course Title: Embedded Systems Design Instructor Name: Mark Patterson Term: Fall 2018 Class Time: WF: 2-3:30 pm import java.util.Scanner; public class CourseInformation {public static void main(String[] args) {Scanner scnr = new Scanner(System.in); Course myCourse = new Course();OfferedCourse myOfferedCourse = new OfferedCourse(); String courseNumber, courseTitle;String oCourseNumber, oCourseTitle, instructorName, term, classTime; courseNumber =…