public class Appliance { public int getVoltage() { return 10; } Appliance.java public interface Vehicle { public int getMileage(); } Vehicle.java class ElectricCar extends Appliance implements Vehicle { public int getVoltage() { return 5; } public int getMileage() { return 100; } ElectricCar.java Appliance Vehicle ElectricCar 12. Is the following code valid or invalid? Vehicle v = new ElectricCar(); O valid O Invalid 13. What is the output of the following code? Appliance a = new ElectricCar(); System.out.println(a.getMileage()); O 5 O 10 O 100 O Compile error
Q: What exactly is a monochrome laser printer, and how is it used?
A: Given: According to the question, monochrome laser printers only print simple text and images with…
Q: Preemptive scheduling entails what exactly?
A: Preemptive Scheduling: The system is described as non-preemptive or cooperative if scheduling takes…
Q: Memory can be divided into two types: primary memory and supplementary storage. Describe the…
A: Introduction: Any physical device capable of storing information, either temporarily or permanently,…
Q: In order to investigate this DDoS attack, what security engineering techniques would you employ?…
A: According to the data provided: We need you to describe the security engineering techniques you'd…
Q: Define the many forms of information security policies.
A: Intro What are Information Security Policies Those security policies that state or describes the…
Q: What exactly are tree traversals, and how do they function?
A: Introduction: Tree traversal (also known as tree search and walking the tree) is a type of graph…
Q: Discuss the importance of backups and the actions required to avoid data loss or computer failure.
A: To discuss the purpose of backups and the steps to prevent data loss.
Q: A brief description of the regression and Artificial Neural Network (ANN) model creation methods.
A: Introduction: ANN is a computational model made up of many processing components that receive and…
Q: What is a DDoS attack? Who are the players? What is the intended outcome of a DDoS attack?
A: DDoS attack: Attackers must first establish a connection to the internet to begin a DDoS assault.…
Q: Create a one-of-a-kind shopping website using html and CSS.
A: Introduction: HTML is an abbreviation for Hyper Text Markup Language.
Q: A) Add these features to the Circle.java class from the lecture examples: • Make the 'color'…
A: The access specifier "private" allows modifying the values of the attributes by the methods…
Q: Explain how data security laws in the US and the EU are different. Is it important for your answer…
A: Security standards : Explain how the United States and the European Union have different data…
Q: What's all the fuss about IPC approaches that leverage shared memory?
A: Introduction: For IPC with shared memory, two functions are used: shmget() and shmat(). The shmat()…
Q: What exactly is the meaning of data analytics? How does it vary from data mining in terms of…
A: Introduction: Although data mining and data analysis are two separate phrases and procedures, some…
Q: Assume there is a villiage with 3 houses whose owner's strongly dislike eachother. So they wish to…
A: Ans:) I have given two diagrams with justification below. please check according to requirments. The…
Q: Why was a form application used instead of a console programme?
A: Introduction: To understand this, first consider the distinction between a console app and a Windows…
Q: One may wonder how a distributed denial-of-service assault could be coordinated by a single person.
A: DENIAL OF SERVICE ASSAULT DISTRIBUTED: DDoS attacks are a deliberate attempts to interrupt the…
Q: Provide 5 examples of distributed ledger technologies
A: Given: We have to discuss 5 examples of distributed ledger technologies.
Q: What may happen if an operating system does not have a method for synchronizing processes? Present a…
A:
Q: When it comes to the CPU, what are the necessary BIOS/UEFI settings, and how is the processor…
A: Intro UEFI defines a new means of communication between operating systems and platform firmware,…
Q: Meetings through the internet MS Video Calls on the Internet Teams from virtual classrooms recorded…
A: Introduction Workplace conversations, collaboration, teamwork, video chats, and document sharing are…
Q: As a software engineer, you'll be expected to recommend the best method for gathering customer…
A: Requirement Engineering is the process of defining, documenting and maintaining the requirements. It…
Q: In the next ten years, what key computer hardware breakthroughs do you expect to see, and why do you…
A: Definition: Computer hardware is a collection of physical computer components. Among them are the…
Q: Create a video showing how your game runs, play the game and explain how it plays. (don't worry…
A: ALGORITHM:- 1. Take an input number from the user in the range 1 to 100. 2. Generate a random number…
Q: Explain briefly how you propose to examine this DDoS assault using security engineering techniques.
A: All packets are checked in-line, and out-of-band detection is performed by analyzing traffic flow…
Q: 8 2 9 7 6 5 1 3 4 Show the contents of the array above each time an Insertion Sort changes it while…
A: Insertion sort: Insertion sort is a sorting algorithm that places an unsorted element…
Q: You need to implement Prim's algorithm for mst creation. Your function is going to take a vector>…
A: Prims algorithm:It is a greedy algorithm.Minimum spanning tree we can form from it .
Q: What is the difference between normalisation and denormalization in computer science?
A: Computer Science: The study of computers and computing, as well as its theoretical and practical…
Q: What is an operating system's (OS) primary purpose? The operating system, apps, and other software…
A: What an operating system indeed does. Therefore, it is an intermediate platform between computer…
Q: Explain briefly the apps that DHL uses for continuous improvement. Please specify which of the SLC…
A: The term system life-cycle (SLC) is used to indicate that: The methodology manages all parts of the…
Q: What are the four primary kinds of NoSQL database management systems?
A: Introduction: NoSQL database management solutions are classified into three kinds.
Q: public abstract class Media {...} Media.java public class Audio extends Media {.….} Audio.java…
A: Question 1: In the above question the function play is overloaded as with the same method name there…
Q: The Data Communication System is critical in today's environment. Explain how it works and what the…
A: Introduction: Data communication is essential for sending and receiving information between two…
Q: What is the difference between the Kernel and the Shell in the context of Unix?
A: The question is to write the difference between the Kernel and the Shell in the context of Unix.
Q: We must first comprehend what RAID 5 is before we can understand it. RAID 5 should be used in what…
A: Definition: A solution is a homogeneous combination of one or more solutes dissolved in a…
Q: 51- Write a function which accepts two array of integers (like arr1 anc of the same size (100), then…
A: here in this question we have asked to write a c++ program which take two array and add its element…
Q: You've been hired to create a hospital patient control program, and you've been given all of the…
A: Software : Software Requirements Specification (SRS) A programme system requirements specification…
Q: RAID 5: what is it and how does it work? What are the circumstances in which RAID 5 is better than…
A: RAID 5: RAID 5 is a self-contained display of plates with equal circle striping. Because information…
Q: In Machine Learning, discuss the "Problem of Dimensionality." Please suggest two approaches to…
A: Introduction: Some machine learning algorithms perform very poorly on higher dimensional and higher…
Q: How much time elapses with Non-persistent HTTP and no concurrent TCP connections when you use your…
A: When you use your phone, if DNS looking up happens once every 10 minutes, and each time the HTTP…
Q: What is the most significant difference between mainframe and laptop operating systems? What are…
A: The main difference between the mainframe operating system and laptop or PC's operating system is…
Q: A positive whole number n > 2 is prime if no number between 2 and n (inclusive) evenly divides n.…
A: import mathn=int(input("Enter n value: "))count=0for i in range(2,int(math.sqrt(n))): if n%i==0:…
Q: Explain what functional programming is in a concise manner. How would you describe the distinction…
A: programming: The process of producing a set of instructions that inform a computer how to complete a…
Q: s the functions of U
A: Introduction: Below the functions of UTM.
Q: How would you describe the aim of a system security policy as an information systems security…
A: Intro A brief, high-level statement defining what is and is not permitted during the operation of…
Q: The statement passes a value back to a function's caller.
A: Function has 3 types in all 1. Declaration 2. Definition 3. Calling of function
Q: 5. Summary the main steps for Canny boundary detector.
A: Canny boundary detector is said as Canny edge detector. Canny boundary detector is used to analyze…
Q: How can the integrity of the data be ensured?
A: The physical data model is a representation of the data that will be used to create the database:…
Q: Write a command to modify the permissions of all the files and directories in the XYZ directory…
A: Here i write about symbol to be used in the linux command:…
Q: Please make a list of the types of games can I create using java
A: INTRODUCTION: Here we need to tell a list of the types of games can we create using java.
For item 12-15, consider the following:
Step by step
Solved in 7 steps with 13 images
- 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…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 vehicleComputer Science hand.javapackage poker; import com.google.gson.Gson;import com.google.gson.GsonBuilder;import poker.Card; public class Hand{//private transient int i=10;// marked transient they will not serialized / deserialized public Card[] cards; public Hand(){} public boolean is_better_than(Hand H){return false;} public boolean is_equal(Hand H){return false;}} card.javapackage poker; public class Card{public enum Suite{HEARTS,CLUBS,DIAMONDS,SPADES} public enum Value{ACE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE,TEN,JACK,QUEEN,KING} public Suite suite;public Value value; public Card(){ }} // main.java import com.google.gson.Gson;import com.google.gson.GsonBuilder;import poker.Hand;import poker.Card; public class Main{ public static void main(String[] args){// this function is provided as a convenient way to// run the code from the command line.//// it will not be graded, but it needs to compile and// execute without a failure. System.out.println("Start"); // Demonstrate…
- Java class Main { publicstaticvoid main(String[] args) { // Coin myPenny = new Coin(CoinType.PENNY); // Coin myNickel = new Coin(CoinType.NICKEL); // Coin myDime = new Coin(CoinType.DIME); // Coin myQuarter = new Coin(CoinType.QUARTER); // Coin myHalfDollar = new Coin(CoinType.HALF_DOLLAR); // Coin myDollar = new Coin(CoinType.DOLLAR); // System.out.println(printValue(myPenny)); // System.out.println(printValue(myNickel)); // System.out.println(printValue(myDime)); // System.out.println(printValue(myQuarter)); // System.out.println(printValue(myHalfDollar)); // System.out.println(printValue(myDollar)); } publicstatic String printValue(Coin c){ String result = ""; // result = String.format("The value of a %s is $%.2f", c.getName(), c.getValue()); return result; } }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,…Computer Graphics Mickey Mouse In this labwork are asked to write a GUI application using AWT. It is highly advised that you build your work and knowledge upon the last labwork. You can watch the small video demo on WebOnline to get a better understanding. In additional to what we did in Lab3 you are going to; • Add a control panel. • Add two buttons to the panel called "Smaller" and "Bigger". • Menubar of this program should have an item called "Set Default"which will reset the values of x, y, dx and dy to the values they had initially. • Modify the action listener according to the buttons and menu item. • Set the title to "Mickey" in the constructor and add your WindowListener. • Modify your paint method to draw 3 ovals which makes up Mickey Mouse silhouette. Smaller ovals have half the radius of the big oval. • The center of the circle is determined by the variables x and y, and the radius of circles should be dependent on dx and dy (which are equal since we are using circles). •…
- public class BankAccount implements Deposit, Withdraw {...} public interface Deposit {public void deposit (double amount); } public interface Withdraw {public void withdraw (double amount); } and the following code: Person pl Person p2 Person p3 new Person ("Louis"); new Person ("Louis"); = new Person ("Sue"); BankAccount bl new BankAccount (p1); BankAccount b2 = new BankAccount (p2); ArrayList accounts = new ArrayList () ; accounts.add (bl); accounts.add (b2) ; accounts.add (new BankAccount (p3)); //LINE *** Which ONE of the following statements would be illegal if placed after the //LINE*** Comment. accounts.get(2).deposit(100); b2.withdraw(100); accounts.get(0).deposit(100); accounts.get(2).withdraw(100); b1.deposit(100);public class Father { public String name; public int age; // customer name Father(){ name=”Hassan”; age=50;} public void display(){ System.out.println(“Name:”+name); System.out.println(“Age:”+age); } } 1. Based on Figure 3, create a class named Child that inherits the Father class. Declare an instance name location (String) for class Child. 2. Define a constructor in class Child and give an appropriate initial values for the instance (name, age, location). 3. Define a method display () in class Child, execute the display ( ) method in superclass using the keyword super. Method display ( ) in class Child should print the information of name, age and location 4. Create other class named Main for the main method and create 2 objects for the 2 classes (Father and Child). Then execute the display ( ) method for Father and Child. Example of the output as in Figure 4: Father's info: Name: Josh Age: 50 Child's info: Name: Christy Age: 20 Location:…8. 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 Selection
- 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.import java.util.Scanner; class BloodData//declraing BloodData class { //declaring required variables static String bloodType;//to store the blood type static String rhFactor;//to store Rhesus factor //default public constructor public BloodData() { //initializing bloodType to o and rhFactor to + bloodType="o"; rhFactor="+"; } //parameterized public constructor public BloodData(String bt,String rh) { //initializing bloodType with bt and rhFactor with rh bloodType=bt; rhFactor=rh; } //function to print bloodType and rhFactor public void display() { //printing the bloodType and rhFactor System.out.println(bloodType+rhFactor+" is added to the bloodbank.\n"); } }//end of class BloodData public class RunBloodData//declaring public class RunBloodData { public static void main(String[] args) { //creating object of Scanner class to take input Scanner sc=new…Dog.java publicclassDogextendsPet { privateStringbreed; publicvoidsetBreed(StringuserBreed) { breed = userBreed; } publicStringgetBreed() { return breed; } } Pet.java public class Pet { protectedStringname; protectedintage; publicvoidsetName(StringuserName) { name = userName; } publicStringgetName() { return name; } publicvoidsetAge(intuserAge) { age = userAge; } publicintgetAge() { return age; } publicvoidprintInfo() { System.out.println("Pet Information: "); System.out.println(" Name: " + name); System.out.println(" Age: " + age); } } PetInformation.java import java.util.Scanner; public class PetInformation { publicstaticvoidmain(String[] args) { Scannerscnr = newScanner(System.in); PetmyPet = newPet(); DogmyDog = newDog(); StringpetName, dogName, dogBreed; intpetAge, dogAge; petName = scnr.nextLine(); petAge = scnr.nextInt(); scnr.nextLine(); dogName = scnr.next(); dogAge = scnr.nextInt(); scnr.nextLine(); dogBreed = scnr.nextLine(); // TODO: Create…