Questions
Problem 5. It is the next installment of the ECE 5484 Scavenger Hunt! Two pioneers of...

Problem 5. It is the next installment of the ECE 5484 Scavenger Hunt! Two pioneers of early computers and computer organization were Howard H. Aiken and John von Neumann. Answer the questions below regarding Aiken and von Neumann. Cite sources used for your answers. a) Is Aiken or von Neumann associated with the so-called Princeton architecture? b) Is Aiken or von Neumann associated with the so-called Harvard architecture? c) Briefly, and in your own words, what is the key feature of a Princeton architecture computer compared to the Harvard architecture? d) Does the MARIE architecture owe more to Aiken or von Neumann? In your own words, briefly justify your answer

In: Computer Science

To understand the value of counting loops: Write a java program that implements matrix multiplication using...

To understand the value of counting loops:

  1. Write a java program that implements matrix multiplication using counting loop constructs.
  2. Then write the same program using only logical loops—for example, while loops.

Sample Result is shown below:

Enter the number of rows of matrix A: 2

Enter the number of columns of matrix A: 3

Enter the number of columns of matrix B: 3

Enter the number of columns of matrix B: 4

Enter matrix A;

1 2 3

4 5 6

Enter matrix B:

7 8 9 10

11 12 13 14

15 16 17 18

Matrix A:

1 2 3

4 5 6

Matrix B:

7    8    9 10

11    12 13 14

15 16 17    18

Product of matrix A and Matrix B ( A x B) :

74 80 86 92

173 188 203    218   

In: Computer Science

Part I - Reading input in a loop Before you start doing any coding, brainstorm between...

Part I - Reading input in a loop

Before you start doing any coding, brainstorm between the two of you on how to go about starting this program. You need to get your code to repeatedly prompt for a new String until the user enters an empty line, and then end with a goodbye message. What is the algorithm that you need to use? Write your algorithm into comments in the main method of the Palindrome class (as shown in the class notes). The code you write needs to reproduce the following transcript (user entries are in BOLD):

Enter a string: 1331

Enter a string: racecar

Enter a string: blue

Enter a string:
Empty line read - Goodbye!
Part II - Checking for a palindrome

Now brainstorm with your partner again - once the user has entered a String you need to think about how to tell if it is a palindrome. One way to do this is to compare the characters that are supposed to match - if all of these characters match, then it is a palindrome. If any pair does not match, then it is not a palindrome. Think about the algorithm that does this kind of "pairwise character" comparison - how would you implement that with a loop? Work out the algorithm with your partner and put it into your code, then fill in the code around your algorithm to complete the task. A sample transcript of what your code should do once both parts are completed is below. User entries are shown in BOLD.

Enter a string: 1331
1331 is a palindrome.

Enter a string: racecar
racecar is a palindrome.

Enter a string: blue
blue is NOT a palindrome.

Enter a string:
Empty line read - Goodbye!
Do not worry about differences in case, punctuation, spacing or other issues. Your code should only check whether or not the string of characters is exactly the same forwards as it is backwards.

Enter a string: Racecar
Racecar is NOT a palindrome

Enter a string: RACECAR
RACECAR is a palindrome.

Enter a string: A man, a plan, a canal, Panama.
A man, a plan, a canal, Panama. is NOT a palindrome.

Enter a string: y123321y
y123321y is a palindrome.

Enter a string:
Empty line read - Goodbye!
Use the following template for your code:

public class Palindrome {
public static void main(String[] args) {
// TODO - fill in with your code
}
}

NOTE: You MUST use a nested loop for this assignment. There are other ways to solve this problem, but for this assignment you must have a loop nested inside another loop. Think about using the outer loop to read the String and the inner loop to test for the palindrome.

In: Computer Science

In MATLAB Write a function to create an array of N numbers with a normal distribution....

In MATLAB

Write a function to create an array of N numbers with a normal distribution. Call that from a script to create 1000 numbers, with a mean of 50 and a sigma of 10.

In: Computer Science

Problem 3. A digital computer has a memory unit with 32 bits per word. The instruction...

Problem 3. A digital computer has a memory unit with 32 bits per word. The instruction set consists of 122 different operations. All instructions have an operation code part (opcode) and an address part (allowing for only one address). Each instruction is stored in one word of memory. a) How many bits are needed for the opcode? b) How many bits are left for the address part of the instruction? c) What is the maximum allowable size for memory? d) What is the largest unsigned binary number that can be accommodated in one word of memory?

