A class that is not intended to be instantiated, but used only as a base class, is called a(n) __________. a. dummy class b. subclass c. virtual class d. abstract class
Q: Create a constructor of MyClass, and call it: class MyClass { public: cout <« "Hello World!"; }; int…
A: Constructor name of a class is same as class name.
Q: Write a class called Circle with the required constructor and methods to get the following output.…
A: Create a class called circle and initialize the values to the data members of the class using the…
Q: Given the following code for the base class Ship write another class that inherits from Ship called…
A: Below is the required code and sample output:
Q: 3. Next to these lines, add the following code. class Apple int x - 5; Apple() {…
A: Super Keyword in Java: The super keyword in Java is a reference variable that is used to refer to…
Q: In the board game Scrabble, each tile contains a letter, which is used to spell words in rows and…
A: Actually, Java is an Object Oriented Programming language which is platform independent and robust…
Q: Q2: Any phone number such as (222) 767-1900 having three parts area code (222), exchange (767) and…
A: SOURCE CODE #include <iostream>using namespace std; //Defining the Class Named…
Q: a. create a class called Student that has four instance variables -a (String) name, a (long)…
A: Hi there, Please find your solution below, I hope you would find my solution useful. Thank You!
Q: Create a base class called Insect. All insects have a color and a size. The size is measured in…
A: According to the information given:- We have to write to code to implement class insect and the…
Q: What do you call a class that inherits a class? Select one: O a. Superclass O b. Class O. Subclass O…
A: Question 1: Inheritance is defined as a mechanism in which one object acquires all the properties…
Q: Q2. Write a class Bank that has the following data members –Account Holder name (ah_name[])…
A: Given: Q2. Write a class Bank that has the following data members –Account Holder name (ah_name[])…
Q: This program should be written in Java: Hamburger Joint: Hamburger Class Write a Hamburger class…
A: import java.util.*;public class Hamburger { String type; int patties; int cheese; double price;…
Q: Build the ItemToPurchase class with the following specifications: Attributes item_name (string) item…
A: The code is given in the below step
Q: Build the ItemToPurchase class with the following specifications: Attributes item_name (string)…
A: The code is given in the below step
Q: Write a program in java that contains a class named pen. Data members include price and color.…
A: static methods or static variable can be directly accessed through class name. Code with output…
Q: Create the a Person class with the following: Class Variables String firstname String lastname int…
A: Actually, Java is a high level programming language. And also object oriented . It. Is a platform…
Q: Define a class named Billionaire which will be used to represent an entry on Forbes list of the…
A: stod - used to parse from string to double stoi - used to parse from string to integer
Q: Implements Cloneable interface. Contain two member variables RollNo & Name. Initialize member…
A: 1- In this assignment require, implement a cloneable interface, two string types variable(roll no,…
Q: Build the ItemToPurchase class with the following specifications: Attributes item_name (string)…
A: the answer is given below:-
Q: write a class called OneItemBag ( OneItemBag.java ). This class represents a bag that can hold any…
A: According to the question, we have to write code for a class called OneItemBag ( OneItemBag.java ).…
Q: #this is a python program #topic: OOP Design a class called Pokemon using a parameterized…
A: Find Your Code Below
Q: In the board game Scrabble, each tile contains a letter, which is used to spell words in rows and…
A: INTRODUCTION: Import the required libraries whose classes and methods are to be used in the program…
Q: Write a class called Triangle with the required constructor and methods to get the following output.…
A: Since the question doesn't include the programming language use to code the problem so I am using…
Q: Given the base class definition, create a child class named Division that will use the following:…
A: The asked class dividend is given below -
Q: uppose you have opened an account with an initial amount of $50 and you have to add some more amount…
A: class AddAmount{ private int amount = 50; public AddAmount() //Default Constructor {…
Q: Write all the code necessary for a class Truck. A Truck can be described as having a make (string),…
A: An IllegalArgumentException is thrown to indicate an illegal argument has been passd to a method. It…
Q: Write a class called Triangle with the required constructor and methods to get the following output.…
A: Here, we have to write a python program for the above problem using the encapsulation topic.
Q: The classes Name and Date are separate classes used as properties in the Employee class. Class…
A: ANSWER:-
Q: QUESTION 7 A special method that is executed automatically when the class is instantiated. O a.…
A: 1) Constructor: A constructor is a special type of method of a class which initializes objects of a…
Q: A: Create a class called Computer. Add two additional classes; Laptop and Smartphone. Add the…
A: A: Computer.java file: public class Computer { protected int ram; protected int storage; protected…
Q: The classes Datelnfo and Student in different packages 1. Create two packages, calendar, and…
A: It is defined as a template/blueprint that describes the behavior/state that the object of its type…
Q: Create a "house" class that initializes house objects in the following way :…
A: """Program to create a class house, intialze it, get user monthly saving and display monthsneeded to…
Q: Write all code for a class Guitar as described here. A Guitaz can be described as having a number of…
A: public class Guitar{ public int numberOfStrings; public String manufacturer; public float…
Q: Design the Player class so that the code gives the expected output. [You are not allowed to change…
A: According to the provided information: We need to create a python code in which takes the Player's…
Q: Build the ItemTOPurchase class with the following specifications Attributes item_name (string)…
A: The code is given in the below step
Q: Create a class called Invoice that a hardware store might use to represent an invoice for an item…
A: Code: Invoice.java: class Invoice { // a: instance variables String partNum; String desc;…
Q: An online retailer sells six products whose prices are as follows: key description price 1…
A: Objective: We need to create a list of sales items with 6 items. Then based on sales we are creating…
Q: Rational numbers are used to represent fractions. Arithmetic operations can also be performed on…
A: Sample Response: //java program, tested on NetBeans IDE 12.0package rational;import…
Q: Create a base class called “Animal” which has two (2) class fields. The first field holds an integer…
A: class Animal{ int IDtag; String species; Animal(int IDtag,String species){ this.IDtag=IDtag;…
Q: 1. Create a class called House which has the following members- Private - no_of_room,…
A: Start Create a class name "House" declare private variable inside class and its getters and setters…
Q: Encircle/ write down the correct/missing code.Elaborate if needed by writing a comment. //this…
A: This is a simple code debugging question in java.
Q: In this question, we will bake a class. Create a class Cake , with the following instance…
A: import random class Cake: name = "" ingreds = [] price = 0 #Constructor def…
Q: If you assign a new instance of a subclass object to a super-class variable without casting, what…
A: Let us see the answer,
Q: Create a base class and also a class that is derived from the base class. The base class needs to…
A: Program: #include <iostream> #include <iomanip> using namespace std; //Animal…
Q: Device is a class. Computer is a subclass of the class Device. How can we invoke the constructor of…
A: To invoke the constructor of the class Device in the subclass Computer, we use the (c)…
Q: 1 Create a module named numericquestions. Inside the comdule create NumericQuestion class as a…
A: Answer: our instruction is answer the first three part from the first part and . I have attached…
Q: Build the ItemToPurchase class with the following specifications: Attributes item_name (string)…
A: The code is given in the below step
Q: Create a class called Invoice that a hardware store might use to represent an invoice for an item…
A: //including header sections#include <iostream>#include <string>#include "invoice.h"…
Q: 1- The private part of Class called -------- and the public part called 2- The class that inherits…
A: 1) The private part of Class called by function inside the class and the public part called by…
A class that is not intended to be instantiated, but used only as a base class, is called
a(n) __________.
a. dummy class
b. subclass
c. virtual class
d. abstract class
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Write a program named SalespersonDemo that instantiates objects using classes named Real EstateSalesperson and GirlScout. Demonstrate that each object can use a SalesSpeech() method appropriately. Also, use a MakeSale() method two or three times with each object, and display the final contents of each objects data fields. First, create an abstract class named Salesperson. Fields include first and last names; the Salesperson constructor requires both these values. Include properties for the fields. Include a method that returns a string that holds the Salespersons full name—the first and last names separated by a space. Then perform the following Create two child classes of Salesperson: Real EstateSalesperson and Girl Scout. The Real EstateSalesperson class contains fields for total value sold in dollars and total commission earned (both of which are initialized to 0), and a commission rate field required by the class constructor. The Girl Scout class includes a field to hold the number of boxes of cookies sold, which is initialized to 0. Include properties for every field. Create an interface named ISell able that contains two methods: SalesSpeech() and MakeSale(). In each Real EstateSalesperson and Girl Scout class, implement SalesSpeech() to display an appropriate one- or two-sentence sales speech that the objects of the class could use. In the Real Estatesalesperson class, implement the MakeSale() method to accept an integer dollar value for a house, add the value to the Real EstateSalespersons total value sold, and compute the total commission earned. In the Girl Scout class, implement the MakeSale() method to accept an integer representing the number of boxes of cookies sold and add it to the total field.In the board game Scrabble, each tile contains a letter, which is used to spell words in rows and columns, and a score, which is used to determine the value of words. The point of this exercise is to practice the mechanical part of creating a new class definition: Write a definition for a class named Tile that represents Scrabble tiles. The instance variables should be a character named "letter" and an integer named "value". Write a constructor that takes parameters named letter and value, and initializes the instance variables. Create getters for both of the attributes. (No setters, so that a Tile is immutable.) Implement the .toString() and .equals methods for a Tile. Your completed Tile class should work with this Main program (Links to an external site.) so that it produces sample output like shown at the end of the program. You can Fork the program to make your own version in Replit, where you can add your Tile.java, or you can copy the program to your own Java development…Step 3: Add a basic WineCase class and allow a buyer to select a case of wine to buy. Write a basic WineCase class to represent a case of wine. A WineCase object has four fields: refNo (a unique sequence of letters and digits), description (e.g. "chablis", "white burgundy" or similar), noOfBottles (in the case) and price (the price of the case in pounds). The constructor for the class should be passed suitable arguments to initialise these four fields. Add a selectWineCase() method to the Browser class which allows a browser to choose a case of wine provided that browser is a buyer. This method is passed a WineCase object as a parameter. You should declare a new field wineCase in the Browser class in order to store the case of wine selected. Make the selectWinecase() method print a message to the terminal window about the selection. An example is shown below: Buyer with ID 6732 has selected wine case with reference number LO786, a case of 2018 Pinot…
- Step 3: Add a basic WineCase class and allow a buyer to select a case of wine to buy. Write a basic WineCase class to represent a case of wine. A WineCase object has four fields: refNo (a unique sequence of letters and digits), description (e.g. "chablis", "white burgundy" or similar), noOfBottles (in the case) and price (the price of the case in pounds). The constructor for the class should be passed suitable arguments to initialise these four fields. Add a selectWineCase() method to the Browser class which allows a browser to choose a case of wine provided that browser is a buyer. This method is passed a WineCase object as a parameter. You should declare a new field wineCase in the Browser class in order to store the case of wine selected. Make the selectWinecase() method print a message to the terminal window about the selection. An example is shown below: Buyer with ID 6732 has selected wine case with reference number LO786, a case of 2018 Pinot…Create a base class called “Animal” which has two (2) class fields. The first field holds an integer “IDtag” for a number that a zoo uses to catalogue their animals and the second field holds a string called “species.”From the Animal class, derive two (2) classes. One is called “Bird” and the other “Reptile”. E.g. Species could be (for the Bird class) ostrich, dove, chicken etc. and (for the Reptile class) lizard, snake, bearded dragon etc.The Bird class has an additional class field called “colour” which holds the colour of the birds feathers (int – 1=grey, 2=white, 3=black). The reptile class has an additional class field called “bloodTemp” which hold the reptile’s temperature of their blood (double).You need to instantiate two (2) objects. The bird object will be called “brd” and the reptile object called “rept.”Input values for the bird’s IDtag, species and feather colour (int) and for the reptile’s IDtag number, species and bloodTemp. Override the Animal class’s input and output…In the board game Scrabble, each tile contains a letter, which is used to spell words in rows and columns, and a score, which is used to determine the value of words. The point of this exercise is to practice the mechanical part of creating a new class definition: Write a definition for a class named Tile that represents Scrabble tiles. The instance variables should be a character named "letter" and an integer named "value".
- Create an abstract class named Element that holds properties of elements,including their symbol, atomic number, and atomic weight. Include aconstructor that requires values for all three properties and a get method for each value. (For example, the symbol for carbon is C, its atomic number is 6, and its atomic weight is 12.01. You can find these values by reading a periodic table in a chemistry reference or by searching the Internet.) Also include an abstract method named describeElement(). Create two extended classes named MetalElement and NonMetalElement. Each contains a describeElement() method that displays the details of the element and a brief explanation of the properties of the element type. For example, metals are good conductors of electricity, while nonmetals are poor conductorswrite a class called OneItemBag ( OneItemBag.java ). This class represents a bag that can hold any single type of object (decided at bag-creation time), and only one item of that type at a time. You may have a zero-parameter constructor if you want one, but you must have the following three features:1. a method that puts an item in the bag (addItem()) which returns whether or not it was successfully added2. a method that removes an item from the bag and returns it (removeItem()), return null if there is no item3. a method to check if an item is in the bag (hasItem()) which returns true or falseCreate an abstract class called Student. The Student class includes a name and aBoolean value representing full-time status. Include an abstract method to determinethe tuition, with full-time students paying a flat fee of $2,000 and part-time studentspaying $200 per credit hour. Create two subclasses called FullTime and PartTime.Create an application that demonstrates how to create objects of both subclasses.Save the files as Student.java, FullTime.java, PartTime.java, and UseStudent.java.
- Create an abstract super class called Employee with the following attributes: Use JavaDoc comments in the Parent and Child Classes only but use @author for the driver name : String and the following methods getter and setter for the one attribute two constructors an abstract method called getPay() equals() toString() Create a sub class of Employee called SalaryEmployee with the following attribute yearlyPay : double and the following methods getter and setter for the one attribute two constructors getPay() that returns the yearlyPay divided by 52 equals() toString() Create a sub class of Employee called HourlyEmployee with the following attributes: hoursWorked : double payrate : double and the following methods getters and setters for the two attributes two constructors getPay() that returns the weekly pay (multiply hoursWorked by payrate - overtime included and 1.5 times payrate for hours > 40) equals() toString() Create a sub class of Employee called SalesEmployee with the…-------Answer code question below--------- Create a class Student with the following characteristics Implements Cloneable interface. Contain two member variables RollNo & Name. Initialize member variable of using the parameterized (2 parameters) constructor. Implement getRollNo and getName methods which returns respective variable values. Input: PGMCA2017 Amit where, The first line contains RollNo. The second line contains Name. Output PGMCA2017 Amit solution.java code below:-------Answer code question below--------- Create a class Student with the following characteristics Implements Cloneable interface. Contain two member variables RollNo & Name. Initialize member variable of using the parameterized (2 parameters) constructor. Implement getRollNo and getName methods which returns respective variable values. Input: PGMCA2017 Amit where, The first line contains RollNo. The second line contains Name. Output: PGMCA2017 Amit solution.java code below: *Do not change any other part of the code other than where it says you can.