Questions
Using c++, complete the functions to fulfill requirements. Basically, turn test case into unit test code....

Using c++, complete the functions to fulfill requirements. Basically, turn test case into unit test code.

You may only use:

- iostream, cmath

/*
BLAS Level 1 function declarations
*/

#ifndef BLAS_H
#define BLAS_H

/*
Find the element with the maximum absolute value.
Input:
   x : vector (as array of doubles)
   len : number of elements in x (dimension)
Output: index of the first element with maximum absolute value
Errors: returns -1 if vector is empty (len = 0)
*/
int amax(
const double* x,
const unsigned int len);

/*
Sum the absolute values.
Input:
   x : vector (as array of doubles)
   len : number of elements in x (dimension)
Output: sum of the absolute values of the elements.
Returns 0 if x is empty.
*/
double asum(
const double* x,
const unsigned int len);

/*
Generalized vector addition (afine transformation)
Input:
   a : scalar value
   x : vector (as an array of doubles)
   y : vector (as an array of doubles)
   len : number of elements in x and y (dimension, assumed equal)
Output: None. y is updated as y = a*x + y
*/
void axpy(
const double a,
const double* x,
double* y,
const unsigned int len);

/*
Copy a vector.
Input:
   x : source vector (as an array of doubles)
   y : destination vector (as array of doubles)
   len : number of elements in x and y (dimension, assumed equal)
Output: None. y is updated as y = x
*/
void copy(
const double* x,
double* y,
const unsigned int len);

/*
Dot (inner) product of two vectors.
Input:
   x : vector (as an array of doubles)
   y : vector (as an array of doubles)
   len : number of elements of x and y (dimension, assumed to be equal)
Output: dot (inner) product of x and y: x . y
Return 0 if x and y are empty.
*/
double dot(
const double* x,
const double* y,
const unsigned int len);

/*
Euclidean norm of a vector.
Input:
   x : vector (as an array of doubles)
   len : number of elements of x (dimension)
Output: magnitude (length) of x as the distance from the origin to x (as a point)
Returns 0 if x is empty.
*/
double norm2(
const double* x,
const unsigned int len);

/*
Scale a vector.
Input:
   a : scalar value
   x : vector (as an array of doubles)
   len : number of elements in x (dimension)
Output: None. x is scaled by a: x = a*x;
*/
void scale(
const double a,
double* x,
const unsigned int len);

/*
Swap two vectors.
Input:
   x : vector (as an array of doubles)
   y : vector (as an array of doubles)
   len : number of elements in x and y (dimension, assumed to be equal)
Output: None. x and y are updated as x,y = y,x
*/
void swap(
double* x,
double* y,
const unsigned int len);

#endif

In: Computer Science

In c++ format please Bank Charges A bank charges $10 per month plus the following check...

In c++ format please

Bank Charges
A bank charges $10 per month plus the following check fees for a commercial checking account:

  • $.10 each for fewer than 20 checks

  • $.08 each for 20–39 checks

  • $.06 each for 40–59 checks

  • $.04 each for 60 or more checks


The bank also charges an extra $15 if the balance of the account falls below $400 (before any check fees are applied).

Write a program that asks for the beginning balance and the number of checks written. Compute and display the bank’s service fees for the month.


Input Validation: Do not accept a negative value for the number of checks written. If a negative value is given for the beginning balance, display an urgent message indicating the account is overdrawn.

In: Computer Science

Please note: This is in Visual Basic. Create an application. Add a text box, a label,...

Please note: This is in Visual Basic.

Create an application. Add a text box, a label, and a button to the form. If the user enters a number that is greater than 100 in the text box, the button's "click" event procedure should display the result of multiplying the number by 5. Otherwise, it should display the result of dividing the number by 5. Code the procedure.

In: Computer Science

Create a Java program which prints a truth table for any 2 variables propositional function. Assuming...

Create a Java program which prints a truth table for any 2 variables propositional function.
Assuming variables p and q. Instead of the symbols for "and" and "or", just used the words. For "not", use the tilde "~"

Prompt the user for 3 questions
1: "p and q"? Or "p or q"?
2: Do you want to negate p?
3: Do you want to negate q?

For example, suppose in a menu system the user chose "p or q", and to negate q. The output should look similar to this:

p | q | (p or ~q)
------------------
T | T | T
T | F | T
F | T | F
F | F | T