In: Computer Science

Problem 1. How many bits are required to address a 4M × 16 main memory under...

Problem 1. How many bits are required to address a 4M × 16 main memory under the following conditions. (“4M x 16” means there are 4x220 16-bit words.) a) The main memory is byte-addressable? b) The main memory is word-addressable? (For part b, assume a 16-bit word.)

In: Computer Science

If you were implementing an ERP system, in which cases would you be more inclined to...

  1. If you were implementing an ERP system, in which cases would you be more inclined to modify the ERP to match your business processes? What are the drawbacks of doing this?

In: Computer Science

Please explain step by step what is going on each step Also show how the output...

Please explain step by step what is going on each step

Also show how the output is coming. I would rate positively.

Thank you so much .

#include     <stdio.h>  
#include   <string.h>
  
int   main()  
{  
       char   buffer[16],   *pos;  
       printf("Enter   string:   ");  
       if   (!(fgets(buffer,sizeof(buffer),stdin)))   {  
                   printf("End   of   file\n");  
                   return   0;  
       }  
       printf("Length   of   %s   is   %lu   \n",buffer,strlen(buffer));  
       if   ((pos=strchr(buffer,   '\n'))   !=   NULL)  
                   *pos   =   '\0';      
       printf("Length   of   %s   is   now   %lu   \n",buffer,strlen(buffer));  
       return(0);  
}  

In: Computer Science

Assume we have two sequences of values S1 containing 1, 5, 3, 6, 7, 8 while...

Assume we have two sequences of values S1 containing 1, 5, 3, 6, 7, 8 while S2 containing 2, 5, 6, 9, 7. We store these two sequences as sets and perform a set intersection and set difference. Write C++ code to do that respectively.

In: Computer Science

For each of the following Unix system calls, give a condition that causes it to fail:...

For each of the following Unix system calls, give a condition that causes it to fail: open, read, fork, execve, unlink.

In: Computer Science

create overloaded functions called lastValue. The first function should take as a parameter a string and...

create overloaded functions called lastValue. The first function should take as a parameter a string and the second function should take as a parameter an int. each of you functions should return an int value. in the case of the function that takes the string as an argument you will return the ascii value of the last character in the string. in the case of the function that takes an int parameter your function will return the last digit in the number c++

In: Computer Science

1. Write a program that computes the smallest and largest of a set of values that...

1. Write a program that computes the smallest and largest of a set of values that are stored in an array. Ask the user for the set size (and hence the array size). Populate the array with user input. (Java language)

In: Computer Science

FOR JAVA Define a class QuadraticExpression that represents the quadratic expression ax^2 + bx + c:...

FOR JAVA

Define  a class  QuadraticExpression that represents the quadratic expression ax^2 + bx + c:
You should provide the following methods

  (1) default constructor which initalizes all the coefficients to 0

  (2) a constructor that takes three parameters
          public QuadraticExpression(double a, double b, double c) 
  
  (3) a toString() method that returns the expression as a string. 
   
  (4) evaluate method that returns the value of the expression at x 
    public double evaluate(double x)
    
  (5) set method of a, b, c  
       public void setA(double newA)
       public void setB(double newB)
       public void setC(double newC)
     
  (6) public static QuadraticExpression sum( QuadraticExpression q1, QuadraticExpression q2): 
      returns a new expression that is the sum of the q1 and q2

  (7) public static QuadraticExpression scale( double r, QuadraticExpression q)
      returns a new expression that is r times q

  (8) public int numberOfRoots()
      returns number of roots, where 3 means infite number of roots
     
  (9) public void add( QuadraticExpression q)
      add q to the calling expression object

  (10) public double smallerRoot() throws Exception
   Depending on the equation ax^2 + bx + c = 0: 
      if no roots, throw exception
      if single root, return it
      if two roots, return  the smaller root
      if infinite root, return -Double.MAX_VALUE

  (11) public double largerRoot() throws Exception
      if no roots, throw exception
      if single root, return it
      if two roots, return  the larger root
      if infinite root, return Double.MAX_VALUE
  
  (12) equals method
      This should OVERRIDE equals method from Object class
  
      return true if two expressions have same a, same b and same c

  (13) clone 
       return a copy of the calling object
   

  (14) use javadoc style comments for the class, and the methods
  
       At minimum, include the author,  parameters and return types for each method. 
       
  (15) use javadoc to generate document for your class
  
  (16) test your class:
       you can write your own main to test your code;
    
        but you have to pass the test in QuadraticExpressionTest.java 

   (17) submit  
     a. QuadraticExpression.java
     b. QuadraticExpression.html
      on blackboard.

   (18) turn in printout of
  a. QuadraticExpression.java
 b. the output of your program

