Questions
This violates Liskov Substitution Principle (LSP), can someone explain why and refactor it so it does...

This violates Liskov Substitution Principle (LSP), can someone explain why and refactor it so it does not?

  
public abstract class Bird
    {
        public abstract void LayEgg();
        public abstract void FlyAway();
    }
    public class Penguin : Bird
    {
        public override void LayEgg()
        {
            //Make husband penguin do all the incubation work.
        }
        public override void FlyAway()
        {
            //Penguins can't fly.
            throw new NotImplementedException();
        }

        public void SwimAway()
        {
            //Swimming is way more fun.
        }
    }

In: Computer Science

Using python Write a program that has 3 functions, named write_to_file, read_from_file, and ask_user. The write_to_file...

Using python

Write a program that has 3 functions, named write_to_file, read_from_file, and ask_user.

The write_to_file function should have 2 parameters, file_name and data. When called, the function will open a file with the name stored in the file_name variable, write the information stored in data, then close the file.

The read_from_file function will have 1 parameter, file_name. When called, the function will open a file with the name stored in the file_name variable, print the contents of the file, then close the file.

The ask_user function will give the user a prompt asking whether they want to read or write a file, once a selection is made the program must ask the user for the information needed to run the function (if they select write, ask for file name and data to write to the file, if the select read, ask for file name).

Below the functions, in the main part of the program, write a for loop that loops 10 times calling the ask_user function.

In: Computer Science

What is S/MIME? Answer in details.

What is S/MIME?

Answer in details.

In: Computer Science

#3 A collection represents a group of objects, known as its elements. Some collections allow duplicate...

#3 A collection represents a group of objects, known as its elements. Some collections allow duplicate elements and others do not. Some are ordered and others unordered. Create an Interface MyCollection which is maximum general (abstract) collection possible. (java oop)-> laboratory work

In: Computer Science

                                          &nb

                                                       Checker

+DisplayCount(int [], int):void


The code below is a partial implementation of the class diagram above. Note the similarities between
the class diagram and its implementation.

class Checker
{
   /*
    * Method DisplayCount
    * This method should display the numbers of times
    * a given number (x) is found in a given array (numbers)
    *
    * Provide the implementation (method body) for DisplayCount
    */
   public void DisplayCount(int[] numbers, int x)
   {

   }
}

I need to complete the implementation of method DisplayCount as described in the comments above, and I need to write a test class that uses class Checker and its DisplayCount method.

Assuming an array like this:

7 5 9 0 1 2 3 2 7 9

If the value of x is 10, the output should be:
10 is in the array 0 times
If the value of x is 7, the output should be:
7 is in the array 2 times

In: Computer Science

Language Assembly ( required) Write and test a function, drawshape. The function has 2 parameters, the...

Language Assembly ( required)

Write and test a function, drawshape. The function has 2 parameters, the shape's character and the length of the shape's longest line.

draw shape(1, x) looks displays

x

x

draw shape(2, y) displays

yy

y

yy

draw shape(3, z) displays

zzz

zz

z

zz

zzz

and so on.

In: Computer Science

Hi! I need it in android studio and in java Design a game app “BouncingBall ”...

Hi! I need it in android studio and in java

Design a game app “BouncingBall ” in which the user’s goal is to prevent a bouncing ball from falling off the bottom of the screen. When the user presses the start button, a ball bounces off the top, left and right sides (the “walls”) of the screen. A horizontal bar on the bottom of the screen serves as a paddle to prevent the ball from hitting the bottom of the screen. The ball can bounce off the paddle, but not the bottom of the screen. Allow the user to drag the paddle left and right. If the ball hits the paddle, it bounces up, and the game continues. If the ball hits the bottom, the game ends. Decrease the paddle’s width every 25 seconds and increase the speed of the ball to make the game more challenging. (BONUS 10 points: Consider adding obstacles at the random location).

In: Computer Science

Questions of this part analyze the students’ understanding in analyzing the given scenario and practical skills...

Questions of this part analyze the students’ understanding in analyzing the given scenario and practical skills to build Class diagrams studied in chapters 8, 10 and 12 of IT242.

The management of the groceries ordering system would desire to have a database system to keep track of orders, customers, drivers and stores. Read the following paragraph to answer the given questions.

