Write a SQL query that displays the number of customers from Mexico, USA, and Canada. Hint: The result of the SQL query should look like the following table: CustomerCountNorthAmerica 21
In: Computer Science
In: Computer Science
In: Computer Science
Using the Web, search for “software firewalls.” Examine the various alternatives available and compare their functionality, cost, features, and type of protection. Create a chart with weighted rankings according to your own evaluation of the features and specifications of each software package. Additionally, provide 1-2 supporting paragraphs for your chart and describe how/why you came to your decision on the firewall weighted rankings.
In: Computer Science
Codes for this R-Project please!
In this projects we will draw plots for different discrete
probability distributions that we have studied in class.
# 1. Binomial distribution.
We will plot the density function for the binomial distribution
Bin(n, p).
Note:
1) The values for this random variable are 0, 1, 2, ..., n.
2) The density plot will have a bar of height P(X=k), at the point
'k' on the x-axis.
3) In the plot include a vertical line at the expected value of
Bin(n,p).
Write a function plot_binom, that takes input values: n and p, and returns the density plot of Bin(n,p).
```{r}
# plot_binom <- function(n,p){
# x <- 0:n
# bin <- dbinom( _____ ) # input appropriate parameters
# mu_X <- ____ #input appropriate value for expected value
# plot(x, bin, type = "h", lwd = 5,
# main = paste("Binom density: n = ", n ,"and p = ", p),
# xlab = "x", ylab = "P(X=x)")
# abline(v = mu_X, col = 'red', lwd = 4)
# }
```
Fix n = 40. Compute plots for the following values of p: 0.05, 0.1,
0.4, 0.6, 0.9, 0.95.
Use the command "par(mfrow=c(3,2))" to have all the plots on the
same frame.
```{r}
# n <- 40
# prob_vals <- c(_______) #input appropriate values for
probability
# par(mfrow=c(3,2))
# for (p in prob_vals){
# plot_binom(____) #input the appropriate values
#}
```
Write at least two observations that you can note from these plots. Consider skewness and symmetry.
In: Computer Science
A file server needs to serve 20 users. Each user wants to download the same file of size 100 MB. The server can upload data at 100 Mbps and each client can download at 10 Mbps. A, Estimate the minimal total time required to fully download the file by all users. B, Peer-to-Peer architecture( Assume each user can upload at 3 Mbps) c. Redo a and b for users=200
In: Computer Science
Make a simple C++ program not complex
Following points are to be considered while making the program:
In: Computer Science
In your OWN words explain in detail the role of an operating system and list the main operating systems used on today’s computers.
In: Computer Science
In your OWN words explain in detail the benefits and the risks of using an online social network.
In: Computer Science
Question 3. Find a solution to the instance π = 2 3 1 4 5 7 6 of the Pancake Flipping problem using a greedy approach (15 points). Describe your algorithm using pseudocode. (10 points)
In: Computer Science
Array of Hope! Write code for a Java class ArrayPair with the following fields and methods: ArrayPair - arr1 [] : int - arr2 [] : int Fields - length1 : int - length2 : int + ArrayPair (int arraySize) Methods + add (int arrNumber, int value) : void + remove (int arrNumber) : void + equal () : boolean + greater () : boolean + print () : void Thus, there are two arrays of integers in the class with associated lengths (number of elements in each array).
Methods: ArrayPair: Constructor, instantiates the two arrays with the given size as a parameter. Sets the private lengths equal to zero since the arrays are initially empty. The constructor should not print or read anything.
add: Adds the given value to the right end of the array specified by the arrNumber (if equal to 1, adds to the arr1, if 2 adds to arr2, otherwise prints an error message and does not add the value). add should not print anything other than the error message when appropriate.
remove: Removes the rightmost element of the array specified by arrNumber. If the array is empty, an error message should be printed. remove should not print anything other than an error message when appropriate.
equal: Returns true if the two arrays have the same number of values and the exact same values in the same order. Otherwise, equal should return false. equal should not print anything to output.
greater: greater returns true if arr1 has more elements than arr2. greater returns false if arr2 has more elements than arr1. If the two arrays have the same number of elements, compare corresponding elements in the two arrays. For the first non-equal pair of values: if the arr1 value is greater than the arr2 value, true is returned; if the arr2 value is greater than the arr1 value, false is returned. If all the values are equal, false is returned.
print: Prints the values in both of the arrays with labels.
Main Program (Java class PairApp) Program first creates an ArrayPair object. The program then repeatedly reads commands of add, remove, equal, greater, print, or quit, until the user enters quit. If the user enters: add: Prompts the user for array number and value and calls add method to add that value to the given array. remove: Prompts the user for array number and calls the remove method to remove that element from the given array. equal: Calls equal method and prints whether or not the two arrays are equal. greater: Calls greater method prints whether or the not the first array is greater than the second. print: Calls print to print the values in the arrays. Note these further requirements: • User options should be accepted as uppercase or lowercase. • An error message is printed for an illegal choice. • The program should print an ending message when stopping. There is a sample run on the next page. Your output should follow the given text and spacing. Include a header comment describing the program and comment all variables, control structures and methods in the program.
In: Computer Science
Question 3.[10 pt]
As indicated in the course book and discussed in the class extensively, there is
generally an efficiency trade-off among execution time, memory usage and communication
overhead for a given algorithm. Please give at least two examples where such a trade-off occurs.
For example, can you give an algorithm example wherein more storage permits faster execution,
or vice versa? Similarly, can you exemplify another algorithm wherein there are trade-offs
among communication and/or memory and/or execution time?
Algorithm Trade-off Example Brief Discussion 1 [5pt]:
Write a paragraph here by explaining the
name of the algorithm and how the performance trade-off.
Algorithm Trade-off Example Brief Discussion 2 [5pt]:
Write a paragraph here by explaining the
5
name of the algorithm and how the performance trade-off occurs.
Question 4. [30 pt]
In this exercise, we start getting familiar withtwo-dimensional arrays, i.e., a
matrix (remember that matrices are nothing but 2D arrays).Matrices are one of the most
fundamental data structures, and they are used in every aspect of Information Technology
including but not limited to AI, cyber-security and software engineering. The most basic
definition of a matrix is here:
https://www.mathsisfun.com/algebra/matrix-introduction.html
Specifically, as an example was given in the above link for 2x2 matrix, you will perform the
most basic arithmetic operation on a matrix,
adding two matrices entry-wise
. Please see the link
below and read
“Entrywise Sum”.
Each corresponding cell in a matrix is added and put into 3
rd
target matrix.
https://en.wikipedia.org/wiki/Matrix_addition
Write a program named “
hw2.py
” that will add two matrices entry-wise. The matrix dimension
is fixed and 5x5 for this exercise. Your program should print an error if the dimensions of the
two matrices are different. In this case, print a message stating that the matrix dimensions does
not match. There are two matrices to be added. One is shown in “hw2-m1.txt”
5 2 0 3 4
2 4 1 1 0
3 0 5 6 1
0 2 6 0 1
4 1 1 0 0
6
The other one is shown in “hw2-m2.txt”
2 0 4 0 1
2 2 1 0 5
0 0 1 0 3
2 1 0 4 1
0 0 4 0 1
Read these two matrices from “.txt” files, and use your own codes to add them,
donot use built-
in functions
. Finally, you should print the result on the screen as
The result is:
7 2 4 3 5
4 6 2 1 5
3 0 6 6 4
2 3 6 4 2
4 1 5 0 1
In: Computer Science
2.In cell F6, enter a formula without using a function that multiplies 12 by the Term and the Monthly_Payment, and then subtracts the Loan_Amount to determine the total interest
3. in cell J5, enter another formula using the PV function. Use
defined cell names for the rate, nper, and pmt arguments as
follows:
· rate argument: Divide the Rate by
12 to use the monthly interest rate.
· nper argument: Subtract the year value in cell
H5 from the Term, and then
multiply the result by 12 to specify the number of
months remaining to pay off the loan.
· pmt argument: Use the Monthly_Payment as a
negative value to specify the payment amount per period.
In: Computer Science
Respond to the following in a minimum of 175 words:
Write a short-answer response to the following: Describe some of the issues that can be caused by not properly managing the size of one's Outlook® mailbox.
What are some ways to organize messages and clean up or reduce the size of one's Outlook® mailbox?
Create a customer dialog to help diagnose and resolve an Outlook® mailbox that is too full.
In: Computer Science
I was trying to implement a stack for my assignment. One of the
method given is this: public T[] toArray(); I need help to
implement this method. The class is a generic class. I am using
ArrayList to implement my stack. ArrayList<T> stack is the
data structure. I want to convert everything in the ArrayList to an
array.
I am implementing the public T[] toArray() interface
given to me, so I can not use the JDK toArray method.
In: Computer Science