Define a class name engineClass that is used to create objects of engines. • The engine should has a data member horse_power , which is an integer • The engine should has a data member type , which is a string and stores the type information of the engine (e.g., diesel, gas, and electricity) o The engine should has a data member status , which is an integer that indicates whether the engine is running (1) or not (0) • Please define a member function operation , which is used to operate the engine (start or stop) by changing the status Define a class name vehicleClass that is used to create objects of vehicles o vehicleclass should has a data member engine with the type engineClass In the main function, creates two objects of vehcleClass
Q: Create a class named GeometricShape containing Two data fields shapeType (a string) area…
A: Java code: //create class "GeometricShape"class GeometricShape { // data fields String…
Q: C++ Declare a class Box. A box as you all know is something a cubical container. It has following…
A: As per the given question requirement, the C++ language is used. We provide a Code, Code Screenshot,…
Q: Question - Create a class named Pizza with the following data fields: description - of type String…
A: class Pizza { private String description; private double price; public Pizza(String desc, double…
Q: Absolute RequirementsThe Account class must be an abstract classwith two pure virtual functions,…
A: The complete code is given below with output.
Q: Create a class named CollegeCourse that includes data fields that hold the department (for example,…
A: UseCourse.java: import java.util.*;public class UseCourse{ public static void main(String[] args) {…
Q: Write a class named Car that has the following member variables: Year: An int that holds the cars…
A: Before going into these program let us know some valid definition's Class It is nothing but…
Q: Creates a class called Member with two integer x and y. a. Add a constructor able to create a Member…
A: We declare the constructor with two parameters and the default arguments is 0
Q: Create a class called Rational to be able to perform arithmetic operations with fractions. testing…
A: Note: The program has been implemented in java programming language. Code: import java.util.Scanner;…
Q: Define a class name engineClass that is used to create objects of engines. o The engine should has a…
A: Solution is in Step 2.
Q: Absolute Requirements The Account class must be an abstract class with two pure virtual functions,…
A: The solution for the above given question is given below:
Q: a String expression to represent an object's state. a. toString () b. abstract c. super () d. this…
A: 14 Extends 13)public 12) this() 11 super() a) ToString()
Q: Design a class named Person and its two subclasses, Student and Employee. Make Faculty and Staff…
A: To inherit attributes and methods from one class to another, inheritance concept is used.…
Q: public class Party { private int numofPeople; private double volumeOfMusic; /* missing constructor…
A: Please find the answer and the sample program in the below step. The program is written in Java.
Q: Java Object Oriented Programming Create a Shape class that shall have color and filled instance…
A: Answer in step2
Q: Create a class called Account that a bank might use to represent customers' bank accounts. Your…
A: The code is written in c++ to get the output as mentioned
Q: Design a console application that will print the cell phone bill of a customer. Make use of an…
A: Code is given below:
Q: Given the following interface, create a class named Tesla that implements the Car interface.…
A: The code with the necessary requirement is mentioned below:
Q: Q1) (The Cylinder class) Design a class named Cylinder The class contains: 1 Two private attributes…
A:
Q: Part-1 (Objects and Classes) Create a Java Project (with a class and a test class) to represent some…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: ✓ Details Create a class called Flower. Add one member variables color. Add only one getter function…
A: Your C++ program is given below as you required with an output.
Q: SUBJECT: OOP PROGRAMMING LANGUAGE: C++ ALSO ADD SCREENSHOTS OF OUTPUT. Write a class Distance…
A: A class is the fundamental unit of object oriented design. A class encapsulates data and operations…
Q: Create a class Employee a) private and static field nextAvailableID (int): create a static…
A: Then, write a Main method to test your class Employee. Create four Employee objects with…
Q: Design a Book class that holds the title, author’s name, and price of the book. Books’s constructor…
A: [Note: Since no language is mentioned, C++ is used. This code should be rewritten instead of…
Q: Create a class time24, each object is a value represented the time of day in the form hours, minutes…
A: A C++ program that satisfies the given criteria is as follows, File name: “main.cpp” #include…
Q: Create a class date, each object is a value represented the day in the year in form year, month,…
A: PROGRAM: date.h: class date { //declared private variables of integer type private: int hh;…
Q: a class date, each object is a value represented the day in the year in form year,month,day.Provide…
A: NOTE: - Since the programming language is not mentioned below program is implement in c++. Function…
Q: Make Faculty and Staff subclasses of Employee. A Person has a name, address, phone number, and…
A:
Q: 2. Create a program that implements all different kinds inhenitance. Use any object to represent…
A: Introdution:There are 6 types of inheritance in total. Single inheritance Multi-level…
Q: Design a class named Fan to represent a fan. The class contains: n An int data field named speed…
A: Code:- #include <iostream>using namespace std; class Fan{int speed;bool on;double…
Q: LANGUAGE When promoting the user you must always include text which lets the user know what should…
A: class Person: # init method or constructor def __init__(self): self.number=10…
Q: 10.1 (THE TIME CLASS) Design a class named Time. The class contains: · The data fields hour, minute,…
A: Answer :
Q: Define a base class shape that includes protected data members for area and volume of a shape,…
A: A pure virtual function is an abstract class function that is used to override the derived class. If…
Q: 10.1 (THE TIME CLASS) Design a class named Time. The class contains: · The data fields hour, minute,…
A: Given requirement, Design a class named Time. The class contains The data fields hour, minute, and…
Q: 1. Employee Class Write a class named Employee that has the following fields: • name. The name field…
A: import java.util.*;import java.lang.*;import java.io.*; class Employee{ //fields String name; int…
Q: (Java) The Sculpture Subclass Write class as follows: The class is named Sculpture, and it inherits…
A: ALGORITHM:- 1. Create class Painting. 2. Create class Sculpture inheriting the Painting class. 3.…
Q: • Define a class name engineClass that is used to create objects of engines. • The engine should has…
A: #include<iostream>using namespace std;//Defining class engineClassclass engineClass{ public:…
Q: Create a class called "Bank Account" that has separate data members for Name and Amount. One…
A: A class is the basic building block of object oriented modelling. It contains data(data members) and…
Q: Design a Book class that holds the title, author’s name, and price of the book. Books’s constructor…
A: Write the program as follows: Define the base class Book with the data members- title, author name,…
Q: Exercise 1-Account class • Design a class named Account that contains : • A private int data field…
A: Designing a account class with the following. • A private int data field named id for the account •…
Q: Create a class time24, each object is a value represented the time of day in the form hours, minutes…
A: Program: #include <iostream> using namespace std; class time24 {private: /* data */ int hours;…
Q: (The Account class) Design a class named Account that contains: 1 A private int data field named id…
A:
Q: Programming Problem No. 2: Create a class named CollegeCourse that includes data fields that hold…
A: Textual Code :- package package_name; public class collegeCourse { String sub1="ENG";…
Q: 2- Create a class time24, each object is a value represented the time of day in the form hours,…
A: Approach: Include the necessary header files along with namespace std. create a class time24…
Q: Design a class named MyDate. The class contains:■■ The data fields year, month, and day that…
A: Unified Modeling Language (UML) diagram for the class “MyDate” is as follows,
Q: (The MyDate class) Design a class named MyDate. The class contains: The data fields year, month, and…
A: Note : since programming language is not mentioned we are providing solution in java programming.…
Q: The Abstract Art Class Write an abstract class as follows: The class is named Art It inherits from…
A: specified your name as Pavanspecified class name as Artspecified course as Javaspecified activity as…
Q: Design a class named Square that defines a square geometric shape. The class needs to have a data…
A: The program is written in C Programming. Check the program screenshot for the correct indentation.…
Q: JAVA please help Design a class named Sandwich with data fields for description and price.…
A: Algorithm: 1. Create object using sandwich class. 2. Create object using DeliverySandwich class. 3.…
Q: Design a class named Employee. The class should keep the following information in fields: Employee…
A: Actually, given information: Design a class named Employee. The class should keep the following…
Q: Create a class date, each object is a value represented the day in the year in form year, month,…
A: Program: //included header file #include <iostream> //include namespace using namespace std;…
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images
- Using classes, design an online address book to keep track of the names, addresses, phone numbers, and dates of birth of family members, close friends, and certain business associates. Your program should be able to handle a maximum of 500 entries. Define a class addressType that can store a street address, city, state, and ZIP code. Use the appropriate functions to print and store the address. Also, use constructors to automatically initialize the member variables. Define a class extPersonType using the class personType (as defined in Example 10-10, Chapter 10), the class dateType (as designed in this chapters Programming Exercise 2), and the class addressType. Add a member variable to this class to classify the person as a family member, friend, or business associate. Also, add a member variable to store the phone number. Add (or override) the functions to print and store the appropriate information. Use constructors to automatically initialize the member variables. Define the class addressBookType using the previously defined classes. An object of the type addressBookType should be able to process a maximum of 500 entries. The program should perform the following operations: Load the data into the address book from a disk. Sort the address book by last name. Search for a person by last name. Print the address, phone number, and date of birth (if it exists) of a given person. Print the names of the people whose birthdays are in a given month. Print the names of all the people between two last names. Depending on the users request, print the names of all family members, friends, or business associates.Design a Ship class that has the following members: A member variable for the name of the ship (a string) A member variable for the year that the ship was built (a string) A default and parameterized constructor and appropriate getters and setters. A toString method that displays the ship’s name and the year it was built. Design a CruiseShip class that is derived from the Ship class. The CruiseShip class should have the following members: A member variable for the maximum number of passengers (an int) A default and parameterized constructor and appropriate getters and setters. A toString method that overrides the toString function in the base class. The CruiseShip class’s toString function should display only the ship’s name and the maximum number of passengers. Design a CargoShip class that is derived from the Ship class. The CargoShip class should have the following members: A member variable for the cargo capacity in tonnage (an int). A default and parameterized constructor and…Design a Ship class that has the following members: A member variable for the name of the ship (a string) A member variable for the year that the ship was built (a string) A default and parameterized constructor and appropriate getters and setters. A toString method that displays the ship’s name and the year it was built. Design a CruiseShip class that is derived from the Ship class. The CruiseShip class should have the following members: A member variable for the maximum number of passengers (an int) A default and parameterized constructor and appropriate getters and setters. A toString method that overrides the toString function in the base class. The CruiseShip class’s toString function should display only the ship’s name and the maximum number of passengers. Design a CargoShip class that is derived from the Ship class. The CargoShip class should have the following members: A member variable for the cargo capacity in tonnage (an int). A default and parameterized constructor and…
- in java Design a Ship class that has the following members: A member variable for the name of the ship (a string) A member variable for the year that the ship was built (a string) A default and parameterized constructor and appropriate getters and setters. A toString method that displays the ship’s name and the year it was built. Design a CruiseShip class that is derived from the Ship class. The CruiseShip class should have the following members: A member variable for the maximum number of passengers (an int) A default and parameterized constructor and appropriate getters and setters. A toString method that overrides the toString function in the base class. The CruiseShip class’s toString function should display only the ship’s name and the maximum number of passengers. Design a CargoShip class that is derived from the Ship class. The CargoShip class should have the following members: A member variable for the cargo capacity in tonnage (an int). A default and parameterized…Remaining Time: 35 minutes, 18 seconds, ¥ Question Completion Status: A class named Account is defined as the following. class Account } private: int id; double balance; public: //A constructor without parameter that creates a default account with id 0, balance 0 Account): /A constructor with the parameter that setting the id and balance Account(int, double), int getId); / return the ID double getBalance() //return the balance void withdraw(double amount) // the amount will be withdrawn void setlID(int), //set the ID void setBalance (double) //set the balance }: Assume that we will create a separate file of implementation of the function definition for the questions a) -b) a) Write a construction function definition with two parameters (ID and balance). b) Write a function definition of the function declaration (void withdraw(double amount):). c) Creates an Account object with an ID (1122) and balance ($20000). Then, write source codes to withdraw $2 MacBooProblem Statement:Define a class for a bank account that includes the following data members: Name of the depositor Account Number Type of account Balance amount in the accountThe class also contains the following member functions: A constructor to assign initial values Deposit function to deposit some amount. It should accept the amount asparameter. Withdraw function to withdraw an amount after checking the balance. Itshould accept the amount as parameter. Display function to display name and balance.
- INVENTORY CLASS You need to create an Inventory class containing the private data fields, as well as the methods for the Inventory class (object). Be sure your Inventory class defines the private data fields, at least one constructor, accessor and mutator methods, method overloading (to handle the data coming into the Inventory class as either a String and/or int/float), as well as all of the methods (methods to calculate) to manipulate the Inventory class (object). The data fields in the Inventory class include the inventory product number (int), inventory product description (String), inventory product price (float), inventory quantity on hand (int), inventory quantity on order (int), and inventory quantity sold (int). The Inventory class (java file) should also contain all of the static data fields, as well as static methods to handle the logic in counting all of the objects processed (counter), as well as totals (accumulators) for the total product inventory and the total product…Part 1: Design a Class You’ll design a class named Car that has the following fields: yearModel—An Integer that holds the car’s model year make—A String that holds the make of the car speed—An Integer that holds the car’s current speed The class should have the following constructor and other methods: The constructor should accept the car’s model year and make as arguments. These values should be assigned to the object’s yearModel and make fields. The constructor should also assign 0 to the speed field. Design appropriate accessor methods to get the values stored in an object’s yearModel, make, and speed fields. The accelerate method should add 5 to the speed field each time it’s called. The brake method should subtract 5 from the speed field each time it’s called. Create your class in a plain-text editor such as Notepad or TextEdit and save as a text file (*.txt). Part 2: Design a Program You’ll create both a pseudocode and you will create a flowchart to design a program that…Part 1: Design a Class You’ll design a class named Car that has the following fields: yearModel—An Integer that holds the car’s model year make—A String that holds the make of the car speed—An Integer that holds the car’s current speed The class should have the following constructor and other methods: The constructor should accept the car’s model year and make as arguments. These values should be assigned to the object’s yearModel and make fields. The constructor should also assign 0 to the speed field. Design appropriate accessor methods to get the values stored in an object’s yearModel, make, and speed fields. The accelerate method should add 5 to the speed field each time it’s called. The brake method should subtract 5 from the speed field each time it’s called. Create your class in a plain-text editor such as Notepad or TextEdit and save as a text file (*.txt). Part 2: Design a Program You’ll create both pseudocode and a flowchart to design a program that creates a Car object…
- Focus on classes, objects, methods and good programming style Your task is to create a BankAccount class. Class name BankAccount Attributes _balance float _pin integer Methods init () get_pin() check pin () deposit () withdraw () get_balance () The bank account will be protected by a 4-digit pin number (i.e. between 1000 and 9999). The pin should be generated randomly when the account object is created. The initial balance should be 0. get_pin () should return the pin. check_pin (pin) should check the argument against the saved pin and return True if it matches, False if it does not. deposit (amount) should receive the amount as the argument, add the amount to the account and return the new balance. withraw (amount) should check if the amount can be withdrawn (not more than is in the account), If so, remove the argument amount from the account and return the new balance if the transaction was successful. Return False if it was not. get_balance () should return the current balance.…Object composition is useful for creating a(n) _____relationship between two classes.Homework Assignment Chapter 10b Create a new Java Project named Chap10b Create a class named Vehicle that acts as a superclass for vehicle types. The Vehicle class contains private data fields for the number of wheels and the average number of miles per gallon. The Vehicle class contains getters and setters for the data fields. The Vehicle class also contains a constructor receiving integer parameters for the number of wheels and average miles per gallons, and a display() method that prints the required output (use get methods). Create two subclasses, Car and MotorCycle, that each extend the Vehicle class. Each subclass contains a constructor that accepts the miles-per-gallon value as an argument and forces the number of wheels to the appropriate value-2 for a MotorCycle and 4 for a Car. Use the superclass constructor to set the wheels and mpg data fields (use the super keyword). Write a UseVehicle class to instantiate one object of each subclass and calls the display method to print…