Create a Car class with fields specified with the access modifiers: public door, private engine, and protected tire. All fields need to be Strings.
Q: Create a class called Name that represents a person's name. The class should have fields…
A: Class is a user-defined data type. The object is an instance of a class. The object contains the…
Q: So, the problem is: Create a class named BloodData that includes fields that hold a blood type (the…
A: class BloodData{private String bloodType,RhFact; public BloodData(){bloodType = "O";RhFact = "+";}…
Q: If a class contains only private data fields and no setter methods, is the class immutable?
A: Immutable means the data in the object should not be modified once it is created. So if we create…
Q: When fields are made private, client programs cannot see them directly. How do you allow classes…
A: Given: When fields are made private, client programs cannot see them directly. How do you allow…
Q: An Electronics Shop wants to keep track of its inventory. It needs to save information about each…
A:
Q: Write a mutator method called setAge that takes a single parameter of type int and sets the value of…
A: Here the mutator method doesn't return anything so the return data type is void.
Q: Write a class named DateExtract.cs, which will be used to extract the date of birth from the South…
A: Answer: Here not mention any programming language so we will write code in the C++ algorithms
Q: Create a Warrior class that has properties given below. • String name, • int health, • int strength.…
A: Required: Create a warrior class that has properties as:string name int health int strength.
Q: Add additional information to the student class below such as name, address, major, and contact…
A: Program description: The Student class will contain the additional data member fields to store name,…
Q: 3. Create a class called MyFriends, with the following attributes variables: a.…
A: Java Java is a kind of language that basically demonstrates language-oriented objects in which it…
Q: The TManager class will contain only one property - the array of 18 TBooking objects. Write the…
A: An array of objects can store N number of objects of a class. Each object can be referenced using an…
Q: D Create a class Sum with the following fields, constructors and methods: Fields: create two…
A: As per the requirement program is developed. Note: In the question programming language is not…
Q: Suppose that each of these classes has getMass () method that returns the m current object (double);…
A: Approach: The solarMass function will have a variable mass which will be initially set to the mass…
Q: Write a program in BlueJ using the following hints. 1. Create a class named Book and declare the…
A:
Q: Write a class Email that contain the following fields, which other classes may not access:
A: Java program: class Email { //instance fields private String to; private String from;…
Q: In main(), prompt the user for two items and create two objects of the ItemToPurchase class. Before…
A: In main(), prompt the user for two items and create two objects of the ItemToPurchase class. Before…
Q: Write a class called profileID, which has data members firstName, lastName, age, and birthday.…
A: Note: - As the programming language is not mentioned to implement the class, data members and…
Q: Write a program in BlueJ using the_following hints. 1. Create a class named Book and declare the…
A: The Answer to the Following Problem :-
Q: Please write an email class using OOP concept to send an email with "Information Technology" for the…
A: -> Everything is explained in code via comments import java.util.*;import javax.mail.*;import…
Q: SELECT
A: Class is collection of variables, methods etc .It is collection of all objects together .
Q: Assignment 2 Make a new class called Buffet which posses all the methods and attributes of the…
A: Given:
Q: Creates a class Student with 3 attributes: name, id and level. a. Add a constructor able to create a…
A: #include <iostream> using namespace std; class student{ // Declaring three attributes of…
Q: Create a class called Box with a variable: width of type double. Inside the class define a…
A: The program for the above mentioned question is given below in step 2.
Q: consider an application to support buying and selling vintage musical instruments. Create a CRC card…
A: DESCRIPTION: Relational Database Design: Customer(SSN, Title,First_Name,Middle_Name, Last_Name,…
Q: Create a Warrior class that has properties given below. String name, • int health, • int strength.…
A: Program is written in java language. Program code for Part 1: public class Warrior { //Declare…
Q: Encapsulate the Name class. Modify the existing code shown below to make its fields private, and add…
A: Following Code Given below
Q: 1. Create a class called Student, with the following attributes/variables: a. studentName (String)…
A: Answer: Our instruction is answer the first three part from the first part and . I have done code in…
Q: Create a Shape class that shall have color and filled instance variables of enum Color and boolean…
A: The programming instructions are as follows: Define a super class Shape using the given…
Q: Create a class named TestMovie that creates three movie instances with different values for name and…
A: The program is implemented in C++ with object oriented approach. The class has two data members,…
Q: Create a class named House With the 3 attributes named price, location and bulltyear of type double,…
A: Answer: class House { String brand; private boolean builtYear; double price; #constructor House(…
Q: Write a class called profilelD, which has data members firstName, lastName, age, and birthday.…
A: A required C++ program is as follows, File name: “main.cpp” #include <iostream>…
Q: Following the example of the Circle class in Section 9.2 , design a class named Stock that contains:…
A: package com.java; public class Stock { private String symbol; private String name; private…
Q: Write a statement to create an array, named productList, in a supportive class, with a size of TEN…
A: Note: As per our guidelines, we are allowed to answer only first question of multiple questions.…
Q: In the following questions, you will write a class called Patient that uses a class called…
A: import java.util.ArrayList; public class Patient { private int id; private String name;…
Q: Create a class Rectangle with attributes length and width with are variables, each of which defaults…
A: A Java program for the given criteria is as follows, File name: “Rectangle.java” import…
Q: create two data members on each of the four classes we created (MyPoint, Mysegment, MyShape, and…
A: code for given data is in next step:-
Q: Which of the following, can be done, with the help of the this reference? Allow one object to obtain…
A: This keyword: This keyword is used in programming languages such as Java for referring the current…
Q: Create a class named House with the 3 attributes named price, location and builtYear of type double…
A: In java, For each instance variable, a getter method returns its value while a setter method sets…
Q: Write a shoe class with the following attributes: color (e.g., "blue", "green", "orange")…
A: Step 1:- Given:- 1.Create a class Clothing and its attributes are color,displayName, and price…
Q: Create a class named Student that has fields for an ID
A: The question looks incomplete.
Q: Write an accessor method called getName that returns the value of a field called name, whose type is…
A: String getName();
Q: Q2. In the ClockDisplay example, create a NumberDisplay object with limit 80 in the Code Pad by…
A: I have Provided this answer with full description in step-2.
Q: Create an object of class LabClass. As the signature indicates, you need to specify the maximum…
A: Ans:) In this problem, I am assumed that a class LabClass is already created as no information is…
Q: Design a class called Pokemon using a parameterized constructor so that after executing the…
A: Here, Code instruction is given.
Q: Create a class Fraction with two integer final fields: numeratorand denominator. Its constructor…
A: Introduction of the Program: The Java program makes a Fraction class and this class has two member…
Q: Block class The Block class inherits from Drawable and it will draw a square with a black outline at…
A: The Drawable class is implemented as shown. Class Block inherits class Drawable and implements the…
Create a Car class with fields specified with the access modifiers: public door, private engine,
and protected tire. All fields need to be Strings.
Step by step
Solved in 2 steps
- Attached you will find a Java class called Employee. This class includes a constructor which sets name to blanks and salary to $0.00 and a constructor which sets name to a starting name and salary to a set amount. Additionally, the class includes methods to set the name and salary and return the name and salary. You will create a new class called Manager that inherits from the attached class Employee. Add a field named department of type String. Create a get and set method for the department variable. Supply a method toString that prints the manager's name, department, and salary. But you may not change anything in the Employee class. You will then create a test class that uses the Manager class. The test class should prompt the user to enter name, department and salary. This information should be stored in an array. Upon entry of an employee records, the program should output the information you entered.A field has access that is somewhere between public and private. static final Opackage Oprotecteda) Create an enumeration named Departments that contain four set of values FINANCE, HR, IT, and MARKETING.b) Create a class named PersonDetails that contains fields for a person’s first name (String), last name (String), and address (String). The class have- A constructor that accepts parameters for each field.- Get methods for each field.c) Create a class named Employee that contains fields for an employee ID (int), Social Security number (String), personal information (Person object), department (Departments type), and annual salary (double). The class have- A constructor that requires values for each data field.- Get methods for each of the data fields.- Set methods for each of the data fields.d) Create an application/class named EmployeeSort that allows a user to enter values for an array of 5 Employee objects (create an array of Employee type that will save 5 employee objects). Prompt a user for the data needed to create an employee object. Continue to prompt the user for Social…
- Design a Ship class that the following members: A field for the name of the ship (a string). A field for the year that the ship was built (a string). A constructor and appropriate accessors and mutators. A toString method that displays the ship’s name and the year it was built. Design a CruiseShip class that extends the Ship class. The CruiseShip class should have the following members: A field for the maximum number of passengers (an int). A constructor and appropriate accessors and mutators. A toString method that overrides the toString method in the base class. The CruiseShip class’s toString method should display only the ship’s name and the maximum number of passengers. Design a CargoShip class that extends the Ship class. The CargoShip class should have the following members: A field for the cargo capacity in tonnage (an int). A constructor and appropriate accessors and mutators. A toString method that overrides the toString method in the base class. The…a) Create an enumeration named Departments that contain four set of values FINANCE, HR, IT, and MARKETING.b) Create a class named PersonDetails that contains fields for a person’s first name (String), last name (String), and address (String). The class have- A constructor that accepts parameters for each field.- Get methods for each field.c) Create a class named Employee that contains fields for an employee ID (int), Social Security number (String), personal information (Person object), department (Departments type), and annual salary (double). The class have- A constructor that requires values for each data field.- Get methods for each of the data fields.- Set methods for each of the data fields.d) Create an application/class named EmployeeSort that allows a user to enter values for an array of 5 Employee objects (create an array of Employee type that will save 5 employee objects). Prompt a user for the data needed to create an employee object. Continue to prompt the user for Social…Design a Ship class that has the following members:a. A field for the name of the ship (a string).b. A field for the year that the ship was built (a string).c. A constructor and appropriate accessors and mutators.d. A toString method that displays the ship's name and the year it was built.Design a CruiseShip class that extends the Ship class. The CruiseShip class should have the following members:a. A field for the maximum number of passengers (an int).b. A constructor and appropriate accessors and mutators.c. A toString method that overrides the toString method in the base class. The CruiseShip class's toString method should display only the ship's name and the maximumnumber of passengers.Design a CargoShip class that extends the Ship class. The CargoShip class should have the following members:a. A field for the cargo capacity in tonnage (an int).b. A constructor and appropriate accessors and mutators.c. A toString method that overrides the toString method in the base class. The…
- 2. Car Class Write a class named car that has the following fields: ▪ yearModel. The year Model field is an int that holds the car's year model. ▪ make. The make field is a String object that holds the make of the car, such as "Ford", "Chevrolet", "Honda", etc. ▪ speed. The speed field is an int that holds the car's current speed. In addition, the class should have the following methods. ■ Constructor. The constructor should accept the car's year model and make as arguments. These values should be assigned to the object's year Model and make fields. The constructor should also assign 0 to the speed field.This is the question - Create a class named Rock that acts as a superclass for rock samples collected and catalogued by a natural history museum. The Rock class contains the following fields: sampleNumber - of type int description - A description of the type of rock (of type String) weight - The weight of the rock in grams (of type double) Include a constructor that accepts parameters for the sample number and weight. The Rock constructor sets the description value to "Unclassified". Include get methods for each field. Create three child classes named IgneousRock, SedimentaryRock, and MetamorphicRock. The constructors for these classes require parameters for the sample number and weight. Search the Internet for a brief description of each rock type and assign it to the description field using a method named setDescription inside of the constructor. I am only missing two checks and they seem to be with the rock, here is my code then I will copy one check - import java.util.*;…This is the question - Create a class named Rock that acts as a superclass for rock samples collected and catalogued by a natural history museum. The Rock class contains the following fields: sampleNumber - of type int description - A description of the type of rock (of type String) weight - The weight of the rock in grams (of type double) Include a constructor that accepts parameters for the sample number and weight. The Rock constructor sets the description value to "Unclassified". Include get methods for each field. Create three child classes named IgneousRock, SedimentaryRock, and MetamorphicRock. The constructors for these classes require parameters for the sample number and weight. Search the Internet for a brief description of each rock type and assign it to the description field using a method named setDescription inside of the constructor. This is the code I have, the program does not like at all what I have - import java.util.*; public class DemoRock { public static…
- Dice Rolling Class In this problem, you will need to create a program that simulates rolling dice. To start this project, you will first need to define the properties and behaviors of a single die that can be reused multiple times in your future code. This will be done by creating a Dice class. Create a Dice class that contains the following members: Two private integer variables to store the minimum and maximum roll possible. Two constructors that initialize the data members that store the min/max possible values of rolls. a constructor with default min/max values. a constructor that takes 2 input arguments corresponding to the min and max roll values Create a roll() function that returns a random number that is uniformly distributed between the minimum and maximum possible roll values. Create a small test program that asks the user to give a minValue and maxValue for a die, construct a single object of the Dice class with the constructor that initializes the min and max…Design a class named Pet, which should have the following fields: • name. The name field holds the name of a pet. • animal. The animal field holds the type of animal that a pet is. Example values are “Dog”, “Cat”, and “Bird”. • age. The age field holds the pet’s age. The Pet class should also have the following methods: • setName. The setName method stores a value in the name field. • setAnimal. The setAnimal method stores a value in the animal field. • setAge. The setAge method stores a value in the age field. • getName. The getName method returns the value of the name field. • getAnimal. The getAnimal method returns the value of the animal field. • getAge. The getAge method returns the value of the age field. Write the Java code for the Pet class and demonstrate it.Create a class named Person that holds the following fields: two String objects for the person’s first and last name and a LocalDate object for the person’s birthdate. Create a class named Couple that contains two Person objects. Create a class named Wedding for a wedding planner that includes the date of the wedding, the Couple being married, and a String for the location. Provide constructors for each class that accept parameters for each field, and provide get methods for each field.