We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
1. Define a class Rectangle with two attributes: (This is for C++) -length, an integer (default value 1) -width, an integer (default value 1) Provide the following member functions: -default constructor -constructor that takes parameters used to initialize the data -get/set function for each attribute -a function perimeter that returns the perimeter of the rectangle -a function area that returns the area of the rectangle b. Write a program that uses the class Rectangle to create two rectangle objects with...
C++ In the code cell below, define a class named Student with an integer id and a string name. This class should have a constructor that takes two arguments: one for the id and the other for the name. Then Create another class named CollegeStudent that publicly inherits from Student. This class should have a protected member named major. It should also have a constructor that takes three arguments: id, name, and major. This constructor should delegate initializing the id...
Define a class Horse with two attributes, a string name and an integer numLegs. Write a two parameter constructor and a toString() method. *Write a class named Coll3 with a static method "updateName". There are three parameters to the method: a collection, an old name, and a new name. For every horse in the collection, if it has the same name as the parameter oldname, then replace the horse's name with the parameter new name. example: updateName({[X,4],[G,4],[X,3]}, X, Y) changes...
C++
Program 2 Consider a class Employee with data members: age (an integer), id (an integer) and salary (a float), and their corresponding member functions as follows: class Employee { private: int age; int id; float salary: public: Employee; // default constructor: age=0, id=0, and salary=0 void setAge(int x); // let age = x void setId(int x); // let id = x void setSalary(float x); // salary = x int getAge(); // return age int getId; // return id float...
Assume the existence of a class Arr with two (public) data members: a pointer to integer named arr_ptr, and an integer variable namedlength that will contain the number of elements in the array. Assume the variable a has been declared to be of type Arr, an array has been allocated and assigned to arr_ptr, and length has been assigned the proper value (i.e., the number of elements in the array). Write the code to add 1 to each element of...
C++ Define the class HotelRoom. The class has the following private data members: the room number (an integer) and daily rate (a double). Include a default constructor as well as a constructor with two parameters to initialize the room number and the room’s daily rate. The class should have get/set functions for all its private data members [3pts]. The constructors and the set functions must throw an invalid_argument exception if either one of the parameter values are negative. The exception...
Define a class for static Queue for storing integer numbers. Your class must include a constructor, a destructor, enqueue, dequeue, display, isFull, and isEmpty functions. Write a simple main function in your program that demonstrates the class
Define a C++ class managing objects using a
Linked List.
(10 points) Define a C++ class named "BirthdayList" that manages a list of Birthday objects as a linked list maintaining the order of entry (first birthday should be displayed first). Write a main function to show that you can add a list of birthdays and print out that list in the order that you have entered. (5 points) Add a "search" method into the "BirthdayList" class that accepts a Birthday...
c++ please need help with this question Consider a class Employee with data members: age(an integer), id (an integer) and salary (a float), and their corresponding member functions as follows: class Employee { private: int age; int id; float salary; public: Employee( ); // default constructor: age=0, id=0, and salary=0 Employee(Employee &x); // copy constructor Employee& operator = (Employee &x); // equal sign operator void setAge(int x); // let age = x...
in c++
Define and implement the class Employee with the following requirements: private data members string type name a. b. double type hourlyRate 2. public member functions a. default constructor that sets the data member name to blank"and hourlyRate to zero b. A constructor with parameters to initialize the private data members c. Set and get methods for all private data members d. A constant method weeklyPay() that receives a parameter representing the number of hours the employee worked per...