select the correct window_frame_clause
a) INTERVAL '5' DAYS AND UNLIMITED PRECEDING
b) INTERVAL '5' DAYS PRECEDING AND CURRENT ROW
c) INTERVAL '5' DAYS AND CURRENT ROW
d) INTERVAL '5' DAYS AND FIRST ROW
In: Computer Science
(a) List and explain three types of pipeline hazards.
(b) List and explain three types of cache misses.
(c) What is the principle of locality?
(d). Discuss the advantage and disadvantage of the write back and write through policy in the cache.
In: Computer Science
Please answer it in C++
The first function should take a reference to an ifstream object and a reference to an array of double, read data into the array from the file and return the number of values read. It should stop reading when the end of the file is reached. The data file contains prices of an unspecified item, one per line.
The second function takes a reference to an array of double, and an int indicating the number of elements in the array and then calculates and returns the average of the values in the array.
(b) The program below is designed to use the functions readData() and findAverage()defined in part a above to read the data from a file called prices.txt to the array and then calculate and display the average. Currently, the program has missing sections indicated by the empty text boxes. Complete the program by inserting the missing statements into the spaces provided.
In: Computer Science
Discuss the CSVLOD model and its relevance to this Damien mask Business context?
In: Computer Science
For this assignment, write a parallel program in C++ using OpenMP for vector addition. Assume A, B, C are three vectors of equal length. The program will add the corresponding elements of vectors A and B and will store the sum in the corresponding elements in vector C (in other words C[i] = A[i] + B[i]). Every thread should execute an approximately equal number of loop iterations.
As an input vector A, initialize its size to 10,000 and elements from 1 to 10,000.
So, A[0] = 1, A[1] = 2, A[2] = 3, … , A[9999] = 10000.
Input vector B will be initialized to the same size with opposite inputs.
So, B[0] = 10000, B[1] = 9999, B[2] = 9998, … , B[9999] = 1
Using the above input vectors A and B, create output Vector C which will be computed as
C[ i ] = A[ i ] + B[ i ];
You should check whether your output vector value is 10001 in every C[ i ].
First, start with 2 threads (each thread adding 5,000 vectors), and then do with 4, and 8 threads. Remember sometimes your vector size can not be divided equally by the number of threads. You need to slightly modify the pseudo code to handle the situation accordingly. (Hint: If you have p threads, first (p - 1) threads should have the same input size and the last thread will take care of whatever the remainder portion.) Check the running time from each experiment and compare the result. Report your findings from this project in a separate paragraph.
Your output should show a team of treads does evenly distributed work, but a big vector size might cause an issue in output. You can create mini version of original vector in much smaller size of 100 (A[0] = 1, A[1] = 2, A[2] = 3, … , A[99] = 100) and run with 6 threads once and take a snapshot of your output. And run with original size with 2, 4, and 8 threads to compare running times.
Pseudocode for Assignment
mystart = myid*n/p; // starting index for the individual thread
myend = mystart+n/p; // ending index for the individual thread
for (i = mystart; i < myend; i++) // each thread computes local sum
do vector addition // and later all local sums combined
In: Computer Science
Objective: CODE IN JAVA
Create a program that displays a design or picture for someone in your quarantine household/group: a pet, a parent, a sibling, a friend. Make them a picture using the tools in TurtleGraphics and run your program to share it with them! Use a pen object, as well as any of the shape class objects to help you create your design. You must use and draw at least 5 shape objects. You must use a minimum of 4 different colors in your design. You must pick up the pen at least once in your code. You mut put down the pen at least once in your code.
In: Computer Science
You do not need to import the Math class into your Java program to use methods or constants in it.
Group of answer choices
True
False
In: Computer Science
c++ please
Your task is to write the implementation for a class of polynomial operations. Your will write the code for: 2 constructors, a destructor, print, addition, multiplication , differentiation and integration of polynomials. The polynomials will be comprised of linked TermNodes.
struct TermNode
{
int exp; // exponent
double coef; // coefficient
TermNode * next;
};
class Polynomial
{
public:
Polynomial (); // default constructor
Polynomial (int r, int c); // constructor makes a 1 node polynomial
Polynomial(const Polynomial & ); // copy constructor
~Polynomial (); // destructor
Polynomial operator=(const Polynomial &); // assignment
Polynomial operator+ (const Polynomial & ) const; // returns sum of the parameter + self
Polynomial operator* (const Polynomial & ) const;
Polynomial differentiation();
Polynomial integration ();// (with 0 as the constant)
friend ofstream & operator<< (ofstream & out, const Polynomial & rhs); // coefficients printed to 2 decimal places
private:
TermNode *firstTerm;
};
Example Use of functions
Polynomial poly1; //makes a null polynomial
Polynomial poly2(2,3); // makes the polynomial 2.00x^3
Polynomial poly3(3,4); // makes the polynomial 3.00x^4
poly1 = poly2 + poly3; // makes poly1 = 3.00x^4 + 2.00x^3
cout<<poly1<<endl; // prints out 3.0x^4 + 2.00x^3
poly3 = poly2*poly1; // sets poly3 to 6.0x^7+4.00x^6
poly4 = poly3.differentiation(); // sets poly4 to 42.00x^6+24.00x^5
poly5 = poly1.integration(); // sets poly5 to .60x^5+.50x^4 In: Computer Science
in Python3
The ord function in Python takes a character and return an
integer that represents that character.
It does not matter what the integer representing the character
actually is, but what matters is this:
ord('a') is 1 less than ord('b'), so that:
x=ord('a')
thisLetter = x+1 # thisLetter is the ord('b')
This is a powerful fact that is used in encryption techniques, so data transferred over the web is 'ciphered so it is unreadable to others.
To decipher data, we take a string and change it into another
string by adding a constant (called the key) to each of its
letters' ord value.
See the book's Case study: word play.
To cipher and decipher data, we need two functions: one to take a string, and change it to something else. For this we need to use the ord function, and add the 'key' to result in a new string. For example, say x is one letter to be ciphered, and the key is 3. We can use:
Newx=ord(x)+3
Newx will be an integer. To find out what letter that integer
represents you can use the chr function as in:
actualLetter = chr(x)
Write a function named cipher that takes a string.
The function returns that string in a ciphered form by using the
ord of the first letter of the string to cipher each letter
including the first letter. Hence for abc, use the ord of 'a', and
add it to the ord of 'a' and convert that result to a character use
the chr function. This character should be concatenated to the same
action on the letter b and so on. Hence the function returns:
chr(ord('a')+ord('a')) + chr(ord('a')+ord('b')) +
chr(ord('a')+ord('c')).
Obviously you need a loop to iterate on each letter.
Write another function to decipher (do the opposite of the previous function), given a string and returns the deciphered string. Obviously, the first letter's ord is halved to find the first letter, and that value is used to decipher the remaining letters.
From main, write code to get a string, as input, then call the
cipher function and print its output.
Then call the decipher function and display its output. The
decipher output should match the original string.
For help on this see the book's Case study: word play.
Add comments as needed but make sure to add top level comments.
In: Computer Science
There are different types of software testing techniques as described below. There is no uniform (standard) best software testing technique. Each has its own benefits.
-Black box testing: based on functional requirements.
-White box testing: ensure that all statements and conditions have been executed at least once
-Manual software testing is time consuming
-Regression testing: Software testing has to be repeated after every change
Explain the following testing techniques and justify the statement - "There is no uniform (standard) best software testing technique."
Please help with this question and explain in your own words to avoid plagiarism. Thanks.
In: Computer Science
Pick a product/service of your choice. In this assignment you will provide a high level web strategic plan for that product and service. Remember, as you are putting together that strategic plan, think of what's your high level objective of your website? Is it to sell product or get people to raise their hand (or generate leads) to learn more about the product. Provide details on the following sections for this "draft plan". Whats the objective of your website? Who's your target audience? What type of content (information) should you have on your site? Will you have mainly copy or graphics or both? Why? What is your content there to help you achieve? How will you generate traffic to your site? (social media, email, PPC, SEO, explain your plan here) What metrics will you measure to see if your plan and what you executed was successful? Give specific examples
In: Computer Science
Analyze the following code:
public class Test {
public static void main(String[] args) {
xMethod(5, 500L);
}
public static void xMethod(int n, long l) {
System.out.println("int, long");
}
public static void xMethod(long n, long l) {
System.out.println("long, long");
}
}
Group of answer choices
The program prints 2 lines: int, long long, long
The program contains a compile error because Java can't tell which method to invoke.
The program prints long, long
The program prints int, long
In: Computer Science
IN JAVA
Write a program that calculates the occupancy rate for each floor of a hotel. (Use a sentinel value and please point out the sentinel in bold.) The program should start by asking for the number of floors in the hotel. A loop should then iterate once for each floor. During each iteration, the loop should ask the user for the number of rooms on the floor and the number of them that are occupied. After all the iterations, the program should display the number of rooms the hotel has, the number of them that are occupied, the number that are vacant, and the occupancy rate for the hotel. Input Validation: Do not accept a value less than 1 for the number of floors. Do not accept a number less than 10 for the number of rooms on a floor.
SAMPLE OUTPUT:
Enter number of floors:
2
Enter total rooms at floor 1:
10
Enter total rooms occupied at floor1:
5
Enter total rooms at floor 2:
10
Enter total rooms occupied at floor2:
5
Total rooms: 20
Total occupied rooms: 20
Hotel occupany: 50.0
In: Computer Science
You are an IT company and want to get a daycare's network design, hardware, software, and security. Project resources allocation. List all types of resources (e.g. human and non-human) you will use them in the enterprise network project. How are you planning to use those resources cost-effectively?
In: Computer Science
Tic-Tac-Toe, also called X's and O's, Noughts and Crosses, and X and 0 is a simple game played on a 3x3 grid, referred to as the board. Lines may be horizontal, vertical, or diagonal.
You will implement a Board class to represent the 3x3 grid. This class will have functions to determine which symbol, if any, is in a cell, to place a symbol in a cell, to determine the winner, if any so far, and to print the board to standard output. The board should appear as below:
Implement a Board class with the following functionality:
Default constructor, copy constructor, destructor, assignment operator.
Determine the symbol at the specified grid position.
Change the symbol at the specified grid position.
Determine the winner of the game, if any. You must distinguish between the case where there is no winner because the game is not over yet, and the case where there is no winner because the game ended in a tie.
Create four constants for the four game states and return one of them.
Find a way to pass the position in the grid as a single value. This can be done by creating a record (struct) to store the row and column, or by representing both values using a single integer.
Print the board to standard output.
In: Computer Science