Questions
prove the running time of heap sort.

prove the running time of heap sort.

In: Computer Science

(1) What are the advantages and disadvantages to using the int data type rather than the...

(1) What are the advantages and disadvantages to using the int data type rather than the bool data type to manipulate Boolean expressions? Why do students think the int data type is still used for Boolean expressions?

(2) Discuss how C++ provides two-way selection through the if…else statement. Explain the syntax of this statement. Also, explain how the bool data type is used in C++ to manipulate Boolean expressions.

In: Computer Science

IN JAVA write a program that creates an array of strings with 8 people in it....

IN JAVA write a program that creates an array of strings with 8 people in it. Second,  Assign a random rank between 1 to 8 to each of the players. The rankings do not change throughout the tournament. Finally, Sort the players based on the rankings and print the data (show rankings of players, in square brackets, at every step after they are ranked).
USING JAVA COLLECTIONS IS NOT ALLOWED

In: Computer Science

Consider the following schema: Suppliers(sid, sname, address) Parts(pid, pname, color) Catalog(sid, pid, cost) In a plain...

Consider the following schema:

Suppliers(sid, sname, address)
Parts(
pid, pname, color)
Catalog(sid,
pid, cost)

In a plain text file, write the following queries in SQL:

  1. Find the names of all suppliers who supply a green part.
  2. Find the names of all suppliers who are from Illinois.
  3. Find the names of all suppliers who sell a red part costing less than $100.
  4. Find the names and colors of all parts that are green or red.

In writing these queries you may make the following assumptions:

a. Each part has only one color.
b. The cost field is a real number with two decimal places (e.g., 100.25, 93.00).
c. The sid field in Suppliers and the sid field in Catalog refer to the same field.
d. The pid field in Parts and the pid field in Catalog refer to the same field.

In: Computer Science

[PYTHON] How do you write a program that first gets a list of floating point numbers...

[PYTHON] How do you write a program that first gets a list of floating point numbers from input. The input begins with an integer indicating the number of numbers that follow. Then input all data values and store them in a list [PYTHON]

In: Computer Science

Starting out with Python 4th edition Chapter 2 Programming Exercise 12 Stock Transaction Program Not sure...

Starting out with Python 4th edition

Chapter 2 Programming Exercise 12 Stock Transaction Program

Not sure how to do this

In: Computer Science

Pseudocode: The first problem has multiple steps but is a little bit easier than the second....

Pseudocode:

  1. The first problem has multiple steps but is a little bit easier than the second.

    1. Define a module main

    2. In main, declare an array of Integers named goldFishPerChild with 4

      elements

    3. Set the values of the array to 6, 4, 3, 3 ( you may do both in 1 line)

    4. You tried to teach them responsibility, but your kids are terrible with

      pets. Each child killed two of its goldfish. This is a learning

      experience for them and for you.

    5. In main, write a loop to update the value of each element so that it is

      2 less ​by using the accumulator pattern​.

  2. Define a function named linearSearchInStringArray

    1. Has String parameter searchTerm : value you are searching for

    2. Has String[] parameter inputArray : array you wish to search through

    3. Has Integer parameter arraySize : number of elements in the array

    4. Returns Boolean : True if search term is one of the values in the

      array, False if not.

    CLUE: use count-controlled loop to iterate through all elements CLUE: needs to use a decision structure each iteration
    CLUE: can simply return True if you find a match!
    CLUE: consider when you know you can return false.

    CLUE: drawing pictures can help

3. Define a function named evenCount

  1. Has Integer[] parameter inputArray : array of elements you are

    counting through

  2. Has Integer parameter arraySize : number of elements in array

  3. Returns Integer : number of elements with even-numbered values in

    array

CLUE: This will require a loop and an extra variable to keep a running total

CLUE: this is a great opportunity to use the "%" operator. Look up "modulus" operator. This operator tells you the 'remainder' of a division operation.

A remainder of 0 means the number can be evenly divided...

In: Computer Science

When an object is falling because of gravity, the following formula can be used to determine...

When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period:
d=1/2 gt^2
The variables in the formula are as follows:
d is the distance in meters,
g is 9.8,
t is the amount of time, in seconds, that the object has been falling.
Design a function named calcFallingDistance that accepts an object’s falling time (in seconds) as an argument. The function should return the distance, in meters, that the object has fallen during that time interval.
Design a program that calls the function in a loop that passes the values 1 through 10 as arguments and displays the return value.


In: Computer Science

Do a software evaluation of "MICROSOFT POWERPOINT" using the following criteria: General Requirements and Design Functional...

