It is required to develop an application called Library System to maintain information about books and members in a library. (1) Write a class called Book having the following data members: title (String), author1 (String), author2(String), publisher (String), yearPublication (int), isbn (String), accessionNum (long), issuedTo (LibMember). Include following public methods in the class:
Q: Use BlueJ to write a java program that complete the following parts: "Employee" class: Create a…
A: Note: This code should be rewritten instead of copying to the compiler otherwise it will throw a…
Q: Create a class named 'Member' having the following members using C++: Data members 1 - Name 2 - Age…
A: The instructions are provided using programming languages. Programming languages include C, C++, and…
Q: Data members 1 - Name 2 - Age 3 - Ph
A: Code : #include<iostream>using namespace std; /*Member is an abstract class since it has…
Q: Design a class that holds the following personal data: name, address, age, and phone number. Write…
A: The required Python code: class Person: def __init__(self, name, address, age, phone): #…
Q: Create a class named 'Member' having the following members: Data members 1 - Name 2 - Age 3 - Phone…
A: EXPLANATION - A class employee is created and which inherit class member and declare…
Q: 4. Define a concrete dlass Sphere which extends the Shape class. a. It has radius field of type…
A: SHORT SUMMARY: Provided the source code and sample run as per the requirement. SOURCE CODE:…
Q: 1. Write the definition of a class that has the following properties: a. The name of the class is…
A: We need to create a Employee class which have 5 data members as emp name, department number, salary,…
Q: Create a class car with make, model, year, OwnerName, RegisNo, Insurers as private fields. Create…
A: We have to define a class Car and it's data member and member functions.
Q: Define a class called Country. A Country has populationSize, area, capital, currency, and…
A: Given: Define a class called Country. A Country has populationSize, area, capital, currency, and…
Q: (A) Write a class called Course having data members: courseNum (String such as ITCS214), courseName…
A:
Q: 2. Create a class named 'Member' having the following members: Data members 1 - Name 2 - Age 3 -…
A: public class Member{ //declaring instance variables private String name; private int age;…
Q: Q1) Given the following diagram, implement all the Classes and write a client code to test your…
A: ALGORITHM:- 1. Declare the classes and define their implementation. 2. Override the…
Q: Write the definition of a class named Employee to hold the data of the working hours of employees…
A: Answer: import java.util.*; class Employee { //Variables of Employee class String name;…
Q: You are required to write a program to build a class JewelleryItem. A jewellery Item has a type…
A: #include<iostream> #include<string> using namespace std; //declaring a classclass…
Q: he question #1 should be read as: hasValidPassword method that checks and return true if the…
A: Actually, given information: o An array of “Degree” object pointers (not objects)o Array’s lengtho…
Q: Design a class called Flight that will store data about a commercial flight. Data includes:…
A: Begin Enter the details of the flight Display the details of the flight End
Q: 1.Create a java application called Employee, then create 2 classes according to the following UML…
A: The java code and output is given in step 2.
Q: Create a base class called Vehicle with name, max_speed, and tank_size attributes. Then create a…
A: The required Python code is given below: class Vehicle: name="" max_speed=0 tank_size=0…
Q: Make a class with name(TerminalExam). Declare two variables i and j of type int in it. In…
A: using System; public class Tester { public static void Main() { TerminalExam t=new…
Q: Design FullTimeEmployee class and PartTimeEmployee class which inherit Employee class so that the…
A: Here I have created two derived classes FullTimeEmployee and PartTimeEmployee. In the classes, I…
Q: Part (1) Define a class as follow: a. create a class called Student that has four instance variables…
A: The program is written in Java. Please check the source code and output in the following steps.
Q: (b) Create a class car with make, model, year, OwnerName, RegisNo, Insurers as private fields.…
A: Find Source Code for program in step 2
Q: As part of conducting encapsulation related to a class, declare all instance variables in the class…
A: - We have to talk about the object priented ocncepts highlighted through the statements.
Q: Code this in c sharp : Develop "bank account class", which includes the following data: account…
A: Follow the next step for the code as,
Q: Given the following Imagine that is attached, select that all apply A. If the Other class extends…
A: When Other class extending Base class, then Other class becomes Child class where as Base class…
Q: You are required to build a class JewelleryItem. A jewellery Item has a type (string) , price…
A: public class JewelleryItem{ //instance variables private String type; private float price; private…
Q: a. Write a class named Student has the following data fields and methods: private int Id private…
A: *****NOTE: As programing language is not mentioned using c++ language to solve the above…
Q: Assume we have a class called Animals and within this class we have a method called toString(), and…
A: Calling an Object's Methods. You also use an object reference to invoke an object's…
Q: using c++: Write a class service (servant_name, tip, and the static total_tip and static…
A: /******************************************************************************…
Q: 1. Create an Employee class and do the following: a) Declare the following member variables:…
A: The output of the main class:
Q: IN C++ You are required to build a class to represent the a cup of coffee. Call your class…
A: Given: IN C++ You are required to build a class to represent the a cup of coffee. Call your class…
Q: What is the name of parameter used in setPrice?
A: We are given a code and in a function declaration we are asked which one is the function parameter?
Q: Create a class CommissionEmployee which has five protected instance variables - FirstName type…
A: Actually, Java is a high level programming language. And also object oriented . It. Is a platform…
Q: Add a private method simplify() to your Fraction class that converts a fraction to its simplest…
A: Objective: According to the given question, we need to add two methods to simplify the objects of…
Q: Part (1) Define a class with the following specification: a. Create a class called Employee that has…
A: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner…
Q: Suppose that the class Pet has a field called name that is of the type String. Write an assignment…
A: public Pet(String petsName) { } This is the constructor of class Pet. It accepts one argument of…
Q: Given the class definition below overload the + operator to be able to add 2 objects of type Time.…
A: Operator overloading is used to perform different operation using operators which have there…
Q: An examination consists of one or more examination items. Each of the examination items can be of…
A: Answers for all #1: ExamItem #2: Items #3: totalPoints #4: totalScore #5: static #6: class #7:…
Q: Problem: Develop a class encapsulating the concept of a college course, assuming that a course has…
A: The program has the following algorithm: Course.javaCreate default constructors.Test the “set”…
Q: onsider the following class definition. public class Gadget { private static int status = 0; public…
A: I give the correct answer with output screenshot as proof and also explain the reason for the…
Q: Q1: Write a complete JAVA program that carries out the following task s: Declare a class Video with…
A: Given:
Q: Consider the following class: Use C++ please. Code: class Vehicle{ private: int…
A: The following code is written in C++. It has initialized value of 50 for horsepower. The method…
Q: write a java programme: Vehicle class: First create an abstract Vehicle class that contains code…
A: To write a java program for given scenario which hold methods like class and interfaces. An…
Q: Question 7 Design the Programmer class such a way so that the following code provides the expected…
A: class Programmer: name = "" language = "" experience = 0 #Constructor def…
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: 1.3 Given the following class named Furniture. Class name : Furniture : String furnitureType; String…
A: code:- class Furniture{public:string furnitureType;string material;double pricePerUnit;int quantity;…
Q: Part (1) Define a class as follow: a. create a class called Student that has four instance variables…
A: Program Screenshot: Program: class Student{ String name; long StudentID; String College; double…
Q: public class Employee { private int hours; private double salary; private int vacationDays; public…
A: a) Java program that implements getHours(),getSalary(),getVacationDays(): class Employee{…
JAVA
Please solve Question 4
Please solve Question 4
Please solve Question 4
Please solve Question 4
Please solve Question 4
Step by step
Solved in 3 steps with 1 images
- Solve B please(A) Write a class called Course having data members: courseNum (String such as ITCS214), courseName (String such as Data Structures), credits (int), section (int). Include the following public methods in the class: Default constructor (without any parameters), constructor with 4 parameters, set and get methods for all attributes, equals and toString methods (B) Write a class called Student having following data fields: idNum (long), firstName (String), lastName (String), gender (char), email (String), coursesRegistered (ArrayList of type Course). Note that coursesRegistered is a list of type ArrayList (Java class) in which each element is of class type Course. The coursesRegistered is the list of courses in which the student is currently registered. It has following methods: Default constructor (without any parameters), constructor with 5 parameters (except for coursesRegistered), set and get methods for all attributes, equals, and printCoursesRegistered. The list…Given the following Imagine that is attached, select that all apply A. If the Other class extends the Base class then the method guessNumber() in Other overloads the method guessNumber in Base B. If the Other class extends the Base class then the method guessNumber() in Other overrides the method guessNumber in Base C. If the Base class implements MyInterface then it must implement the guessName method or declare it abstract. D. If the Base class implements MyInterface, then every class that extends the Base class also implements MyInterface. E. If the Other class extends the Base class, and implements MyInterface then the Base class also implements MyInterface F. MyInterface can have private methods specified.B)Create a class named 'Member' having the following members: Data members 1 - Name 2 - Age 3 - Phone number 4 - Address 5 - Salary It also has a method named 'printSalary' which prints the salary of the members. Two classes 'Employee' and 'Manager' inherits the 'Member' class. The 'Employee' and 'Manager' classes have data members 'specialization' and 'department' respectively. Now, assign name, age, phone number, address and salary to an employee and a manager by making an object of both of these classes and print the same.
- Assume method testQuestion() is a method in the Purchase class. Assume the Purchase class has a constructor that has parameters of name, groupCount, groupPrice, and numberBought. public Purchase testQuestion(Purchase p1, int newX) { newX = 20; this.setName("green beans"); p1.setName("corn"); Purchase p2 = new Purchase("broccoli", 5, 4.50, 10); return p2; } Referring to the above method, list the output that would be printed by Sysyem.out.println() when the following PurchaseDemo2 is executed. public class PurchaseDemo2 { public static void main(String[] args) { Purchase tomsPurchase = new Purchase("squash",4,3.50,6 ); Purchase jillsPurchase = new Purchase("carrot",8,1.99,4 ); Purchase billsPurchase;…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.Design a class that holds the following personal data: name, address, age, and phone number. Write appropriate accessor and mutator methods. Also, write a program that creates three instances of the class. One instance should hold your information, and the other two should hold your friends’ or family members’ information. my information: name= doe address= 51 any street age= 19 number= 732 810 9995 friends info: name= ella address= 174 any street age= 22 number= 732 895 3586 friends info: name= meg address= 34 any street age= 20 number= 732 337 5580
- Assume an Animal class defines a public eat method and a Dog class derived fromthe Animal class defines a different public eat method. And assume thedeclaration:Animal[] animals = {new Animal(), new Dog("Collie", "brown")};Indicate which eat method is invoked by each of the following statements, and explainwhy.animals[0].eat();animals[1].eat();You are required to build a class JewelleryItem. A jewellery Item has a type (string) , price (float),material (string), daysToGo (int).These attributes represent the type i.e ‘ear ring’, necklace, finger ring etc. The material can be gold,silver, plastic etc. The daysToGo attribute represents the number of days it will remain fit for use.1. You are required to provide the following parameterized constructors JewelleryItem(string type, float price, string material, int daysToGo) Jewlleryitem(string type, float price, int daysToGo) // the material will get “gold” as default JewelleryItem(string type, float price) //the material defaults to gold and daysToGo defaults to100.2. Now provide getters for each of the attributes above but setters for only price, daysToGo3. Provide a function/method makeUse(). This function represents the use of this item for one daywhich reduces the daysToGo by 1. This function returns true if the daysToGo is greater than 1 andfalse otherwise. This means…You are required to write a program to build a class JewelleryItem. A jewellery Item has a type (string) , price (float),material (string), daysToGo (int).These attributes represent the type i.e ‘ear ring’, necklace, finger ring etc. The material can be gold,silver, plastic etc. The daysToGo attribute represents the number of days it will remain fit for use.1. You are required to provide the following parameterized constructors JewelleryItem(string type, float price, string material, int daysToGo) Jewlleryitem(string type, float price, int daysToGo) // the material will get “gold” as default JewelleryItem(string type, float price) //the material defaults to gold and daysToGo defaults to100.2. Now provide getters for each of the attributes above but setters for only price, daysToGo3. Provide a function/method makeUse(). This function represents the use of this item for one daywhich reduces the daysToGo by 1. This function returns true if the daysToGo is greater than 1 andfalse…
- PLEASE FAST Define a class called Country. A Country has populationSize, area, capital, currency, and abbreviation (2-3 letters taken from the country name). Define at least two constructors, at least two getter methods, at least two setter methods, and Override the toString() and the equals() methods. The equals() method must return true if the two countries have the same name and same populationSize and false otherwise. The abbreviation is the first letter and the second letter of the country name and must be generated automatically (e.g. if the country name is Palestine the abbreviation is PA, if the country name is Jordan the abbreviation is JO.) Write a main method, define an array of country objects, read countries data from the user, if two countries have the same abbreviation add the last letter from the country name to the abbreviation of the country inserted last. Display countries whose area is greater than 10000 km2.Suppose that the class Pet has a field called name that is of the type String. Write an assignment statement in the body of the following constructor so that the name field will be initialized with the value of the constructor’s parameter. public Pet(String petsName) { }The question #1 should be read as: hasValidPassword method that checks and return true if the password is not the same as username and it does not contains the user id Question #2 should accept only 3 parameters instead of 4. But it will have the 4th parameter for output. 3 input parameters + 1 output parameter + integer return code. IN C++ • All data members must be declared as “private” • No global variable is allowed to be declared and used • Methods within the class and the requested functions cannot have “cin” or “cout” but it should make use of parameters and return value instead. • “cin” and “cout” should be done in main() or any testing functions • Make sure that you clearly show how the C++ class, its methods and all the functions are being called at least twice and print out its return value and its results properly.