In: Computer Science

The Board of Directors of Northwind have appointed Doug Hanus at their new CEO and Jeff...

The Board of Directors of Northwind have appointed Doug Hanus at their new CEO and Jeff Hogan as their operational manager. They are planning to devote their first two weeks in office to gain a better understanding of Northwind’s supply chain and marketing processes. As senior database analyst for Northwind, it is your responsibility to code appropriately structured SQL statements for retrieving the following information requested by Doug and Jeff. They need it on or before 09/29/2019.

  1. A listing of Northwind’s suppliers. [1 pt.]

  1. A listing of Northwind’s suppliers based in Norway and Sweden. [2 pts]

  1. A listing of Northwind’s product categories and the description of each product category. [2 pts]

  1. A clearer picture of the geographical footprint of their customers and suppliers - they want separate listings of the countries in which their customers and suppliers are located. [2 pts]

  1. The average, sum, maximum, and minimum per unit cost across all products in their product line. They would also like to know the names of Northwind’s products having per unit cost between 30 and 50 (both inclusive). [2 pts]
  1. A count and a listing of the cities and corresponding countries in North America (USA, Canada, Mexico) where they have a customer base. [3 pts]

  1. A listing of the product names and its corresponding category for products from suppliers based in Germany and France. [4 pts]

  1. A list of countries outside of North America (i.e. USA, Canada, Mexico) where they have less than 3 suppliers. [4 pts]

  1. For OrderIDs 10258, 10259, and 10260, a listing of the corresponding customer, employee who accepted the order, and the shipper. The listed must be sorted alphabetically by customer name. [5 pts]

  1. A listing of the product names and supplier names for all products that make up OrderIDs 10254 and 10260. [5 pts]

In: Computer Science

2. Determine whether the following Propositional Logic statements are valid or invalid arguments. You may use...

2. Determine whether the following Propositional Logic statements are valid or invalid arguments. You may use a truth table, proofs using rules of inference, or resolution (specify which method you are using).

(a) p→q, ~q→r, r; ∴p

(b) ~p∨q, p→(r∧s), s→q; ∴q∨r

(c) p→(q→r), q; ∴p→r

In: Computer Science

