Questions
                                          &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

Following the directions in the chapter, what are the steps one could take to manually remove...

Following the directions in the chapter, what are the steps one could take to manually remove installed software from their computer? (Think about the manual steps here, rather than the uninstall routines provided by the software manufacturer).

What kinds of errors might one get when uninstalling a program? What resources are available to help with these errors? Have you ever run into errors when uninstalling programs?

Summarize your experience and share your resources with the class in a minimum of 175 words.  

In: Computer Science

Write a program in python that implements quicksort, first using recursion and then without recursion.

Write a program in python that implements quicksort, first using recursion and then without recursion.

In: Computer Science

JAVA PROGRAM (Make sure that programs are running. Please discuss, if there is any compilation or...

JAVA PROGRAM

(Make sure that programs are running. Please discuss, if there is any compilation or run error.)

Q. 1 Calculate the expression

a)         x= 7.0 + (12 %3)*5 – 3;                   

b)         x= 7 + (11 / 2)*5 + 3;           

Q 2: Write a program that prompts the user to enter five test scores and then prints

the average test score. (Assume that the test scores are decimal numbers.)

Q 3. Write a program that prompts the capacity, in gallons, of an automobile fuel tank and the miles per gallon the automobile can be driven. The program outputs the number of miles the automobile can be driven

without refueling.

Q 4. Centigrade and Fahrenheit are two scales to measure temperature. Write a program that that prompts the user to enter Centigrate and then print the Fahrenheit.

Use following formula for conversion.

Fahrenheit = Centigrade*1.8 +   32 ;

Q. 5 What is the output of the following program?

public class SwitchDemo {

    public static void main(String[] args) {

int x = 2;

switch (x)

{ case 1: cout << "x is 1";

case 2: cout << "x is 2";

default: cout << "value of x unknown"; } }

Q. 6

a)        Which of the following are valid java identifiers (variables)?   

•           1MyFirstProgram

•           Mix_up

•           Fifth.x

•           five

b) Write whethet the following expressions are true or false

I.          8>8&&9>8

II.         8>8| |8>9

Q. 7 Write a program to calculate the bill of a customer. The program will

-           Prompt the employee to enter the monthly plan fees.

-           Prompt the employee to enter the rate per additional minute.

-          Print the bill

The bill will be calculated as follows: if the number of consumed minutes is 300 minutes or less, the client pays only his regular monthly fees. If the number of minutes is more than 300, then he should pay in addition to the regular monthly fees, an extra amount for each additional minute consumed (over the allowed 300 minutes using rate per additional minute.).

In: Computer Science

Task 1: Remove Number Complete the function remove number such that given a list of integers...

Task 1: Remove Number

Complete the function remove number such that given a list of integers and an integer n, the function removes every instance of n from the list. Remember that this function needs to modify the list, not return a new list.

Task 2: Logged List

The log2() function is one of an algorithm designer’s favourite functions. You’ll learn more about this later, but briefly – if your input size is 1048576 elements, but you only look at log2(1048576) elements, you’ll really just look at 20 elements.

Bongo, an algorithm designer, designs algorithms that take lists as inputs. Being an efficient designer, all his algorithms are designed such that they look at log2(n) elements if the number of elements in the input list is n.

To assist him, we’ve designed the logged list function. This function takes a list l as input and returns a new list such that it has all the elements in original list l which occur at indices that are powers of 2. For example: indices 1, 2, 4, 8, 16, 32, etc.

However, something is wrong. The function isn’t just returning a list with elements at all indices that are powers of 2. Fix the function so it works correctly!

You must make sure that the fixes are minor fixes. Just like major lab 2, this means that your code will not need a lot of changes.

Task 3: Move Zeros

It’s trivial that the value of a number remains the same no matter how many zeros precede it. However, adding the zeros at the end of the number increases the value * 10.

Jasmine is tired of seeing “001/100” on her tests (well yes, no one really writes 001, but Jasmine’s teacher finds it funny to do so). So, she managed to login to her teacher’s computer and now wants to design a function that can move the 0’s in her grade to the end before her teacher uploads her grades.

Although we don’t agree with Jasmine’s tactics, Krish (Jasmine’s mentor) told us to help her out by finishing the ‘move zeros’ function. This function should move all the 0’s in the given list to the end while preserving the order of the other elements. Remember that this function needs to modify the list, not return a new list!

Task 4: Find Number

Tony (your team member at work) implemented a function find number which is supposed to return the index of a number in a list if the number is in the list, else return -1. However, it doesn’t work the way it’s expected to...

Fix the function so it works correctly. Just like Task 2, your fixes should be minor fixes. Don’t try adding more code, you only need to see how you can change the existing code a bit.

See the Starter code below:

# DO NOT ADD ANY OTHER IMPORTS

from typing import List

def remove_number(lst: List[int], number: int) -> None:

    """

        Remove every instance of number in lst. Do this

        *in-place*, i.e. *modify* the list. Do NOT

        return a new list.

    >>> lst = [1, 2, 3]

    >>> remove_number(lst, 3)

    >>> lst

    [1, 2]

    """

    pass

def logged_list(lst: List[object]) -> List[object]:

    """

    Return a new list such that it has all the objects

    in lst which occur at indices which are powers of 2

    >>> logged_list([0, 1, 2, 3, 4, 5, 6, 7, 8])

    [1, 2, 4, 8]

    """

    # TODO: FIX

    i = 0

    new_lst = []

    while i < len(lst) - 1:

        new_lst.append(lst[i])

        i += 2

    return new_lst

def move_zeros(lst: List[int]) -> None:

    """

    Move all the 0's in lst to the END of the lst *in-place*,

    i.e. *modify* the list, DONT return a new list

    >>> lst = [1, 0, 2, 3]

    >>> move_zeros(lst)

    >>> lst

    [1, 2, 3, 0]

    """

    pass

def find_number(lst: List[int], number: int) -> int:

    """

    Return the first index of the number if the number is in the

    lst else return -1

    >>> find_number([1, 2, 3], 3)

    2

    >>> find_number([1, 2, 3], 4)

    -1

    """

    # TODO: this code needs to be fixed. Fix

    found = False

    i = 0

    while not found:

        if lst[i] == number:

            found = True

        else:

            found = False

            i += 1

    if found:

        return i

    return -1

if __name__ == '__main__':

    # uncomment the code below once you are done the lab

    # import doctest

    # doctest.testmod()

    pass

In: Computer Science