Select the class relationship that best describes the following scenario: • Class B creates an instance of Class A in its constructor. • Class B then assigns the Class A instance to one of its own attributes. • Class B does not contain any means for other classes to access the Class A instance.
Q: JAVA CODE PLEASE FINAL EXAM Part 2 Instructions: Modulo or Remainder Operator returns the remainder…
A: Here have defined the function named modulo(). Next, inside the method, I have taken input from the…
Q: Write a function build_csv_string(data) that takes in a list data. data will be a list of lists,…
A: Code
Q: ow many times will Python execute the code inside the following while loop? i=1 while…
A: Introduction: In this question, we are given a python piece of code and we are asked to answer like…
Q: Write a Python function named check_email(email_address) takes as input a string (possibly)…
A: Here is the python code of the above problem. See below steps.
Q: host addresses possible in the network and possible range of host a
A: The answer is
Q: What type of recursion is present in the method below? public static void mystery (int x, int y) {…
A: When making decisions, if-else statements are used to describe which block of code should be run…
Q: What will the output of the follow code be: for item in ['banana', "", 37, 0, 0.5, None, False]: if…
A: We have given a python code. The above code involves list and if-else. We have to find the output of…
Q: 4.20 LAB: Vampire Party Introduction This lab is related to one of your choices for the final…
A: Here is the python program of the above problem. See below steps.
Q: Consider the algorithm for insertion sort shown below. The input to this algorithm is an array A.…
A:
Q: 417118.2791720.qx3zqy7 Jump to level 1 Declare a Boolean variable named allValid. Read in an input…
A: The above question is solved in step 2 :-
Q: Which of the following statements about ISAs are correct? check all that apply a) The ISA should…
A: The correct answers are: b) Both Intel and AMD make processors implementing the AMD64 (aka Intel64)…
Q: Define MAC.
A:
Q: C++ code needed 5.1 Task 1: Non-preemptive scheduling Write a scheduling program that implements one…
A: FIRST COME,FIRST SERVED:- —used to imply that those who come first receive services or attention…
Q: Jump to level 1 Write a while loop that reads integers from input and calculates integer finalNum as…
A: Dear Student, The complete source code is given below -
Q: What type of possible error messages you can get when you try to login with the ssh -i option?
A: The possible error messages you can get when you try to login with the ssh -i option are:
Q: using java. Create a simple Pac-Man game
A: Answer: The goal of the game is to collect all the points in the maze and avoid the ghosts. Pacman…
Q: Which of these forms of inheritance does Java support? Select one or more: a. Multiple inheritance…
A: The solution to both questions are given below with proper explanation Happy to help you ?
Q: Q.5 Explain ISAKMP protocol for IP sec.
A: A framework for dynamically creating security associations and cryptographic keys in an Internet…
Q: Fill in the LL(1) parse table for this grammar. noun verb modifier T S V O $
A: Solution- First- First of T -: {First(T) is First(S) and as given First (S) is 'noun' and First(M)…
Q: Create a java program to compute the area and perimeter of a rectangle given the length and width…
A: Introduction: In this question, we are asked to use JOptionPane for the user input and displaying…
Q: x₁ [ 0.6 0.3 0.2 0.9 ܐ ܐ ܐ ܙܐ
A: Solution - In the given question, we have to find the max-min composition and max-product…
Q: can get when you try to login with the ssh -i option?
A: The answer is
Q: Which of the following is true? Group of answer choices Reduce-Reduce conflicts never occur in…
A: It is false that reduce conflicts never occurs in shift reduce parsers. As in shift reduce parsers…
Q: 1. (4 points) Suppose we have a hash table of size 29 and we want to implement a system for looking…
A: 1. (4 points) Suppose we have a hash table of size 29 and we want to implement a system for…
Q: Write relational algebra expressions for database provided
A: Relational algebra expression: It is a procedural query language. It takes instances of relations as…
Q: Prompt the user to enter any full name (first middle surname). Do not bother with surnames like…
A: String Traditionally, a string is a list of characters that can be used as a literal constant or as…
Q: Q.17 Write the properties of hash functions.
A:
Q: Write down the mutator methods for the instance variables. You don't need to check for the passed…
A: Java: Java is a general purpose, high level, class based object oriented programming language. It…
Q: Consider the relational schemas given below and the respective sets of functional dependencies valid…
A: Summary A functional dependency is a relationship that exists between two attributes. It usually…
Q: function+array add function for the code below to find the sum of secondary elements the sum of…
A: Program approach: Including the header files. Simple recursive function or solution to fill every…
Q: Question 3 Now that we have formatted our data, we can fit a model using sklearn's Ridge()…
A: Python function to fit a model using sklearn's Ridge() class and return the trained model is, from…
Q: With OSPF, a router broadcasts its link state information to all other routers in the autonomous…
A: With OSPF, a router broadcasts its link state information to all other routers in the autonomous…
Q: Basses – Using the class called Bass in the file bass.py and the driver in bass_driver.py, develop a…
A: Attribute A trait or feature that someone, something, or both possesses: An effective manager must…
Q: Write a short note on: fuzzy expert system.
A: Fuzzy logic To put it another way, a fuzzy logic statistic can be 0, 1, or any integer between 0.17…
Q: Below is an implementation of the recursive isPalindrome() method. Fill in the missing blanks…
A: answer 1 : return true; answer 2: if(s.charAt[0]==s.charAt(s.length()-1)
Q: What is privileged communication/confidentiality? Identify a scenario where a mental health…
A: The above question is solved in step 2 :-
Q: Assume the complete binary tree numbering scheme used by Heapsort and apply the Heapsort algorithm…
A: Heap Sort : A comparison-based sorting method based on the Binary Heap data structure is called heap…
Q: driver: Driver -engine: Engine - transmission: TransmissionSystem + Car(category: String,…
A: Answer: We need to write the what is the relationship will exist in the Car and Engine so we will…
Q: determine dominant term and big O for the functions
A: Introduction: In this question, Some expressions are given and we have to find the dominant term and…
Q: Question 19 Indicate the value for the right-hand column. Be sure to list a constant of appropriate…
A: Given Data: "1"+2+3+"4"+5*6 +"7"+(8+9)= ? consider "1" as 1 , "4" as 4 , and "7" as 7 find the…
Q: You are required to complete the LinkedList class. This class is used as a linked list that has many…
A: ANSWER:-
Q: he following graph have an Euler path? Why or why not?
A: Introduction: Below describe the following graph have an euler path or not We can create a walk…
Q: C Program Functions with 2D Arrays Write a function named displayElements that takes a…
A: Answer: Algorithms: Step1: we have declared in i,j, m and for the handle the loop and row and column…
Q: Explain operations on classical relations.
A: Classical relation It tends to the presence or nonattendance of connection, participation, or…
Q: For the given IP address 128.168.0.1/20, calculate the Subnet mask, Network address, total number of…
A: The given IP address is 128.168.0.1/20. We have to calculate the Subnet mask, Network address, total…
Q: 5. Create a toString() method that will return: Jane Doe, credits: 12 if Jane Doe is taking 12…
A: What does function toString() -A built-in Java method called function toString() that returns the…
Q: Find the properties of next relation? [101 100 001] a. Non reflexive and antisymmetric O b. Non…
A: Properties of relation are reflexive, Irreflexive, symmetric, antisymmetric, and transitive.
Q: Is the following table in First Normal Form? If so, how would you get it into first normal form.…
A: Solution- Introduction-It will be challenging to manage and update the database if a table includes…
Q: aster Method and write y ork including the correspe ve a recurrence using the by showing that all 3…
A: Solution - According to Bartleby policy, I can only solve first three sub-parts. Please post next…
Q: Modify the piglatin program. Pig Latin is a made-up “language” formed from English by…
A: According to the information given:- We have to follow the instruction in order to get desired…
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Step by step
Solved in 2 steps
- See the class diagram (UML2.0) and the relationship between classes Person and Professor. What sentence describes this relationship correctly? Select one: a. The relationship links two classes. The relationship represents a generalization and specialization princip. One class is representing a general description and the second one is more detailed. b. The relationship links two classes. The relationship is weak and instances of classes are not affected by destroying instance on the other side of relationship. c. The relationship links two classes. The relationship is weak and when the container class instance is destroyed the contents class instatnce is not destroyed. d. The relationship links two classes. The relationship is very strong and when the container class instance is destroyed the contents class instatnce is destroyed too.Create a project Vehicles in bluej. The project has Cars, Buses ,Trucks and Bikesclasses ,all these classes inherit from an interface Vehicle. Pedal_bikesand Motor_bikesare subclasses of abstract class Bikes. A.Show the relationship(class diagrams)between above mentioned classesand interfacesand write the necessary class definitions. B.Interface should have 3 methods: drive(), start() and stop(). C.abstract class Bikesshould have 2abstract methods: speed( ) and getModel( ). D.Which one of the following assignments are legal, why or why not? Justify. Pedal_bikes bik= new Motor_bikes( ); Vehiclev1 = new Buses (); Bikesbi= new Bikes( ) please use BlueJ program.True or False? An association represents a non-structural relationship that connects two classes.
- 1) Change the visibility of the variables and constructor in the Employee class to be more secure 2) Add an Admin class with the following features: a) The Admin class is a child of the Employee class b) Admin objects have an instance string password variable c) The Admin class has a 4 parameter constructor. One parameter sets the string, the other three parameters are used as arguments for a parent constructor call. d) Admin objects have an instance getInformation() method with a void return and an Employee object parameter. The method will request the calling Admin’s password and check user input. If input matches the password, the method will display the information of the Employee parameter Please use ***C Sharp** Language to answer the codeJust the class diagramWrite an inheritance hierarchy for the classes quadrilateral, trapezoid, parallelogram, rectangle, and square. Use quadrilateral as the superclass of the hierarchy. Add as many levels as possible to the hierarchy. Specify instance variables and methods for each class. The private instance variables of quadrilateral must be the x,y coordinate pairs for the four endpoints of the quadrilateral. Write a program that creates object instances of your classes that prints the area of each object.Create an abstract super class called Employee with the following attributes: name : String and the following methods getter and setter for the one attribute three constructors an abstract method called getSalary() equals() toString() Create a sub class of Employee called Faculty with the following attribute yearlyPay : double department: String and the following methods getter and setter for the attributes three constructors getSalary() that returns the yearlyPay divided by 52 equals() toString() Create a sub class of Employee called Staff with the following attributes: hoursWorked : double payrate : double and the following methods getters and setters for the two attributes three constructors getSalary() 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 Sales with the following attributes: salesAmount : double //sales per week Type:…
- Model a room class, whose member data is three integers length, width and height. The classcontains two constructors to initialize the room class objects, first is no argumentconstructor, while the second in three arguments constructor. Class also contains threemember functions i.e., getdatat) to get the data from user and store in the memory of callingobject and showdata) to show the room data of calling object, int volume(int I, int w, int h)function should receive the length, width and height values from the objects one by one andreturn the volumes of the three objects respectively.Write a main program to declare the three object rl, 12, and 13 of room class. Two objectwill store the values through three argument constructor and third object will get the datafrom user by calling getdata function. Then all three objects should call the volumefunctions to calculate their volumes and store them in three variables of type integer. Finallythe system compare the three volumes values…Distinguish the difference between declaring one class as a friend of another class (object aggregation) and declaring one class as a member of another class (membership aggregation) (object aggregation).A User class has an association link to a Service class, and calls its compute() method to do mathematical calculations. Because the computation takes time, it is better to first prompt a waiting message, which was not yet provided, to inform the user. However, the Service class is also used by other internal classes that do not need the message. Therefore, your job is to come out a way to provide the message without modifying the association relationship and the code of the Service class. What design pattern is a useful choice? Also,Show the new design in UML class diagram. Extra interfaces or classes can be added.
- The Robot class models the state and behavior of virtual robots. Each robot corresponds to an object that is an instance of this class. Each robot: properties: Has a modelNumber (int) Has a direction(String): given by the direction attribute that takes one of the values "North", "East", "South" or "West" Has a makeYear (int): the year the robot was made. Methods: Can turn left 90 ° to change direction (if its direction was "North" it becomes "West", if it was "West" it becomes "South", if it was "South" it becomes "North", etc.). with the method without parameter turnLeft () Can display its detail with the method myInfo().Write a class LocalPhone that contains an attribute phone to store a local telephonenumber. The class contains member functions to input and display phone number.Write a child class NatPhone for national phone numbers that inherits LocPhoneclass. It additionally contains an attribute to store city code. It also containsmember functions to input and show the city code. Write another class IntPhonefor international phone numbers that inherit NatPhone class. It additionallycontains an attribute to store country code. It also contains member functions toinput and show the country code. Test these classes from main() by creatingobjects of derived classes and testing functions in a way that clear concept ofmulti-level Inheritance.1. Write a java code for the above class diagram for “Car”.2. MAX_Weight must be a public class constant which is set to 6.4 3. The data member “counter” must be a class member and initialized to zero4. Use “counter” to assign a unique id for each class instance ( counter++ ) by the constructor5. The constructor is used to initialize all the instance variables by receiving the values from the user. Don’t change the parameter’s names.6. “convertMeterIntoMile” and “convertMileIntoMeter” are class methods:a. convertMeterIntoMile: convert the reading into miles by dividing the receiving value by 1.62b. convertMileIntoMeter: convert the reading into meter by multiplying the receiving value by 1.627. The method “computeFuelEconomy” must be overloaded and return a dummy calculation8. In the main method:a. Create an array of objects to hold five objects of class Car.b. Add them to the array. Note that the code for class Person is included but you need to import it from package “people”c. By…