The system maintains four users' information. For each user, the system keeps a unique ID, name, login, password, address, contact number, category (Grocery Owner, admin, customer and driver) and status (approved by admin or not). Each Grocery Owner has an address and name of the store. He can view one or more order also it can manage one or more product. Each order has an order ID, amount to pay, status and rate service. An order can be managed by one grocery owner and one admin. A single order is associated with one or more product. The product details to be stored are reference, quantity and price. A product can be processed by one grocery owner. Each driver can view and change the status of one or more order. An order can be assigned to one driver only. Each customer can make one or more order and fill zero or more complaints. Each complaint has a complaint ID, title, body and date. A complaint can be handled by one admin. Each admin can approve registration of store owners, drivers, and customers. He can view reports about the service ratings.

3.1 Draw a Class diagram for the given database. The diagram must show all classes, relationships between classes, and multiplicities.

Answer

In: Computer Science

Develop a routine to convert Celcius to Fahrenheit. Have a form pass the values and a...

Develop a routine to convert Celcius to Fahrenheit. Have a form pass the values and a parm indicating what time of conversion is taking place. Use a function (if possible). Return the correct value.

Here is the formula: C = (F - 32) * 5/9

hw8.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title></head>

<body>
<p>Convert Temp</p>
<form id="form1" name="form1" method="get" action="hw8.php">
  <table width="300" border="1">
    <tr>
      <td width="122">Enter Temp </td>
      <td width="168"><label>
        <input name="temp" type="text" id="temp" size="6" maxlength="8" />
      </label></td>
    </tr>
    <tr>
      <td>Convert to &gt;&gt;&gt; </td>
      <td><p>
        <label></label>
        <label>
        <input name="type" type="radio" value="f" checked="checked" />
Fahrenheit</label>
        <br />
        <label>
        <input type="radio" name="type" value="c" />
Celcius</label>
        <br />
        <br />
      </p></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><label>
        <input type="submit" name="Submit" value="Submit" />
      </label></td>
    </tr>
  </table>
</form>
<p><a href="index.htm">return</a></p>
</body>
</html>

hw8.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<p>Temperature Conversion</p>
<p>
  You converted  Fahrenheit to 32 Celcius<br></p>
<p><a href="hw8.html">return</a></p>
</body>
</html>

In: Computer Science

Explain five differences between a fork and thread

Explain five differences between a fork and thread

In: Computer Science

Modify the DetailedClockPane.java class in your detailed clock program, to add animation to this class. Be...

Modify the DetailedClockPane.java class in your detailed clock program, to add animation to this class. Be sure to include start() and stop() methods to start and stop the clock, respectively.Then write a program that lets the user control the clock with the start and stop buttons.

In: Computer Science

Chapter 1 Case Scenarios 1-2: Creating a Plan to Upgrade to Windows 7

Chapter 1 Case Scenarios 1-2: Creating a Plan to Upgrade to Windows 7

In: Computer Science

Please Use JavaScript and HTML 5) Number guesser (easier) Create a number guessing name, using an...

Please Use JavaScript and HTML

5) Number guesser (easier)

Create a number guessing name, using an input and a button to gather a number.
The number to be guessed should be a hard-coded whole number between 1 and 20.
Tell the user if the number is too high, equal to, or too low than a number you have hard-coded in your application.
Remove the text in the input when the user clicks the button.

In: Computer Science

Create in C Sharp : Create an application that predicts the approximate size of a population...

Create in C Sharp : Create an application that predicts the approximate size of a population of organisms. The application should use text boxes to allow the user to enter the starting number of organisms, the average daily population increase (as a percentage), and the number of days the organisms will be left to multiply. For example, assume the user enters the following values in text boxes:

Starting number of organisms: 2

Average daily increase: 30%

Number of days to multiply: 10

Hint: (new number) = (old number) * (1 + rate/100)

When the user clicks on a button, the application should use a ListBox control to display the data

using a for loop instead of a while loop

In: Computer Science

1. Why is it important for mobile workers and users to know what the risks, threats,...

1. Why is it important for mobile workers and users to know what the risks, threats, and vulnerabilities are when conducting remote access through the public Internet?

2. Why does the mock XYZ Health Care Provider need to define a remote access policy to properly implement remote access through the public Internet?

3. Why is a remote access policy definition a best practice for handling remote employees and authorized users who require remote access from home or on business trips?

4. What security controls, monitoring, and logging should be enabled for remote VPN access and users?

5. Why should an organization mention that it will be monitoring and logging remote access use in its remote access policy definition?

In: Computer Science