Write a class Circle with the following properties and place the class in a separate header file: • Data Members • Radius • Center x location • Center y location Member Functions • Set and Get functions for all data members • Area function that returns the area of the circle • Distance function that has a single parameter of another Circle and returns the distance between the two circles Three parameter constructor (radius, x, y) Write a program that includes the Circle header file, constructs two different circles and demonstrates the area and distance functions.
Q: Write a program which has a class template for determining the largest and the smallest number from…
A: Define header file <iostream> for io operations. Define template T. Define class X. Define…
Q: Pure Abstract Base Class ProjectDefine a pure abstract base class called BasicShape. The BasicShape…
A: Program Approach:- It defines abstract class and its members. It defines the base class Circle.…
Q: Write the definition of class StorageFile and a test main() function. Class StorageFile does not…
A: #include<iostream> using namespace std; //create a class class StorageFile { private:…
Q: Write a program which has an abstract class called Number having an integer data member. The class…
A: An abstract class is a feature in object-oriented programming in which it hides the implementation…
Q: sold at the store. An Invoice should include four data members-a part number (type string), a part…
A: class name: Invoice class variables: partnumber, partdescription, Itemquantity and Itemprice…
Q: rite a simple C++ code I am a beginner. Subject: Object oriented programming Write a program that…
A: c ++ program is given below
Q: Write a program that declares two classes. The parent class is called Base that has two data members…
A: We will solve the given problem in Java language.
Q: Create a class Student that contains information about a student’s name, semester, roll no, and date…
A: Program Explanation: 1) Implement the header file. 2) Declare the integer 3) Implement the main type…
Q: Write a program to create a room class, the attributes of this class is roomno, roomtype, roomarea…
A: Since no programming language is mentioned, I am using java. Code: class Room{ int roomno;…
Q: Write a program that will create a CruiseShip class and CargoShip class both derived from an…
A: Given that, To write a program that will create a CruiseShip class and CargoShip class both derived…
Q: Write a base class Computer that contains data member of wordSize (in bits), memorySize (in…
A: Required: Write a base class Computer that contains data member of wordSize (in bits), memorySize…
Q: Define the struct call with the components code (of type char) and units (of type int). Design a…
A: Code: #include <iostream> #include <fstream> using namespace std;//structure call…
Q: 7. PersonData and CustomerData Classes Design a class named PersonData with the following member…
A: C++ Code: main.cpp #include <iostream>#include <iomanip>#include "PersonData.h"#include…
Q: Write a full class definition for a class named Player, and containing the following members: • A…
A: According to the information given:- We have to follow the instruction in order to get the desired…
Q: Construct a class named Circle that has a floating-point data member named radius. The class should…
A: The program is written in C++ Circle.h class Circle{ private : float radius; public:…
Q: Write a class named as vehicle which has some attributes this class has three functions.i.e.…
A: class name_of_derived_class : access_mode name_of_base_class { }; class Car : public Vehicle {…
Q: USE TEMPLATE PROVIDED AT END OF QUESTION WHILE MAKING SOLUTION -----------------------------------…
A: Here I have first of all completed the method generateBill() in the bill.cpp to display the bill…
Q: A class Student can have three member variables: name, age, and an array of grades of two exams…
A: #include <iostream> using namespace std; template <typename T> class Student { private:…
Q: Create a Circle class with a centre (x,y) and radius r. Use parameterized constructor to initialize…
A: //c++ program #include<iostream> using namespace std; class Circle{ public: int…
Q: Q4) Write a class "Rectangle'" with three data members: "width", "height" and "color"; and four…
A: Algorithm: Start Define a class Rectangle with length, width and color as its members Define init()…
Q: Company is the base class that holds • Data fields named companyID (of integer type), and…
A: GIVEN Company is the base class that holds• Data fields named companyID (of integer type), and…
Q: Write a full class definition for a class named Player, and containing the following members: • A…
A: I ran this and it works fine, maybe you were doing something different outside of the class because…
Q: A class named CafeService contains • Two data members i.e. the orderID and the price of food item(s)…
A: Program Approach:- Declaring class name as cafe service. Putting orderID and price in the…
Q: Write the contents of a specification file for a class named ContestResult that contains the…
A: A class is a group of objects which have common properties. A constructor is a method that is used…
Q: Create a class: "prime" with private data members: upper_limit(int) and parameterized constructor,…
A: #include <iostream>using namespace std;class prime{ private: //two private members…
Q: owing specifications. Include a prototype for a constructor and a member function named showData()…
A: A class named Time that has integer data members named secs, mins, and hours
Q: Write a class Circle with the following properties and place the class in a separate header file: •…
A: Class: A class is a blueprint of the object that contains the data members and member functions as…
Q: Write the definition of class StorageFile and a test main() function. Class StorageFile does not…
A: #include <iostream>using namespace std; int x;void externStorageClass(){ cout <<…
Q: The class a) Create a total of 5 member variables for the class by selecting the appropriate data…
A: The answer given as below:
Q: Using C++: Write a program that creates a Bus class that includes a bus ID number, number of seats,…
A: #include<iostream>#include<string>using namespace std; class bus{…
Q: Write a program to create a class teacher with the following data members. ID: Can be accessed only…
A: public class teacher { protected int ID; //protected members can be accessible in base…
Q: (a) Write code to create ‘Shape’ class and include following: 1. Create these private data members…
A: Note: This code should be rewritten instead of copying to the compiler otherwise it will throw a…
Q: Using C++: Write a program that creates a Bus class that includes a bus ID number, number of seats,…
A: The given problem is related to the Object-Oriented Programming concept and needs to create a class…
Q: n C++ write the definition of the class professorType, inherited from the class personType, defined…
A: Answer: The class doctor Type which inherited from the class personType is as follows: class…
Q: Write a class in C++ named Employee that has the following member variables: name. A string that…
A: #include <iostream>#include "Employee.cpp" //include file where class is written using…
Q: Part 1: Create a class DateType that has the following member variables: day (int), month(int), and…
A: Note: As per BARTLEBY guidelines, I can answer one question when multiple questions are posted. I…
Q: Write a class Employee with data members Name, Id, and Salary. Derive two classes, Faculty with data…
A: Step 1:- Program Approach:- 1.Include header file 2.Create the class Employee 3.Create the class…
Q: Design a class named MyPoint to represent a point with xand y-coordinates. The class contains: a.…
A: MyPoint -x: int -y:int + MyPoint() + MyPoint(int x,int y)
Q: Create a class called Name that contains data members of type string called first name, middle…
A: The Class ConstructorIt is a special function of a class that runs if new objects are created for…
Q: Write a class definition that creates a class called leverage with one private data member, crowbar,…
A: Define header file <iostream> for input output operations. Define class leverage. Define…
Q: Write a Triangle class which has members: side1, side2 and angle with appropriate data types for…
A: Programs: Programs are used to solve the complex problems and it is used to perform various tasks…
Q: Program: Circle.h and newCircle.cpp 1: Create a class specification file, Circle.h, that contains…
A: Answer :
Q: Write a program that declares two classes. The parent class is called Base that has two data members…
A: public class Base{ //declaring instance variables protected double n1; protected double n2;…
Q: A client changing the values of private data members is: lect one: O a. Possible using public…
A: Answer:- b. Possible using public functions and references.
Q: Design a class named MyPoint to represent a point with x- and y-coordinates. The class contains:…
A: The unified modeling language basically consists of many diagrams such as the use case diagram,…
Q: Given a class with the following specifications: Class: Cereal Data Members: string name, string…
A:
Q: Using c++ programming language. Write a class Distance that holds distances or measurements…
A: Given information, It is required to create a Distance class with specified variables and member…
Q: , Write a program that has variables to store Car data like; CarModel, CarName, CarPrice and…
A: Java program without creating the object: import java.util.Scanner; //create Car classpublic class…
Q: Construct a class named Circle that has a floating-point data member named radius. The class should…
A: Circle has a radius as an instance variable of the Circle class. The class contains the functions…
Q: Write a program that declares two classes. The parent class is called Base that has two data members…
A: Here I have created a class Base with 2 data members and 2 functions. In the function, I have…
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 1 images
- clockType.h file provided //clockType.h, the specification file for the class clockType#ifndef H_ClockType#define H_ClockType class clockType {public: void setTime(int hours, int minutes, int seconds); //Function to set the time. //The time is set according to the parameters. //Postcondition: hr = hours; min = minutes; // sec = seconds // The function checks whether the values of // hours, minutes, and seconds are valid. If a // value is invalid, the default value 0 is // assigned. void getTime(int& hours, int& minutes, int& seconds) const; //Function to return the time. //Postcondition: hours = hr; minutes = min; // seconds = sec void printTime() const; //Function to print the time. //Postcondition: The time is printed in the form // hh:mm:ss. void incrementSeconds(); //Function to increment the time by one…Book Donation App Create a book-app directory. The app can be used to manage book donations and track donors and books. The catalog is implemented using the following classes: 1. The app should have donors-repo.js to maintain the list of donors and allow adding, updating, and deleting donors. The donor object has donorID, firstName, lastName, and email properties. This module should implement the following functions: • getDonor(donorId): returns a donor by id. • addDonor(donor): adds a donor to the list of donors; donorID should be autoassigned a random number. • updateDonor(donor): updates the donor having the matching donorID. • deleteDonor(donorID): delete the donor with donorID from the list of donors, only if they are not associated with any books. 2. The app should have books-repo.js to maintain the list of donated books and allow adding, updating, and deleting books. The book object has bookID, title, authors, and donorID properties. • donorID references the book’s donor. This…Use Python Programming Language (The Stock class) Design a class named Stock to represent a company’s stock that contains: A private string data field named symbol for the stock’s symbol. A private string data field named name for the stock’s name. A private float data field named previousClosingPrice that stores the stock price for the previous day. A private float data field named currentPrice that stores the stock price for the current time. A constructor that creates a stock with the specified symbol, name, previous price, and current price. A get method for returning the stock name. A get method for returning the stock symbol. Get and set methods for getting/setting the stock’s previous price. Get and set methods for getting/setting the stock’s current price. A method named getChangePercent() that returns the percentage changed from previousClosingPrice to currentPrice. Write a test program that creates a Stock object with the stock symbol INTC, the name Inte lCorporation, the…
- IN C++ Lab #6: Shapes Create a class named Point. private attributes x and y of integer type. Create a class named Shape. private attributes: Point points[6] int howManyPoints; Create a Main Menu: Add a Triangle shape Add a Rectangle shape Add a Pentagon shape Add a Hexagon shape Exit All class functions should be well defined in the scope of this lab. Use operator overloading for the array in Shape class. Once you ask the points of any shape it will display in the terminal the points added.Chapter 15 Customer Employee Creator Create an object-oriented program that allows you to enter data for customers and employees. Each class will be stored in its own python file. Console Specifications Create a Person class that provides attributes for first name, last name, and email address. Include a parameter for each attribute in the constructor method. This class will provide a property or method that returns the person’s full name. Create a Customer class that inherits the Person class. This class must add an attribute for a customer Create an Employee class that inherits the Person class. This class must add an attribute for a social security number (SSN). Put the above three classes in a module named ‘company_objects’, separate from the application module. The program will create a Customer or Employee object from the data entered by the user and store the object in a single variable. Create a function that will display the Customer or Employee. The function will have a…Final - Patient ChargesCreate pseudocode, flowchart and python code for the Patient Charges program. This final project requires multiple files (modules, drivers, and your main).Design a class named Patient that has fields for the following data: ● First name, middle name, last name● Address, city, state, and ZIP code● Phone number● Name and phone number of emergency contactThe Patient class should have a constructor that accepts an argument for each field. The Patient class should also have accessor and mutator methods for each field.Next, write a class named Procedure that represents a medical procedure that has been performed on a patient. The Procedure class should have fields for the following data:● Name of the procedure● Date of the procedure● Name of the practitioner who performed the procedure● Charges for the procedureThe Procedure class should have a constructor that accepts an argument for each field. The Procedure class should also have accessor and mutator methods for…
- C++HurdleGame The HurdleGame class contains all the functions invoked as a result of a user action (i.e. when a user presses a key on the Hurdle Frontend, one of the functions in HurdleGame will be called. A HurdleGame object comprises a HurdleWords object (which stores all valid guesses and valid Hurdles), and a HurdleState object, which stores and tracks all the game states. Any action should update the HurdleState object.Each function in HurdleGame is called as a result of a user action on the Hurdle Frontend. To understand this, please read the Hurdle Backend API section below before implementing. You are responsible for implementing each of the functions below. LetterEntered ● Called by the Hurdle frontend when the user enters a letter. ● Hint: when a user enters a letter, how should the underlying HurdleState be modified to reflect the change resulting from that key press? WordSubmitted ● Called by the Hurdle front end when the user submits a guess by pressing enter. ● Hint: when…Objects and Pointers Write code to instantiate/create two Bicycle objects: a default object (my_bike) and a non-default object (sister_bike). For the non-default object you may hard-code (or make up) the required parameters (brand, price and wheel size). No console input is needed.Object oriented programming C++ Use Classes Write a C++ program in which each flight is required to have a date of departure, a time of departure, a date of arrival and a time of arrival. Furthermore, each flight has a unique flight ID and the information whether the flight is direct or not.Create a C++ class to model a flight. (Note: Make separate classes for Date and Time and use composition).add two integer data members to the Flight class, one to store the total number of seats in the flight and the other to store the number of seats that have been reserved. Provide all standard functions in each of the Date, Time and Flight classes (Constructors, set/get methods and display methods etc.).Add a member function delayFlight(int) in the Flight class to delay the flight by the number of minutes pass as input to this function. (For simplicity, assume that delaying a flight will not change the Date). Add a member function reserveSeat(int) which reserves the number of seats passed as…
- There should be a file for each. One file for EACH class(2 files), their function files (2 files) and a main file(1 file). In total, 5 files and its a class not a struct.Programming Language= PYTHON 1. Pet Class Write a class named Pet, which should have the following data attributes: • _ _name (for the name of a pet) • _ _animal_type (for the type of animal that a pet is. Example values are ‘Dog’, ‘Cat’, and ‘Bird’) • _ _age (for the pet’s age) The Pet class should have an _ _init_ _ method that creates these attributes. It should also have the following methods: • set_name This method assigns a value to the _ _name field. • set_animal_type This method assigns a value to the _ _animal_type field. • set_age This method assigns a value to the _ _age field. • get_name This method returns the value of the _ _ name field. • get_animal_type This method returns the value of the _ _animal_type field. • get_age This method returns the value of the _ _age field. Once you have written the class, write a program that creates an object of the class and prompts the user to enter the name, type, and age of his or her pet. This data should be stored as the object’s…Programming Language= PYTHON 1. Pet Class Write a class named Pet, which should have the following data attributes: • _ _name (for the name of a pet) • _ _animal_type (for the type of animal that a pet is. Example values are ‘Dog’, ‘Cat’, and ‘Bird’) • _ _age (for the pet’s age) The Pet class should have an _ _init_ _ method that creates these attributes. It should also have the following methods: • set_name This method assigns a value to the _ _name field. • set_animal_type This method assigns a value to the _ _animal_type field. • set_age This method assigns a value to the _ _age field. • get_name This method returns the value of the _ _ name field. • get_animal_type This method returns the value of the _ _animal_type field. • get_age This method returns the value of the _ _age field. Once you have written the class, write a program that creates an object of the class and prompts the user to enter the name, type, and age of his or her pet. This data should be stored as the object’s…