Please!! test before posting it

In: Computer Science

Consider the following schema: Suppliers(sid: integer, sname: string, address: string) Parts(pid: integer, pname: string, color: string)...

Consider the following schema:

Suppliers(sid: integer, sname: string, address: string)

Parts(pid: integer, pname: string, color: string)

Catalog(sid: integer, pid: integer, cost: real)

The key fields are underlined, and the domain of each field is listed after the field name. Therefore sid is the key for Suppliers, pid is the key for Parts, and sid and pid together form the key for Catalog. The Catalog relation lists the prices charged for parts by Suppliers.

WRITE THE FOLLOWING QUERIES IN RELATIONAL ALGEBRA WITH BASIC OPERATORS AND AGGREGATE FUNCTIONS ONLY

MEANS IF THE QUERIES CANNOT FULLY EXPRESSED BY BASIC OPERATORS, USE AGGREGATES.

1. Find the names of suppliers who supply some red part.

2. Find the sids of suppliers who supply some red or green part.

3. Find the sids of suppliers who supply some red part or are at 221 Packer Street.

4. Find the sids of suppliers who supply some red part and some green part.

5. Find the sids of suppliers who supply every part.

6. Find the sids of suppliers who supply every red part.

7. Find the sids of suppliers who supply every red or green part.

8. Find the sids of suppliers who supply every red part or supply every green part.

9. Find pairs of sids such that the supplier with the first sid charges more for some part than the supplier with the second sid.

10. Find the pids of parts supplied by at least two different suppliers.

11. Find the pids of the most expensive parts supplied by suppliers named Yosemite Sham.

12. Find the pids of parts supplied by every supplier at less than $200. (If any supplier either does not supply the part or charges more than $200 for it, the part is not selected.)

In: Computer Science

MySQL Multiple Choice Answer as soon as possible 1. Which one of the following is not...

MySQL
Multiple Choice
Answer as soon as possible

1. Which one of the following is not a Replication Data Format?
(a) Row
(b) Mixed
(c) Statement
(d) Sync

2. When executing the following statement on the master:
UPDATE enormous_table SET col1 = 0;
Which replication format would be more efficient?
(Assume enormous_table is a large table with millions of rows)
(a) Statement
(b) Row
(c) Neither

3. When executing the following statement on the master:
INSERT INTO summary_table(col1, col2, sum_col3)
SELECT col1, col2, sum(col3)
FROM enormous_table
GROUP BY col1, col2;
Which replication format would be more efficient?
(Assume enormous_table is a large table with millions of rows)
(a) Statement
(b) Row
(c) Neither

4. Which one of the following is a way to detect if there is an error replicating data on the slave?
(a) Run SHOW MASTER STATUS and Look for an error description in LAST_SQL_ERROR in the results.
(b) Run SHOW MASTER STATUS and Look for an error description in INVALID_COMMAND_FOUND in the results.
(c) Run SHOW SLAVE STATUS and Look for an error description in INVALID_COMMAND_FOUND in the results.
(d) Run SHOW MASTER STATUS and Look for an error description in SYNCING = NO in the results.
(e) Run SHOW SLAVE STATUS and Look for an error description in LAST_SQL_ERROR in the results.

5. Which one of the following is the correct command to skip the next command in the binlog on the slave (this is sometimes used to skip a command that is causing a replication error)?
(a) SET GLOBAL SQL_SLAVE_SKIP = YES;
(b) SET GLOBAL SQL_SLAVE_SKIP_COMMANDS = 1;
(c) SET GLOBAL SQL_SLAVE_SKIP_ON_ERROR = YES;
(d) SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;

6. Which one of the following is the command for temporarily disabling the binlog on the master so you can run a statement without it getting replicated to the slave(s)?
(a) SET REPLICATE_TO_SLAVE = NO;
(b) SET SQL_LOG_BIN = 0;
(c) SET ENABLE_BINLOG = 0;
(d) SET DISABLE_BINLOG = YES;

In: Computer Science