How is inheritance is a one-way association between classes. What does this mean? Also need examples.
In: Computer Science
****** please don't copy and paste and don't use handwriting
****** I need a unique answer
Q3:
According to Ed Leonard, the CTO at DreamWorks “Shrek 3 consumed 20 million CPU render hours with 3000+ server CPUs, with 24TB file size”.
Suppose the personal computer CPU advanced so much so that we accomplished that goal by fabricating 3000-core Processor Motherboard. Would this new multicore machine perform as well as the parallel processing employed by DreamWorks?
Give 2 justifications to support your answer?
Q4: Explain (in your own words) how does JAGGIES happens in text and what is the technique used to mitigate the JAGGIES effect? Mention an application that applies that technique.
In: Computer Science
Please do in java with code available for copy and with comments so I can follow along :)\
Develop a program that prints out the sum of each column of a two-dimensional array. The program defines method sumColumn() takes a two-dimensional array of integers and returns a single-dimensional array that stores the sum of columns of the passed array. The program main method prompts the user to enter a 3-by-4 array, prints out the array, and then calls method sumColumns(). Finally, it prints out the array retuned by method sumColumns(). Document your code, and organize and space the outputs properly as shown below. C++ students: instead of asking the user for input, you must read it from a file. See appendix for more information.
Sample run 1:
Enter a value: 9
Enter a value: 1
Enter a value: 2
Enter a value: 4
.
.
.
Enter a value: 3
The entered matrix:
9 1 2 4
2 2 8 0
3 3 3 3
Sum of column 0 is 14
Sum of column 1 is 6
Sum of column 2 is 13
Sum of column 3 is 7
In: Computer Science
Problem 2: Do a side-by-side comparison of Cascading and the following technologies in regards to writing Hadoop applications. Make sure you include the advantages and disadvantages of each, as well as when to use each technology over the other.
In: Computer Science
prove: ambiguous implies not LL(k) for any k.
In: Computer Science
Part1: Write a program in C/C++ to solve the 0/1 knapsack problem using (i) Dynamic Programming based algorithm and (ii) Branch and Bound Search based algorithm Go through the related text and implement each of these algorithms using the efficient data structure. Show the results of different steps of these algorithms for an instance of the 0/1 Knapsack problem with number of items, n=4. The capacity of the knapsack, weights and profits of the items may be generated randomly with the condition that the capacity of the knapsack is such that all items can not be accommodated in the knapsack. But, at the same time, at least one item can be accommodated in the knapsack. Part2: Analyze the complexity of these algorithms (Run each of the two algorithms for a set of ten randomly generated 0/1 knapsack instances (with n=4) and compute the time taken by the selected implementation in each run. Compute average time taken by each of these two algorithms
In: Computer Science
Write a class (and a client class to test it) that encapsulates a tic-tac-toe board. A tic-tac-toe board looks like a table of three rows and three columns partially or completely filled with the characters X and O. At any point, a cell of that table could be empty or could contain an X or an O. You should have one instance variable, a two-dimensional array of values representing the tic-tac-toe board.
This game should involve one human player vs. the computer (aka, it should be a one player game). At the start of each game, randomly select if the computer will play X or O and who (i.e. human or computer) will make the first move.
Your default constructor should instantiate the array so that it represents an empty board.
You should include the following methods:
a method that generates a valid play by the computer and displays the board after each play.
a method that requests a valid play from the human and displays the board after each play.
a method to display the tic-tac-toe board.
a method checking if a player has won based on the contents of the board; this method takes no parameter. It returns X if the "X player" has won, O if the "O player" has won, T if the game was a tie. A player wins if he or she has placed an X (or an O) in all cells in a row, all cells in a column, or all cells in one of the diagonals.
NOTE: Be sure to display the board after each move. You must provide clear prompts for the human player to select a space on the tic-tac-toe board.
Input Validation: Verify that all moves by the human player are to a valid space on the tic-tac-toe board. An incorrect choice should not halt or terminate the game. Also, no human vs. human mode should be included in the program. Just Human vs. the Computer is what the game should only involve.
In: Computer Science
Consider a 5-by-20 integer array grades:
a) Write a declaration for grades.
b) How many rows does the array have?
c) How many columns does the array have?
d) How many elements does the array have?
e) Write the names of all elements in the first column of the
array.
f) Write the name of the element in the third row and second column
of the array.
g) Write a single statement to assign the value 100 to the element
in the first row and second column.
h) Write a nested loop to get all the elements from the
keyboard.
i) Write a nested for statement to initialize all elements to
zero.
j) Write a statement that copies the values from an array double
mathGrades[20]into the
elements of the first row of grades.
k) Write a series of statements that determine and print the
highest value in the first row of grades.
l) Write a statement to display the elements in column 2 of the
array.
m) Write a statement to calculate the average of the elements in
the first row.
n) Write a series of statements that prints the array grades in a
tabular format. List the
column subscripts as headings across the top and list the row
subscripts at the left of
each row.
In: Computer Science
#promt the user to enter student name for i in range(0, 3): print ("Enter student's first and last name") #variable for name name = input() #prompt the user to enter number of book purchased print ("Enter the number of book the student purchased this month") #varibale for number of book book_number = input() book_number = int (book_number) #point = int (point) if (book_number <=0): points = 0 elif (book_number <=3): points = 5 elif (book_number <=6): points = 10 elif (book_number <=8): points = 15 elif (book_number ==9): points = 20 else : points = 25 print (name , "earned" ,points)
this is my python code but it is not printing all the names and points, just printing the last one.
In: Computer Science
The objective of this assignment is to look at two aspects of testing, one is an exploration of the theory of testing, the second is the exploration of a practical software tool.
You should pick a specific topic in software testing and explore it in a bit of detail, issues you could look at include: Functional testing, Compatibility testing, Static testing, Dynamic testing, White box testing, Black box testing, Grey box testing, Visual testing, Unit testing, Integration testing, Regression testing, Alpha testing, Beta testing, Usability testing, Certification, etc. or whatever you want.
Write between one page and one and a half pages on the topic, and include at least four references you use - this can be websites, papers, videos or books. Use the six thinking hats as a model for the structure of the article you write so do an Introduction Section (blue hat), some facts and details about the topic (white hat), the benefits of this topic (yellow hat), the shortcomings around this topic (black hat), the alternatives or interesting facts or examples about this topic (green hat), your views and reflections on this topic (red hat), and a conclusion at the end (another blue hat). Additionally include a simple MindMap about the topic.
In: Computer Science
Write the code for following problem. [6 marks] The class Movie is started below. An instance of class Movie represents a film. This class has the following three class variables: title, which is a String representing the title of the movie studio, which is a String representing the studio that made the movie rating, which is a String representing the rating of the movie (i.e. PG13, R, etc) public class Movie { private String title; private String studio; private String rating; // your code goes here } a) Write a constructor for the class Movie, which takes a String representing the title of the movie, a String representing the studio, and a String representing the rating as its arguments, and sets the respective class variables to these values. b) Write a second constructor for the class Movie, which takes a String representing the title of the movie and a String representing the studio as its arguments, and sets the respective class variables to these values, while the class variable rating is set to "PG". c) Write a method get PG, which takes an array of base type Movie as its argument, and returns a new array of only those movies in the input array with a rating of "PG". You may assume the input array is full of Movie instances. The returned array need not be full. d) Write a piece of code that creates an instance of the class Movie with the title “XYZ Royale”, the studio “ABC Productions”, and the rating “PG13”.
In: Computer Science
Explain the key differences between using if statements to check for null values and using Optional types and why we might prefer that latter.
In: Computer Science
1. Read the Netflix Challenge Preview the document – datacenter edition paper to understand the relationship between the Netflix challenge and the cluster resource allocation problem.
2. Quasar Preview the document classifies resource allocation for scale-up, scale-out, heterogeneity, and interference. Why are classification criteria important, and how are they applied?
3. What are stragglers and how does Quasar deal with them?
In: Computer Science
Using Jeliot, execute the following tree algorithm:
import Prog1Tools.IOTools;
class Node {
Node
left;
Node
right;
int
value;
public Node(int value) {
this.value = value;
}
}
public class GeneralTreeTest {
public static void
main(String[] args) {
// build a simple tree add 5 nodes to the tree
Node root =
new Node(5);
System.out.println("Tree Example");
System.out.println("Building tree with root value " +
root.value);
insert(root,
1);
insert(root,
8);
insert(root,
6);
insert(root,
3);
insert(root,
9);
System.out.println("Traversing tree ");
printOrder(root);
}
public static void insert(Node node, int
value) {
if (value
< node.value) {
if (node.left != null) {
insert(node.left, value);
} else {
System.out.println(" Inserted " + value + " to left of "
+ node.value);
node.left = new Node(value);
}
} else if (value
> node.value) {
if (node.right != null) {
insert(node.right, value);
} else {
System.out.println(" Inserted " + value + " to right of "
+ node.value);
node.right = new Node(value);
}
}
}
public static void printOrder(Node node)
{
if (node != null)
{
printOrder(node.left);
System.out.println(" Traversed " + node.value);
printOrder(node.right);
}
}
}
This algorithm first inserts five nodes into a tree structure and then traverses the tree. Using the Jeliot environment, load, compile and execute this java algorithm to understand its operation. Determine the kind of tree structure that is being created and determine what kind of traversal the algorithm is conducting.
Finally, conduct an Asymptotic analysis for the provided algorithm and report your analysis including Big O, Big Omega, or Big Theta as appropriate. Post your findings to the discussion forum and review and respond to the postings of your peers.
If you have arrived at a different answer or analysis than your peers, discuss your findings with your peers and attempt to determine whose analysis is most accurate.
In: Computer Science
x=61,y=73 compute x+y and x-y in8-bit 2's complement system, then convert the answer to decimal
In: Computer Science