Please, i need Unique answer, Use your own words (don't copy and paste). *Please, don't use...

Please, i need Unique answer, Use your own words (don't copy and paste).

*Please, don't use handwriting.

DDoS attack

Based on the Internet, access to the article intituled: ‘A survey on DDoS attack and defense strategies from traditional schemas to current techniques’.

1- Describe the DDoS attack.

2- Provide at least two exploited vulnerabilities used by hacker to perform the DDoS attack.

3- Provide at least two countermeasures against DDoS.

In: Computer Science

We are given an array of n numbers A in an arbitrary order. Design an algorithm...

  1. We are given an array of n numbers A in an arbitrary order. Design an algorithm to find the largest and second largest number in A using at most 3/2n -2 comparisons.

(i) describe the idea behind your algorithm in English (3 points);

(ii) provide pseudocode (5 points);

(iii) analyze the number of comparisons used in your algorithm (2 points).

In: Computer Science

Part 1: In each of the following scenarios, tell whether there is a violation of confidentiality,...

Part 1: In each of the following scenarios, tell whether there is a violation of confidentiality, integrity, or availability, or some combination of the three. In addition, for each item, write a two- or three-sentence paragraph explaining why your answer is correct.

Alex disables Barbara's router by logging in remotely with the manufacturer's default password.

Mallory builds a WiFi jammer using plans she found on the Internet and jams wireless signals over a large part of her apartment building.

Charlene uses a key logger to capture Darla's banking password.

Eve rewrites the magetic stripe on a gift card to change the amount from $10 to $100.

(Adapted from an exercise in Bishop, Matt, Introduction to Computer Security.)

Part 2: Distinguish among vulnerability, exploit, threat, risk, and control mechanism (called "countermeasure" in chapter one of the text) in five brief paragraphs. If you do any research outside the textbook, which you are encouraged to do, be sure to cite your sources. You can see how to do that in An Example of Proper Writing in the "Required Reading" section.

Part 3: Using the tool at http://www.fileformat.info/tool/hash.htm, compute the SHA-256 checksum of the MS-Word file that is your work on this assignment so far, or some similar file if you don't have that one available. Copy the calculated cryptographic hash into Windows Notepad or word processing document to save it temporarily. Now change one character from a capital to a lowercase letter or vice-versa in the original document, re-save, and recompute the the cryptographic hash. Paste the old and new cryptographic hashes into your homework document. Be sure to identify which one is before and which is after.

Using the information from the textbook, explain at least two uses for a cryptographic hash, and explain how the experiment you just performed confirms those uses.

Do some research and explain in a paragraph or so what a "hash collision" is. Be sure to cite your research.

Part 4: Explain in a couple of paragraphs how public key encryption can be used to implement a digital signature. Be sure you are very clear on when a private key is used and when a public key is used.

Part 5: Generally, a digital signature involves encrypting a cryptographic hash, or digest, generated from the message. Explain why we do we not encrypt the message itself. You can answer this question in one sentence.

Part 6: For each of the following scenarios below, tell what type of encryption is most appropriate and in a sentence or two explain the reasoning for your choice.

Alice wants to send a confidential message to Bill, whom she has never met and who lives in a distant country.

Charlie wants to be sure that no one but he can see the financial and medical records he has stored on his computer.

David needs a way to check that large computer files stored on corporate servers have not been modified.

Eddard uses a "cloud" backup service; he wants to be sure the operators of the service cannot read his files.

Frank needs to send a message to George. The message need not be confidential, but George must be assured that it actually came from Frank.

In: Computer Science

how does rootkit work?

how does rootkit work?

In: Computer Science

###### THIS SHOULD BE IN PYTHON Calculate the sum of cubes. If the input is x,...

###### THIS SHOULD BE IN PYTHON

Calculate the sum of cubes. If the input is x, the sum of cubes is equal to: 13 + 23 + ... + x3


Take input for the number of cubes to sum.
No error checking is needed.
Specifically, you may assume that the input is always a positive integer

Here are some sample runs:
Enter how many cubes to sum: 1   
1   

Enter how many cubes to sum: 3
36

Enter how many cubes to sum: 4
100

Enter how many cubes to sum: 2
9

In: Computer Science

What is the benefit of a harvard architecture for a cache?

What is the benefit of a harvard architecture for a cache?

In: Computer Science

An example of a health form with the following requirements: 1. Create a meaningful form for...

An example of a health form with the following requirements:

1. Create a meaningful form for your application, for example, a health monitoring app

2. Edit CSS for your application. The page must be styled with at least 10 CSS styles

This is using Visual Studio to use reactive form application

In: Computer Science

C# in Visual Studio Practice Concepts ● Practice using conditional logic and expressions ● Practice protecting...

C# in Visual Studio

Practice Concepts

● Practice using conditional logic and expressions

● Practice protecting numeric input prompts (Int.TryParse(Console.ReadLine(), out);

Problem Description

create a Console Application using the .NET Framework. C#

This project will implement a short 3-question quiz.

Create a quiz application that has 3 questions. At least one of the questions must offer multiple choices,

and at least one question must prompt the user to enter a numeric input. The third question can be

either multiple choice or numeric input.

Scoring a multiple choice question will work as follows:

● If the user enters the correct choice value, award 3 points.

● If the user enters a valid offered choice, but the incorrect answer, award 1 point.

● If the user enters an invalid option, award 0 points.

Scoring a numeric input question will work as follows:

● If the user enters the correct numeric value, award 3 points.

● If the user enters a valid number, but the incorrect answer, award 1 point.

● If the user enters a non-numeric value, award 0 points.

Final scoring:

● If the user answered all three questions correctly, award 1 bonus point, for a maximum of 10

points earned. (3 points for each correct answer, plus the bonus point).

Test Conditions

● Your program should be free of syntax errors and build and compile properly.

● Due to the numerous ways you can answer these questions, make sure to test your program

over multiple conditions. Test the case where all answers are correct, all answers are incorrect,

etc.

● Note: On this quiz, it should be possible to score: 0 points, 1 point, 2 points, 3 points, 4 points,

5 points, 6 points, 7 points, and 10 points. Can you test each case?

In: Computer Science

. Implement your own custom linked list array implementation with the following changes: (a) Fill in...

. Implement your own custom linked list array implementation with the following changes:
(a) Fill in the public E get(int index) method
(b) Also add code to the get method to print out a message for each time an element in the list is
checked while searching for the element
You may want to study how the toString method goes from element to element in the list

Java

In: Computer Science