Questions
Describe the major steps for a CPU to execute a procedure call. Specify when BL and...

Describe the major steps for a CPU to execute a procedure call. Specify when BL and BR instructions will be executed, respectively.

Explain how inline function can improve the software performance, and when it should be used.

In: Computer Science

Implement the following function in the PyDev module functions.py and test it from a PyDev module...

Implement the following function in the PyDev module functions.py and test it from a PyDev module named :

def is_divisible(n, i, j):
    """
    -------------------------------------------------------
    Determines if n is evenly divisible by both i and j.
    Use: result = is_divisible(n, i, j)
    -------------------------------------------------------
    Parameters:
        n - the number to check for divisibility (int)
        i - one of the values to divide n by (int)
        j - another value to divide n by (int)
    Returns:
        result - True if n is evenly divisible by both
            i and j, False otherwise (boolean)
    ------------------------------------------------------
    """

Sample testing:

Enter number to check for divisibility: 15
Enter first value to divide by: 3
Enter second value to divide by: 5

15 is evenly divisible by 3 and 5.
Enter number to check for divisibility: 16
Enter first value to divide by: 4
Enter second value to divide by: 3

16 is not evenly divisible by 4 and 3.

In: Computer Science

Implement the following function in the PyDev module functions.py and test it from a PyDev module...

Implement the following function in the PyDev module functions.py and test it from a PyDev module named :

def wind_speed(speed):
    """
    -------------------------------------------------------
    description
    Use: category = wind_speed(speed)
    -------------------------------------------------------
    Parameters:
        speed - wind speed in km/hr (int >= 0)
    Returns:
        category - description of wind speed (str)
    ------------------------------------------------------
    """

Wind speeds are categorized as:

Wind speed (km/h) Category
< 39 Breeze
39 - 61 Strong Wind
62 - 88 Gale Winds
89 - 117 Whole Gale
> 117 Hurricane

The function should return 'unknown' for a negative wind speed.

Sample testing:

Wind speed (km/h): 95
Category: Whole Gale

In: Computer Science

Implement the following function in the PyDev module functions.py and test it from a PyDev module...

Implement the following function in the PyDev module functions.py and test it from a PyDev module named :

def fast_food():
    """
    -------------------------------------------------------
    Food order function.
    Asks user for their order and if they want a combo, and if
    necessary, what is the side order for the combo:
    Prices:
        Burger: $6.00
        Wings: $8.00
        Fries combo: add $1.50
        Salad combo: add $2.00
    Use: price = fast_food()
    -------------------------------------------------------
    Returns:
        price - the price of one meal (float)
    -------------------------------------------------------
    """

Sample testing:

Order B - burger or W - wings: B
Make it a combo? (Y/N): N
Price: $6.00

Order B - burger or W - wings: W
Make it a combo? (Y/N): Y
Add F - fries or S - salad: F
Price: $9.50

In: Computer Science

The program will first prompt the user for a range of numbers. Then the game will...

The program will first prompt the user for a range of numbers. Then the game will generate a random number in that range. The program will then allow the user to guess 3 times. Each time the person takes a guess, if it is not the number then the game should tell them to guess higher or lower. They only get 3 guesses. If they have not guessed the number in three tries then the game should tell them the computer won and thank you for playing and ask them if they would like to play again. If the user wins then the game should congratulate them and ask them if they would like to play again. Each time the program repeats you should store the random number generated into an array. When the program is done the program should display the all of the random numbers back to the user.

In java language

In: Computer Science

The use of graphics and animation to inform, entertain and educate

The use of graphics and animation to inform, entertain and educate

In: Computer Science

MTN operating on a frequency of 2.3MHz aim at achieving 15Mbps of data throughput with a...

MTN operating on a frequency of 2.3MHz aim at achieving 15Mbps of data throughput with a successful receiver interpreting an incoming signal to noise (S/N)dB = 12, 18, 25. Calculate the maximum bite rate of each S/N without using calculator explain the tradeoff factor, compare your results with the calculator results, which of this is enough for 4G which aim at achieving 14 Mbps and why?

In: Computer Science

Give a recurrence relation to find the length of the longest monotonically increasing subsequent of a...

Give a recurrence relation to find the length of the longest monotonically increasing subsequent of a array. Give the recursive algorithm based on the recurrence relation and explain the time complexity of this algorithm.

In: Computer Science

In the java programming language. How would you find if numbers in an array element add...

In the java programming language.

How would you find if numbers in an array element add up to a certain sum so for example if my array element consists of: INPUT: 200, 10, 50, 20 and my output asks if these elements add to: 210? YES (200+10) 260? YES (200+10+50) 30? NO What method would you suggest to look through the elements in an array (which im going to add through a text file) and determine if these sums exist in O(n^2)?

In: Computer Science

State whether each of the following is true or false. Justify your answer! a. There are...

State whether each of the following is true or false. Justify your answer!

a. There are infinitely many finite languages.

b. Union of any two languages over alphabet {0, 1} is always regular.

c. The value of n3 +6n2 +5n is divisible by 6 for any integer n>0. Provide a proof.

d. Single state NFA can recognize only finite languages (languages with finitely many strings)

e. Intersection of any language and its complement is always regular.

In: Computer Science

Multiple choice Consider the following ORACLE relations : One (x, y) = {<2, 5>, <1, 6>,...

Multiple choice

Consider the following ORACLE relations :
One (x, y) = {<2, 5>, <1, 6>, <1, 6>, <1, 6>, <4, 8>, <4, 8>}
Two (x, y) = {<2, 55>, <1, 1>, <4, 4>, <1, 6>, <4, 8>, <4, 8>, <9, 9>, <1, 6>}

Consider the following two SQL queries SQ1 and SQ2 :

SQ1 : SELECT * FROM One)            
          EXCEPT            
         (SELECT * FROM Two);
  
SQ2 : SELECT * FROM One)            
          EXCEPT ALL           
         (SELECT * FROM Two);

2 and 2 respectively

1 and 2 respectively

1 and 1 respectively

2 and 1 respectively

In: Computer Science

5. What is the Netflix churn rate and what are the reasons behind this rate?

5. What is the Netflix churn rate and what are the reasons behind this rate?

In: Computer Science

Design a strategy that minimizes the expected number of questions you will ask in the fol-...

Design a strategy that minimizes the expected number of questions you will ask in the fol- lowing game. You have a deck of cards that consists of one one, two twos, three threes, and so on up to nine nines for a total of 45 cards. Someone draws a card from the shuffled deck and looks at its value (hiding it from you). The goal is to determine the value of the card through asking a series of questions, each of which must be answerable with “yes” or “no” (such as “Is the card a nine?”).

To answer this question, you should express your strategy as a decision tree. You may either explicitly draw the decision tree or describe its construction in sufficient detail so that I could draw it from your description.

Furthermore, briefly explain why this minimizes the expected number of questions you will ask in this game. You are not required to give a formal proof.

Hint: The first question to ask in the optimal decision tree is “Is the card one of {4, 5, 9}?” Equivalently, the question can be “Is the card one of {1, 2, 3, 6, 7, 8}?”

In: Computer Science

For the computer forensics case, identify what evidence the forensics experts were able to gather. What...

  1. For the computer forensics case, identify what evidence the forensics experts were able to gather.
  2. What important questions should the security incident response form answer.
  3. Why is it important to include a time/date stamp in the security incident response form?

In: Computer Science

What is a sensible approach to building and validating a predictive model

What is a sensible approach to building and validating a predictive model

In: Computer Science