Please help answer this Java multiple choice question.
Assume you are a developer working on a class as part of a software package for running artificial neural networks. The network is made of Nodes (objects that implement a Node interface) and Connections (objects that implement a Connection interface). To create a new connection you call the constructor for a concrete class that implements the Connection interface, passing it three parameters: Node origin, Node target, and double weight. The weight is a double that is greater than or equal to 0, and represents how strongly the target node should weigh the input from the origin node. So with a weight of 0.1 the target node will only slightly weight the input from the origin, but with a weight of 725.67 the target node will strongly weight the input. The method throws an IllegalArgumentException. Which of the following are true?
Connection c = new ConvLayerConnection(origin, target, 100000.0);
will throw an IllegalArgumentException because the input is too large.
Connection c = new ConvLayerConnection(origin,target, 0);
will create a new connection with 0 weight, meaning the target will ignore the input from this layer.
Connection c = new ConvLayerConnect(origin, target, -0.1);
will throw an IllegalArgumentException.
Connection c = new ConvLayerConnection(origin, target, -5);
Will create a new connection with a negative weight, meaning the target node will do the opposite of the input from the origin node.
Step by stepSolved in 3 steps
- You have to implement program that compares graduate students based on their ranks. The design of the program is given in the following UML diagram: • Student class: Base class that GradStudent extends. • GradStudent class: The objects from this class will be used for comparisons. • Rankable interface: Defines the implementation needed for comparison. GradStudent implements this interface. • Test class will be used to get student information from the user and demonstrate the comparison of students.arrow_forwardMake sure you know the difference between an abstract class and an interface and constructors.arrow_forwardWrite a java This class must implement the model in the following UML class diagram. Account -balance: double +Account(init_balance : double) +getBalance( ): double +deposit(amount : double) Diagram object’s description: balance holds the current balance of the bank account Account sets balance to init_balance get balance retrieves the current balance deposit adds the amount parameter to the current balance (Hint: “-“ indicates private and “+“ indicates public)arrow_forward
- Implement a nested class composition relationship between any two class types from the following list: Advisor Вook Classroom Department Friend Grade School Student Teacher Tutor Write all necessary code for both classes to demonstrate a nested composition relationship including the following: a. one encapsulated data member for each class b. inline default constructor using constructor delegation for each class c. inline one-parameter constructor for each class d. inline accessors for all data members e. inline mutators for all data membersarrow_forwardUse java programming properties to write all the necessary classes and/or interfaces for a solution to the problem. Focus on class structure and interaction. You may implement your solution however you wish, but you will be graded on the appropriateness of your solution to the requirements. Note the use of capitalization and parentheses for clarification. You may use whatever constructors or additional methods you wish. Define a structure that can represent Animals. Animals have two behaviors; they can speak() and they can move(). By default, when an animal moves, the text ”This animal moves forward” is displayed. By default, when an animal speaks, the text ”This animal speaks” is displayed. A general Animal should not be able to be instantiated. Define two classes, Goose and Lynx, that are Animals. Both Goose and Lynx behave such that where “Animals” is displayed in speak() or move(), “goose” or “lynx” is displayed by the appropriate classes. Finally, any instance of Goose can fly(),…arrow_forwardWrite the definition of classes and interfaces in the given diagram using following details: a) Interface shape has a method draw(). b) Override the method draw() in all subclasses. c) Define a non-abstract method fillColor() in Circle class. (I want the complete solution using the codes in bluej program also diagram) bluej java coodarrow_forward
- State a circumstance in which you would prefer an interface over an abstract class. Also, State a circumstance in which you would prefer an abstract class over an interface.arrow_forwardWrite program in C++ using inhertiance and polymorphism. A car dealership wants you to keep track of their sold and leased vehicles. You have realized that all vehicles have a make, model and vehicle identification number so you are going to factor those attributes out and put them in the base class as private attributes. Additionally you realize that you need to create two derived classes: one that keeps track of vehicles that are sold and the other that keeps track of ones that are leased. Vehicles that are sold have a sale date and sale amount. Vehicles that are leased have a monthly lease payment and terms of the lease (number of years). For all classes, create a proper overloaded constructor and display method that properly displays the class’s attributes. For your display method make sure you are using proper run-time polymorphism techniques so that your code calls the correct display methods. Complete main.cpp and follow comments for instruction Given code of .cpp and .h classes…arrow_forwardExplain the difference between the following implementations of class A.a. extending class A from class Bb. extending class A from parent abstract class Cc. class A implementing interface Darrow_forward
- Write the implementation of the Java classes based on the following UML diagram. (a) Define the method IncreTotSpecies) to increment the data field totalSpecles (b) Define the method printColor) to print the data field color (c) Override the method printColor) in the class Falcon to print the data fields featherColor, beakColor Birds +color: String +foodHabit: String +totalSpecies: int -skeleton: String +Birds () +Birds(color: String, foodHabit: String, skeleton: String) +increTotSpecies (): void +printColor (): void Falcon -featherColor: String -beakColor: String +Falcon (featherColor: String, beakColor: String) +printColor (): voidarrow_forward15. Create an interface MessageEncoder that has a single abstract method encode (plainText), where plainText is the message to be encoded. The method will return the encoded message.arrow_forwardAn Abstract Data Type's interface is comprised of what? Here's where you put your reply.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education