public void locomotion() ( rface public interface Animal { Class Shark public class Shark implements Animal { public void locomotion(); public void eat(); } } System.out.println("I swim."); } public void eat() ( System.out.println("I hunt for seals."); Class Dog public class Dog implements Animal ( public void locomotion() { } System.out.println("I run on four legs."); } public void eat() System.out.println("I eat kibble."); } public class AnimalTest ( public static void main(String[] arg) ( Shark shark = new Shark(); shark.locomotion(); shark.eat(); Dog dog = new dog(); dog.locomotion(); dog.eat();
Q: In Java please.Enter the code where it says " /* Your code goes here */ ". Suppose we add a fixed…
A: The algorithm:- 1. Accept the annual contribution from the user. 2. Initialize the balance to the…
Q: Draw use case daigram for returning damged Products with (iherb) onlin Programe.
A: The question has been answered in step2
Q: Imagine you are designing an inverted list structure that will provide everything needed to…
A: answer Dirichlet Smoothing: Pμ(w∣ˆθ)=c(w,D)+μP(w∣C)|D|+μ=|D||D|+μ⋅c(w,D)|D|+μμ+|D|⋅P(w∣C)
Q: 5. Let F denote the kth number in the Fibonacci sequence. (a) Prove that F+1 − F² = Fk-1Fk-2 (b)…
A:
Q: For what purpose is access control software used?
A: Introduction: The intention is to provide users access to just the information that has been…
Q: Question 5 Explain why and why and why not you need to rewrite the code following the OOP…
A: The question has been answered in step2
Q: QUESTION 12 True or false: Bayesian networks are a relational representation of knowledge about the…
A: (13) True option is correct Resion: Conditional Independence in Bayesian network (otherwise known…
Q: 1) Write the SQL code that will create the table structure for a table named EMP. This table is a…
A: For auto generated id's we have to start from 101 and increment by 1 For checking JOB_CODE we can…
Q: What is the difference between statistical anomaly detection and rule-based intrusion detection?
A: Introduction: In general, these two technologies, known as Anomaly Detection and Intrusion…
Q: It's important to find a reliable strategy for choosing cybersecurity products.
A: The above question is solved in step 2 :-
Q: What is the impact of globalization on fake news?
A: Introduction What is globalization?: The globalization process is just how ideas, data, knowledge,…
Q: Today patients and healthcare professionals are more and more demanding the convenience of digital…
A: a) 1) BrightSquid secure communication technology Application of technology when it comes to…
Q: What are Canonical Expressions in Canonical SOP or POS Form.
A:
Q: In the field of computer science, one often resorts to using a programming language in order to…
A: Definition: It is possible to do a wide number of jobs using programming languages such as Basic,…
Q: Is SQL coding?
A: SQL stands for Structure Query Language. SQL allows communication with databases in order to manage…
Q: Managers need to know what they're shooting for if they want to build stronger relationships with…
A: CRM: Customer Relationship Management is referred to as CRM. It is used to sustain connections…
Q: A factory that manufactures bolts is performing a quality control experiment. Each object should…
A: The hypothesis is zero. There is a difference between the two: Ming is greater than 13 brackets. .
Q: How can a programmer profit from learning additional languages, even if they are already fluent in a…
A: "The person who selects what language it is written in when you join an open-source project or start…
Q: 1. Do three iterations (by hand) of the bisection method, applied to f(x) = x³ - 2, using a = 0 and…
A: Bisection method f(x) = 3-2x a=0 b=2 iteration a b f(a) f(b) c =(a+b)/2 f(c) update 1 0 2 1 -1…
Q: During the process of learning a new programming language, what are two of the subjects/activities…
A: INTRODUCTION: Syntax Basics Structures and the Kinds of Data Flow-management structures…
Q: How do you go about selecting the ready-made software that will be used? Which sorts of criteria…
A: INTRODUCTION: Software that comes pre-built or "out of the box" may be purchased, installed, and…
Q: which responsibility still applies to all organizations using a cloud service provider, no matter…
A: correct option is d) governance of data Everything you do to make sure data is reliable, accurate,…
Q: What is -510 in 8-bit 2's complement form? O 00001011 O 00000101 O 11111011 O 11111010
A: Introduction Number system: The term "number system" refers to a technique of presenting and then…
Q: what what ways are “creative ideas” more important than technical ability? what ways have you used…
A: In some respects, creative ideas are more significant than technical skills since they enable to…
Q: Assess how well your interpersonal skills were put to work as you planned and executed your…
A: Introduction: In daily life, it's our communication abilities, speaking, listening, walking,…
Q: The concept of privacy is abstract and difficult to understand when applied to the realm of…
A: Introduction: When discussing information security, the concept of "privacy" relates to safeguarding…
Q: How do you go about selecting the ready-made software that will be used? Which sorts of criteria…
A: Software off-The-Shelf Software purchasing involves various elements and particular concerns. Before…
Q: What is join in SQL?
A: In SQL, JOINS is the command which is used to combine rows from two or more tables, based on a…
Q: Do you enjoy programming? Isn't it just too funny? Is this a difficult assignment to complete? Do…
A: The response: One of the most difficult components of programming when you first start is creating…
Q: How can employees of an organization keep knowledge from slipping through the cracks? Assume your…
A: Introduction: To begin, the provided case study details both the positive and negative aspects of…
Q: Give us a working definition of "application security."
A: Application security develops, integrates, and tests app-based security components to prevent…
Q: Convert the ER diagram in the above question into relational model.
A: Relational Schema: A relational schema is an outline that explains how businesses store and organize…
Q: Perform the following arithmetic operations in the 2’s complement system. Use 8-bit numbers…
A: Steps to add decimal using 2's complement:- First convert to base 2. Find the one's complement.…
Q: A customer can place an order online. For each item, the order can be sent to the customer either by…
A: UML diagrams called sequence diagrams show the flow of messages sent and received by objects during…
Q: Compulsory Task 2 Follow these steps: • Using one of the patterns described, write the code needed…
A: Solution: Required language is Java
Q: n to recognize data access security concepts. (S
A: Description: 1- There are three main types of data access security concepts.
Q: For each business, discuss the business entity that represents the best choice for each business,…
A: The question has been answered in step2
Q: Calculate a solution of the following linear program. Validate your answer by writing a Python…
A: import numpy as np import matplotlib.pyplot as plt m = np.linspace(0,5,200) x,y = np.meshgrid(m,m)…
Q: How to find the minimum distance between two locations using Dijkstra's Algorithm write it in Pseudo…
A: The question has been answered in step2
Q: Outline the steps required to earn credentials and details of any relevant experiences you may have…
A: Educational information systems: An information system is a group of linked parts or components…
Q: 1. Prove that the product of two odd integers is odd.
A: The answer is given below.
Q: What is it about you that makes you so well-known within the technical community for your ability to…
A: Required: Why are you regarded as explain when you have the ability to motivate technically minded…
Q: Write a function named allUnique in JavaScript that takes an array as input and returns true if each…
A: Please find the answer below :
Q: The context free grammar S → A000 | S0, A → A1 | 11 is equivalent to _________ a) {0n1m| n=2, m=3}…
A: Right choice is (d) None of the Mentioned
Q: In this lab, you use what you have learned about searching an array to find an exact match to…
A: #include <iostream> using namespace std; int main() { string arr[10]; int flag=0;…
Q: Implementing information systems thoughtfully is essential if society, businesses, and industries…
A: Introduction: IT has grown rapidly in the recent half-century. From the days when computers were…
Q: Internet users must be aware of the risks they face. Explaining the project's intended outcomes
A: Project management: Refers to the application of knowledge, skills, tools, and techniques to lead…
Q: using an ipo table design an algorithm that reads a set of integers and then find and print the sum…
A: IPO Chart The IPO (Input, Processing & Output) chart can be used to analyse a problem. This is a…
Q: Provide some background on the InfoSec program as it relates to the study of computers.
A: Introduction: A practise that each business should adopt, an information security programme is…
Q: List the major security services provided by AH a espectively.
A: Dear Student, The detailed answer to your question "List the major security services provided by AH…
Implement the use of Interfaces for the following diagram
Step by step
Solved in 4 steps with 1 images
- What is the output of the following code? Convert the abstract class into an interface and modify the codes in all classes that will maintain the same output. (Rewrite the code)public interface Joy ( public void happySign(); } public class Man implements Joy { public Man () { } public void happySign () { System.out.println("smiles"); } public void sadSign () { } red phot System.out.println("frowns"); a) Joy obj1 = new Man(); obj1.sadSign(); public class Dog implements Joy { public Dog () () public void happySign () { } System.out.println("wags tail"); public class GuardDog extends Dog { public GuardDog () { } public void happySign () { System.out.println("barks"); } We public void angrySign () { } System.out.println("growls"); If the following lines of code appeared in the main method of a driver program, would the program compile and run? (yes or no?) If no, write 1-2 sentences to explain why not. If yes, indicate what the output would be. nafn,What is outpout? public class Vehicle { public void drive(){ System.out.println("Driving vehicle"); } public class Plane extends Vehicle { @Override public void drive(){ System.out.println("Flying plane"); } public static void main(String args[]) { Vehicle myVehicle myVehicle.drive(); } } = new Plane(); syntax error Driving vehicle Flying plane Flying plane O Driving vehicle
- Code: interface Bicycle{ //interface for bicycle void changeGear(int val); //abstract methods void changeSpeed(int inc); void applyBrakes(int dec); void ringBell(int count); } class NewCycle implements Bicycle{ //class for a new cycle int speed=0; //stores the speed value int gear=0; //stores the gear value @Override public void changeGear(int val) { //method to change the gear gear=val; } @Override public void changeSpeed(int inc) { //method to change the speed speed=speed+inc; } @Override public void applyBrakes(int dec) { //method to apply brakes speed=speed-dec; } @Override public void ringBell(int count) { //method to ring the bell for(int i=0;i<count;i++){ System.out.print("Clang!!"+" "); } System.out.println(""); } public void printState(){ //method to print the states System.out.println("Ring bell, Speed, Gear,…public abstract class Shape { public Shape() { } public abstract double area() ; public String who() { return "Shape" ; } } public class Circle extends Shape { private int radius ; public Circle( int r ) { radius = r ; } @Override public double area() { return Math.PI * radius * radius ; } } public class Square extends Shape { private int _sideLength ; public Square( int sideLength ) { /* TODO question 45 */ } @Override public double area() { return _sideLength * _sideLength ; } } Implement the Square constructor, and make sure it throws an exception when the input parameter is not a valid length. The input parameter must be positive to be considered valid.public class Base { public void PrintName() { System.out.println("Base"); } static void PrintClass() { System.out.println("ClassBase"); } private void PrintPrivate() { System.out.println("PrintPrivate"); } class Derived extends Base { public void PrintName() { System.out.println("Derived"); } static void PrintClass() { System.out.println("ClassDerived"); } private void PrintPrivate() { System.out.println("PrintDerived"); } public static void main(String[] args) { Base x = new Derived(); Derived y = new Derived(); x.PrintClass(); y.PrintPrivate(); x.PrintName();
- public class StairViewer public static void main(String(] args) // Step 2: Create a rectangle and draw it as the // top step of the stair // location: (20, 10) // size: (20, 20) 18 // Step 3: Create a rectangle and draw it as the 19 // middle step of the stair 20 // location: below the top step, aligned on left // size: (40, 20) 21 22 23 24 // Step 4: Create a rectangle and draw it as the 25 // bottom step of the stair 26 // location: below the middle step, aligned on left // size: (60, 20) 27 28 29 30 } 31 328. OOPS Theory #6 public class Car { public void horn() { System.out.println("Horn horn"); } } public class Ferrari extends Car { public void horn() { System.out.println("Ferarriiiiii"); } } public static void main(String[] args) { Ferrari ferrari = new Car(); ferrari.horn(); } Pick ONE option Horn horn Ferarriiii Cannot compile Runtime exception Clear Selection 9. OOPS Theory #7 In Java, we can achieve the abstraction by creating the blueprint of an object and only have abstract methods. What do we call this? Pick ONE option Interface Encapsulation Instance Protected Clear SelectionQuestion 13 What is outpout? public class Vehicle { public void drive(){ System.out.println("Driving vehicle"); } } public class Plane extends Vehicle { @Override public void drive(){ System.out.println("Flying plane"); } public static void main(String args[]) { Vehicle myVehicle= = new Plane(); myVehicle.drive(); } Driving vehicle syntax error Flying plane Driving vehicle Flying plane }
- public class Animal { public void makeNoise() { System.out.println("talk"); }//end method makeNoise }//end class Animal public class Dog extends Animal { public void makeNoise() { System.out.println("Bark"); }/lend method makeNoise }//end class Dog What would the output of the following be? Explain your answer. Animal animal = new Animal(); animal.makeNoise(); Dog dog = new Dog(); dog.makeNoise(); Animal animaldog = new Dog(); animaldog.makeNoise();Design Patterns: Strategy Pattern : in Object Oriented design Programming Use Netbeans to execute the following Java code and show SCREENSHOTS to verify that the program runs correctly. Draw a UMl class diagram to model the program. Here is the java code: File : Billing.java public interface Billing { public double getDiscount();} File : LoyaltyBilling.java public class LoyaltyBilling implements Billing{ @Override public double getDiscount() { return 20.00; } } File : NormalBilling.java public class NormalBilling implements Billing{ @Override public double getDiscount() { return 0; } } File : SeasonalBilling.java public class SeasonalBilling implements Billing{ @Override public double getDiscount() { return 10; } } File :SaleBilling.java public class SaleBilling implements Billing{ @Override public double getDiscount() { return 50; } } File : Product.java public class Product { private String name; private…public class Pet { protected String name; protected int age; public void setName(String userName) { name = userName; } public String getName() { return name; } public void setAge(int userAge) { age = userAge; } public int getAge() { return age; } public void printInfo() { System.out.println("Pet Information: "); System.out.println(" Name: " + name); System.out.println(" Age: " + age); } } import java.util.Scanner;public class PetInformation { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); Pet myPet = new Pet(); Cat myCat = new Cat(); String petName, catName, catBreed; int petAge, catAge; petName = scnr.nextLine(); petAge = scnr.nextInt(); scnr.nextLine(); catName = scnr.nextLine(); catAge = scnr.nextInt(); scnr.nextLine(); catBreed = scnr.nextLine(); // TODO: Create generic pet (using petName, petAge) and then…