Do a software evaluation of "MICROSOFT POWERPOINT" using the following criteria:

  1. General Requirements and Design
  2. Functional and Interface Specifications
  3. Conventions
  4. Requirement Traceability
  5. Structures and Interfaces
  6. Logic
  7. Performance
  8. Error Handling and Recovery
  9. Testability and Extensibility
  10. Coupling and Cohesion

In: Computer Science

What do you see as the primary differences between a Web DEVELOPER and a Web DESIGNER?...

What do you see as the primary differences between a Web DEVELOPER and a Web DESIGNER? What are some factors that a Developer must consider over a Designer, or vice versa? Why, specifically, is it important for each to have an understanding of what the other does?

In: Computer Science

Convert this strategy into an algorithm and write it below. remember to provide an algorithm header,...

Convert this strategy into an algorithm and write it below. remember to provide an algorithm header, number the algorithm steps and to use pseudocode conventions.

         Scan the input array A, counting the number of negative, zero and positive numbers. Let these counts be x, y and z respectively.

         Create a new array B of the same size and set a local variable neg to 1, zero to x+1, and pos to x+y+1.

         Scan the input array from left to right, and if the current number being looked at is negative, copy it to B[neg] and increment neg, if it is a zero, copy it to B[zero] and increment zero, and if it is positive, copy it to B[pos] and increment pos.

         Output array B.

In: Computer Science

In the C++ programming language write a program capable of playing Tic-Tac-Toe against the user. Your...

In the C++ programming language write a program capable of playing Tic-Tac-Toe against the user. Your program should use OOP concepts in its design. You can use ASCII art to generate and display the 3x3 playing board. The program should randomly decide who goes first computer or user. Your program should know and inform the user if an illegal move was made (cell already occupied). The program should also announce if one of the players wins or if a draw is achieved. While it is desirable for your program to play a strong game, this is not an Artificial Intelligence course so if your program does not play at a world champion level you will not be penalized for it

In: Computer Science

Need to modify the below code to return the time in minutes instead of seconds. (Using...

Need to modify the below code to return the time in minutes instead of seconds.

(Using Python 2.7.6 )

def numberPossiblePasswords(numDigits, numPossiblePerDigit):
    numPasswords = numPossiblePerDigit**numDigits
    return numPasswords


def maxSecondsToCrack(numPossiblePasswords, secPerAttempt):
    time = numPossiblePasswords*secPerAttempt
    return time


nd = int(input("How many digits long is the passcode? "))      
nc = int(input("How many possible characters are there per digit? "))


secondsPerAttempt = .08


npp = numberPossiblePasswords(nd, nc)


totalSeconds = maxSecondsToCrack(npp, secondsPerAttempt)


print("It will take you " + str(totalSeconds) + " seconds maximum to crack the password.")

In: Computer Science

Python Question I have created a dictionary shown below: import pandas as pd records_dict = {'FirstName':...

Python Question

I have created a dictionary shown below:

import pandas as pd

records_dict = {'FirstName': [
'Jim', 'John', 'Helen'],
'LastName': [
'Robertson', 'Adams', 'Cooper'],
'Zipcode': [
'21801', '22321-1143', 'edskd-2134'],
'Phone': [
'555-555-5555', '4444444444', '323232']
}

I have stored this dictionary in a data frame, like shown below:

records = pd.DataFrame(records_dict)

print(records)

I am able to print the records just fine. My issue is, I want to eliminate, or put a blank space in, the values of the zipcode and phone number keys that do not match the correct format, using regular expressions.

How would I write the syntax for this?   

In: Computer Science

This is a Entry to Java question. Please show me the PseudoCode or Commits first so...

This is a Entry to Java question. Please show me the PseudoCode or Commits first so I can learn to analyze everything a a little bit better.

Simple Calculator (10 points) (General) Calculators represent the most basic, general-purpose of computing machines. Your task is to reduce your highly capable computer down into a simple calculator. You will have to parse a given mathematical expression, and display its result. Your calculator must support addition (+), subtraction (-), multiplication (*), division (/), modulus(%), and exponentiation (**).

Facts

● Mathematical expressions in the form of: num1 operator num2

● Exponentiation should be in the form base ** exponent ○ Example: 3 ** 2 = 9

Input First line is the number of test cases. Each line thereafter is an integer-based mathematical expression in the form defined in the above facts.

Output For each test case, display the result of the mathematical expression terminated with a new line character

Sample Input

4

3+7

5-1

4**2

19/5

Sample Output

10

4

16

3

The main techniques that should be used are selection statements and repetition statements.

In: Computer Science