Task 4. Utility classes Develop a Menu-Driven program of LinkedHashMap class using the scenario of Task 2 and perform the following operations. (15 marks) a. Create an object of LinkedHashMap class based on the scenario with explanations of the method used. b. Create a method that will allow adding an element to LinkedHashMap Class based on the scenario. The input field must be validated as necessary. c. Create a method to delete all elements in the LinkedHashMap with explanations of the method used. Task 5. Provide a detailed reflection on the following MOOC course given in the link below. Your
Q: Please design class template RankingList, where elements are sorted in such a way that the element…
A: Answer: I have done code and also I have attached code and code screenshot as well as output
Q: P1. In this question, you are provided a completed superclass - Shape (Do not make any changes to…
A: import java.util.*; abstract class Shape { abstract double calcArea(); abstract double…
Q: ses Implement a Menu-Driven program of ArrayList class using the above scenario and perform the…
A: It is defined as a part of collection framework. It is present in java.util package. It provides us…
Q: Assignment 2: - Create the first Apex class or program -- In this apex class, we have to create 2…
A: Answer is given below .
Q: Question 1: 1.1) Implement the book class that includes data values that describe various…
A: Question given: Write a program that create a class Book, and another class Dictionary inherited…
Q: reate a class Employee with following data members, name, id, and salary as private data member.…
A: Given: Create a class Employee with following data members, name, id, and salary as private data…
Q: Create a class Student with following data members, name, roll, and marks as private data member.…
A: Given: Create a class Student with following data members, name, roll, and marks as private…
Q: Create a class Student with following data members, name, roll, and marks as private data member.…
A: NOTE: SINCE THE LANGUAGE OF THE CODE IS NOT MENTIONED, I HAVE USED C++ FOR THE SOLUTION. Define…
Q: QUESTION 14 If a local variable or parameter in a method has the same execution. as a field of the…
A: If a local variable or parameter in a method has the same___________ execution. as a field of the…
Q: Create a class Student with following data members- name, roll no and marks as private data member.…
A: Operator overloading redefines the meaning of the existing operator. The comparative operators are…
Q: onsider a class named Graduate Course that includes Three data members i.e. o courselD (e.g.…
A: Consider a class named Graduate Course that includes Three data members i.e. o courselD (e.g.…
Q: 10. Write a class for 'LabRoom'; it will have member fields for no of chairs, no of tables, no of…
A: I give the code in java along with output and code screenshot
Q: What statement of the following is the most appropriate? Group of answer choices The node class…
A: Оften, when develорing сlаsses fоr different tyрes оf dаtа, а рrоgrаmmer must write…
Q: In Assignment 4, you created a Card class that represents a standard playing card. Use this to…
A: Representing a deck of cards:- To represent a deck of cards, we need 52 Card objects A possible…
Q: Design the PartnerAssignment class that contains: Two String arrays as attributes. A constructor…
A: Note: As no lanagauge is mentioned, therefore answering the given question in python. The class…
Q: Assume that a typical Reference Class called Student is accessible by the following method called…
A: In java string class compareTo() method is use to compare a two string lexicographically . It return…
Q: Write the definition of a class named taskClass that include the following private members: 1) list:…
A: public class taskClass { private String[] list; //array of type String to hold names of…
Q: Assume ContractEmployee, HourlyEmployee, CommissionEmployee, FixSalaryEmployee are sub-classes of…
A: Given question has asked to create a method Static void countAndPrintAllTypesOfEmployee which will…
Q: Create a class Employee with following data members, name, id, and salary as private data member.…
A: Procedure Followed: Include Header files. Create Class Employee: Start Class Employee. Declare…
Q: In Assignment 4, you created a Card class that represents a standard playing card. Use this to…
A: Actually, Java is a general-purpose also class-based, object-oriented programming language designed…
Q: - Prepare a MS. Word document that contain a UML represent a class of your choice, the class should…
A: UML diаgrаm оf а сlаss with given sрeсifiсаtiоns (I hаve сhоsen Рersоn сlаss):
Q: Develop a menu driven application that shall allow user to choose different option numbers to add,…
A: File1: User.java package com; public class User { public…
Q: Design a clans to display the schedule of buses inlellore Bustand. The class can have its own member…
A: As the programming language is not mentioned i am using Java for this question Here is the approach…
Q: Task 2: abstract Class: TwoDimensionShape Create an abstract class called "TwoDimensionShape", which…
A: Objective: An abstract class TwoDimensionalShape would be developed implementing the interface…
Q: 1. Create two instance list variables courses and grades for courses and grades and instance…
A: python code : class Student: def __init__(self, studentName, studentID):…
Q: Create the first Apex class or program -- In this apex class, we have to create 2 methods -- In the…
A: Required: Create the first Apex class or program-- In this apex class, we have to create 2…
Q: Object Orientation Question 5a 1. Provide code to define a class Sport to represent individual…
A: Python Code-#Sport class as according to the Question class Sport: def __init__(self, _name,…
Q: The method header includes it's accessibility modifier (for example, public), return type, name and…
A: 1)I am considering Employee has a 10000 per month so it will return the value 10000*numOfMonths And…
Q: Create a class Student in C++ with following data members- name, roll no and marks as private…
A: Required: Create a class Student in C++ with following data members- name, roll no and marks as…
Q: Create a class named Collection for which each object can hold integers. The class should have…
A: CODE- #include <iostream>using namespace std;class Collection { int *arr; int…
Q: Create a class Student in C++ with following data members- name, roll no and marks as private…
A: Code: #include <iostream>using namespace std; #define MAX 10 class student{ private:…
Q: 1. Consider the below class diagram, use StarUML to reproduce the diagram and generate the source…
A: Soution 1):--Given class diagram to reproduce it as follows:--
Q: Your task is to create a class name polygon that contains 2 data members i.e. length of type float…
A: //code: //include necessary header files#include<iostream>using namespace std;//creating a…
Q: Create a class Employee with following data members, name, id, and salary as private data member.…
A: Required: Create a class Employee with following data members, name, id, and salary as private data…
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 an n-sided regular polygon, all sides havethe same length and all angles have the same degree…
A: UML diagram:
Q: Provide a method addAttempt(int stId, String stName, double marks) a. This method creates an…
A: import java.util.*; public class Main{ public static void main(String[] args){ //create an…
Q: Implement LinkedListclass for this problema.Create an Employeeclass which will have details like…
A: Since no programming language is mentioned, I am using Java. Code: import…
Q: Creates a class called College with 6 attributes: a. maxStud: a maximum number of Student into the…
A: Note: As no programming language is mentioned. So I am using Java to answer this question.
Q: Question 1 Write a driver class as follows: Declare an array of type PCRTest. The array size is 10.…
A: Below is the code in java and sample output:
Q: c++ Create a class Employee that shall have multiple attributes i.e., name, salary, experience,…
A: I have Explained the code in comments of the code: 1. create a class with necessary variables 2.…
Q: Test the defined class by performing the following operations in a main function: • create a list…
A: Create hero class with necessary details Add str function to print details in given format create…
Q: Which of the following is wrong? The Object class is a superclass of all other classes. O A variable…
A: All class and array types may or may not inherit the methods of class Object. So this falls under…
Q: a- Prepare a MS. Word document that contain a UML represent a class of your choice, the class should…
A: package expert; /** * Sandwich, a class having private attributes, default and parameterized *…
Q: Create a class Department with attributes DName, DID, a dynamic listDTeachers of type string.Write…
A: Program Approach:- Using Department class. Show method. Applying Default constructor. Applying…
Q: Let Course be a class with a default constructor and a parameterized constructor that accepts a C-…
A: We need to choose the correct answer from the given options. We need to find that how many times the…
Q: Define a Student class that keeps student names (or ID numbers) and their grades (0 s grade s100).…
A: Answer : 1.class CourseGrades { int number_of_students; string course_name; Array[char] arr = new…
Q: Creates a class called CourseClass with 6 attributes: a. name: the course name; b. maxStud: a…
A: Java program to accept the Student detail in the CourseClass using different attributes. We have use…
Q: You are required to design an BeautyProduct class which has following attributes String…
A: The Java Code is written below
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Exercise: Exercises Write a class named Octagon that extends GeometricObject and implements the Comparable and Cloneable interfaces. Assume all eight sides of the octagon are of equal length. The area can be computed using the following formula: The Octagon class has a private double data field named side with its getter and setter methods. The class has a no-arg constructor that creates an Octagon with side 0, and a constructor to create an Octagon with a specified side. Write a test program that creates an Octagon object with side value 5 and displays its area and perimeter. Create a new object using the clone method, and compare the two objects using the compareTo method. As far as classes go, the abstract GeometricObject class contains the abstract doubles getArea() and getPerimeter(). The programming language used in this exercise is Java, and it covers the Interfaces topic. I did get how most of the program should look like, but I'm facing trouble understanding a few…This question involves the design of a class that will be used to produce practice problems. The following StudyPracticeinterface represents practice problems that can be used to study some subject. public interface StudyPractice. { /**Returns the current practive problem */ String getProblem(); /** Changes to the next practice problem */ void nextProblem(); } The MultPractice class is a StudyPracticethat produces multiplication practice problems. A MultPractice object is constructed with two integer values: first integer and initial second integer. The first integer is a value that remains constant and is used as the first integer in every practice problem. The initial second integer is used as the starting value for the second integer in the practice problems. This second value is incremented for each additional practice problem that is produced by the class. For example, a MultPractice object created with the call new MultPractice (7, 3)would be used to create the practice…Assume ContractEmployee, HourlyEmployee, CommissionEmployee, FixSalaryEmployee are sub-classes of Employee class. Define the body of below method suchthat it shall print how many employees of each type the ArrayList object passed as parametercontains? Static void countAndPrintAllTypesOfEmployee (ArrayList employees) { }
- Develop a program (or find one on the internet) to exemplify and document dynamic binding). A parent and two or more child classes are needed. Shape, Triangle, Rectangle are common examples where Shape is the parent and Triangle and Rectangle are the child classes. Create a project for the program, add the parent and childs classes to it. Use main to exemplify dynamic binding by creating an array or ArrayList of the parent class type and filling it with objects of the child class types. Loop through the array and display all the objects in it by calling their toString method. Then create a method whose parameter is the parent class type. Have main call the method sending it the child types. What the method does is up to you. Heavily document this program since this is not a prescribed assignment. I want to read your words. So I want you telling me what it does, how it does it, and how it has anything to do with dynamic binding. Then using screen capture software, take…TODO 2 Complete the TODO by finding the locations of the data samples for each iris flower type. Hint: Use the code for how we found all the setosa_locs as an example! Using iris_df, find the location of all the data sample locations for the versicolor class which has a label of 1. To do so, use NumPy's np.where() function. Using iris_df, find the location of all the data sample locations for the virginica class which has a label of 2. To do so, use NumPy's np.where() function. setosa_locs = np.where(iris_df['class'] == 0)[0] # TODO 2.1versicolor_locs = # TODO 2.2virginica_locs = todo_check([ (type(versicolor_locs) is np.ndarray, "'versicolor_locs' is not type np.ndarray. Make sure you indexed np.where() currently!"), (type(virginica_locs) is np.ndarray, "'virginica_locs' is not type np.ndarray. Make sure you indexed np.where() currently!"), (versicolor_locs[0] == 50, "'versicolor_locs' has an incorrect value"), (virginica_locs[0] == 100, "'virginica_locs' has an…Disease Covid-19 has symptoms, a unique id, and covid_19_status e.g. Symptomatic or Asyptomatic.Covid-19 can infect patients. A patients could have a patient-id, name, sneezing, coughing and fever and It has a method of checkPatient takes values of sneezing coughing and fever and display the result whether the patient is covid +ve or –ve according to the input values given by the user. Identity the classes (Attributes, function) in the above scenario? Can you code these classes and display the result If the input if 1 for all symptoms then display on console that patient is covid positive. Otherwise display a message it is covid negative?
- When it is useful to use extension methods? Question 21 options: a) All the answers are correct b) when extending functionalities of an interface type c) When extending functionalities of classes that can't be inherited from (e.g. sealed classes) d) when extending functionalities of a third party library that we don't have access to the source codeCreate an abstract NewspaperSubscription class with fields for the subscriber name, address, and rate. Include get and set methods for the name field and get methods for the address and subscription rate; the setAddress() method is abstract. Create two subclasses named PhysicalNewspaperSubscription and OnlineNewspaperSubscription. The parameter for the setAddress() method of the PhysicalNewspaperSubscription class must contain at least one digit; otherwise, an error message is displayed and the subscription rate is set to 0. If the address is valid, the subscription rate is assigned $15. The parameter for the setAddress() method of the OnlineNewspaperSubscription class must contain an at sign (@) or an error message is displayed. If the address is valid, the subscription rate is assigned $9. Finally, write an application that declares several objects of both subscription subtypes and displays their data fields1Declare an array to store objects of the class defined by the UML above. Use a method from the JOptionPane class to request the length of the array from the user. and Use a method from the JOptionPane class to request values from the user to initialize the instance variables of Election objects and assign these objects to the array. The array must be filled using this UMl
- 1). Develop a class named Department with two data members: name and size. The name cantake values such as "Finance", "Human Resources". size is for how many people work in thedepartment; You should provide all constructors, all get/set methods, and the toString method;2). Develop a class called Company which should have at least four data members: name,address, totalNumberOfEmployees, and departments (of type Department; an array). The relationbetween Company and Department is composition. The total number of employees is the sum ofthe sizes of all departments. You should provide all constructors, especially the constructor thatreceives departments as an initial value, all get/set methods, and the toString method;3). Create three departments: "Finance", "Human Resources", "IT". Test all constructors, andget/set methods, toString method; take screenshots;4). Create a company object with the above departments: "Finance", "Human Resources", "IT".Test all constructors, and get/set…Use java programming language 1.1 Create a Student Object project. Create a Student class and use the provided UML diagram to code the instance fields, constructors and methods. Note: The module mark is the average of the participation mark and the examination mark - calculate this using the calcModuleMark() method. The determineStNumber() method should compile a student number with the first 3 letters of the student's name, a '#' symbol, and a 3-digit randomly generated number (make use of a for-loop to concatenate these 3-digits). The stNumber data field should be set in the constructor by calling the determineStNumber() method. The toString() method must compile a string to display the student number, participation mark, examination mark, and module mark, formatted in table format. Student number PMark EMark MMark Mar#9186 81 64 72.00 1.2 Create a testStudents class. Do the following: -Write a static method called display() which receives…Task 2: Delivery Vehicle We want to develop a delivery vehicle that can carry a limited number of equally weighted boxes. To do this we can build off of our previous task by extending the BasicVehicle class. Instructions 1. Create a new class called DeliveryVehicle that is a subclass of BasicVehicle: • a private attribute cargoList of type String[] • a private attribute numItems of type int 2. Create a constructor that takes two parameters: a String for registration, and an int for maxCapacity: • pass on the registration parameter to the super constructor along with 0.0 for altitude, longitude and latitude. • use the maxCapacity parameter to create a new array for cargoList 3. Create a boolean method called isFull that returns if the cargoList is full. 4. Create a boolean method called isEmpty that returns if there are no boxes loaded. 5. Create a method called loadCargo that takes a String parameter description and adds the cargo description to the cargo list (if it is not already…