Concept explainers
Redo
Want to see the full answer?
Check out a sample textbook solutionChapter 11 Solutions
Problem Solving with C++ (10th Edition)
Additional Engineering Textbook Solutions
Elementary Surveying: An Introduction To Geomatics (15th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Degarmo's Materials And Processes In Manufacturing
Concepts Of Programming Languages
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Thermodynamics: An Engineering Approach
- Write a C#program that uses a class called ClassRegistration as outlined below: The ClassRegistration class is responsible for keeping track of the student id numbers for students that register for a particular class. Each class has a maximum number of students that it can accommodate. Responsibilities of the ClassRegistration class: It is responsible for storing the student id numbers for a particular class (in an array of integers) It is responsible for adding new student id numbers to this list (returns boolean) It is responsible for checking if a student id is in the list (returns a boolean) It is responsible for getting a list of all students in the class (returns a string). It is responsible for returning the number of students registered for the class (returns an integer) It is responsible for returning the maximum number of students the class is allowed (returns an integer) It is responsible for returning the name of the class. (returns a string) ClassRegistration -…arrow_forwardWrite a C# program that uses a class called ClassRegistration as outlined below: The ClassRegistration class is responsible for keeping track of the student id numbers for students that register for a particular class. Each class has a maximum number of students that it can accommodate. Responsibilities of the ClassRegistration class: It is responsible for storing the student id numbers for a particular class (in an array of integers) It is responsible for adding new student id numbers to this list (returns boolean) It is responsible for checking if a student id is in the list (returns a boolean) It is responsible for getting a list of all students in the class (returns a string). It is responsible for returning the number of students registered for the class (returns an integer) It is responsible for returning the maximum number of students the class is allowed (returns an integer) It is responsible for returning the name of the class. (returns a string)arrow_forward# objected oriented programming in Python I need the solution of all below python question codes along with correct return. # 1. Implement a class named "MyClass"# This class should have:# * During instantiation of this class, the 'some_val' parameter should be set as# a variable with the same name in the instance# * Implement the method called 'plus_n' that takes one parameter (named 'n'), such that# it should return the sum of instance's 'some_val' variable and 'n'class MyClass: def __init__(self, some_val): # your code goes here instead of pass pass def plus_n(self, n): # your code goes here instead of pass pass ########################################################################################################################################################################################################################################## # 2. Given two classes 'Animal' and 'DigestiveSystem, implement, using COMPOSITION the method…arrow_forward
- Part – 3 (Abstract Class and Interface) Consider the Class that you designed in Part#1 of this project and do the following:1. Implement the Comparable and Cloneable interface for your class.2. The Test class should create 5 instances (objects) of your class.3. Store these instances in Array and ArrayList4. Show the demo of sorting these objects stored in Array and ArrayList Include the below in your project report: 1. Screenshot of relevant (Comparable and Cloneable) outputs.2. Code for all classes. part1: Part 1) CODE import java.util.ArrayList; import java.util.Arrays; import java.util.List; class Person { private String fName; private String lName; private String gender; private boolean isHungry; public Person() { fName = "John"; lName = "Doe"; gender = "Male"; isHungry = false; } public Person(String fName, String lName, String gender, boolean isHungry) { this.fName = fName; this.lName = lName;…arrow_forwardc# programMake a class called Employees, with attributes Name, Gender, Experience, Salary and ID.Make a delegate called EligiblePromo. This delegate takes an employees object as a parameter and returns a boolean value indication whether or not the employee should be promoted.Make a PromoteEmployee() method that takes an arraylist of Employees and delegate of type EligiblePromo as parametersNB: PromoteEmployee() methos loops through each Employees object and passes it to the delegate(25)arrow_forwardWrite in python. Write a class named Employee that has **private** data members for an employee's name, ID_number, salary, and email_address. It should have an init method that takes four values and uses them to initialize the data members. It should have get methods named get_name, get_ID_number, get_salary, and get_email_address.Write a separate function (not part of the Employee class) named **make_employee_dict** that takes as parameters a list of names, a list of ID numbers, a list of salaries and a list of email addresses (which are all the same length). The function should take the first value of each list and use them to create an Employee object. It should do the same with the second value of each list, etc. to the end of the lists. As it creates these objects, it should add them to a dictionary, where the key is the ID number and the value for that key is the whole Employee object. The function should return the resulting dictionary.For example, it could be used like…arrow_forward
- A class Student can have three member variables: name, age, and an array of grades of two exams marks [5]. The grades can be integers (0-100), doubles (0.0-100.00) and characters (A-F, where F denotes grades less than 50). Write a class template to accommodate all five types of grades. The class template must have two constructors (no-arg constructor, and aconstructor that takes 7 parameters: name, age and grades of 5 exams). Write a c++ function to read an object from console, and another function to print the object to the console. Implement the class template by creating three objects with three different types (int, double and char) of grades, and printing the objects on the console.arrow_forwardobjective of the project: Implement a class address. An address has a house number street optional apartment number city state postal code. All member variables should be private and the member functions should be public. Implement two constructors: one with an apartment number one without an appartment number. Implement a print function that prints the address with the street on one line and the city, state, and postal code on the next line. Implement a member function comesBefore that tests whether one address comes before another when the addresses are compared by postal code. Returns false if both zipcodes are equal. Use the provided main.cpp to start with. The code creates three instances of the Address class (three objects) to test your class. Each object will utilize a different constructor. You will need to add the class definition and implementation. The comesBefore function assumes one address comes before another based on zip code alone. The test will also return…arrow_forwardfor c++ Write a program that allows two players to play the tick-tac-toe game. Your program must contain the class ticTacToe to implement a ticTacToe object. Include a 3-by-3 two-dimensional array, as a private member variable, to create the board. If needed, include additional member variables. Some of the operations on a ticTacToe object are printing the current board, getting a move, checking if a move is valid, and determining the winner after each move. Add additional operations as needed.arrow_forward
- 82. Write a class definition for a class named Fraction that contains two integer fields named numerator and denominator. Include in the class a prototype for a method (function) named add that takes two Fraction objects as input arguments and returns a Fraction object as output. You do not need to provide an implementation of the add method.arrow_forwardDevelop class Polynomial. The internal representation of a Polynomial is an array of terms. Each term contains a coefficient and an exponent, e.g., the term 2?2 has the coefficient 2 and the exponent 2 and the term 3? has coefficient 3 and exponent 1. Develop a complete class that has private attributes of coefficient and exponent and that provides the following overloaded operator capabilities: • Overload the addition operator (+) to add two Polynomials• Overload the subtraction operator (-) to subtract two Polynomials.• Overload the multiplication operator (*) to multiply two Polynomials. • Overload the assignment operator (=) to assign one Polynomial to another. • Overload the equal operator (==) to check that two Polynomials are equal or not. • Overload the pre and post increment and decrement operators.arrow_forwardPlease add a destructor to the code. Solve this in C++arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education