Questions
UPS relies on an information system. Shipped items are characterized by a unique item number, weight,...

UPS relies on an information system. Shipped items are characterized by a unique item number, weight, dimensions, destination, and delivery date. Shipped items are received into the UPS system at a single retail center. Retail centers are identified by a unique ID and address. Sending Shipped items to their destination can be made through one or more standard UPS transportations. These transportations are identified by a unique schedule-Number, a type (e.g., flight, truck), and a delivery-Route.

Create an Entity Relationship diagram that captures this information about the UPS delivery system. Make sure to present the constraints.

In: Computer Science

What are the block tags and block indexes for the below 12-bit memory locations with 256-byte...

What are the block tags and block indexes for the below 12-bit memory locations with 256-byte cache?
a. 0001 0110 1010, for 16-byte blocks with direct-mapped cache
b. 0010 0011 1011, for 4-byte blocks with 4-way associative cache

In: Computer Science

Compare First Come First Served Scheduling, and Round Robin Scheduling. In your comparison, include discussions of...

Compare First Come First Served Scheduling, and Round Robin Scheduling. In your comparison, include discussions of their potential advantages and disadvantages, and which scheduling scheme performs better under what job load conditions. (You need to give proper reasons.)

In: Computer Science

Draw the memory address blocks (Tag, Index and Offset) for a direct mapped and N-way set...

Draw the memory address blocks (Tag, Index and Offset) for a direct mapped and N-way set associative cache organization for the below cache configurations. Round the cache size to nearest power of 2 (e.g., 1KB = 2^10) and assume 32-bit memory address.
a. 64KB cache, 32-byte block, N = 4
b. 1MB cache, 64-byte block, N=16
c. 32KB cache, 512-byte block, N=64

In: Computer Science

# Problem Description Given a directed graph G = (V, E), find the number of connected...

# Problem Description

Given a directed graph G = (V, E), find the number of connected components in G.

# Input

The graph has `n` vertices and `m` edges.
There are m + 1 lines, the first line gives two numbers `n` and `m`, describing the number of vertices and edges. Each of the following lines contains two numbers `a` and `b` meaning there is an edge (a,b) belong to E. All the numbers in a line are separated by space. (`1 <= a,b <= n`)

You can assume that 2 <= n <= 10000, 1 <= m <= 50000.

Your code should read the input from standard input (e.g.
using functions `input()/raw_input()` in Python and `cin/scanf` in C++).

# Output

One number representing the number of connected components in the graph.


Your code should write the output to standard output (e.g. using functions `print` in Python and `cout/printf` in C++).

# Requirement

Your algorithm should run in O(|V| + |E|) time.

Time limtation: 5 seconds.

Memory limitation: 1.0 GB.

# Environment

Your code will be running on Ubuntu 18.04.5.

Now only accept C++ and Python2/Python3 code, g++ version 7.5.0 and Python versions are Python 2.7.17 and Python 3.6.9.

# Examples and Testing

Some examples (e.g., input-x.txt and output-x.txt, x = 1, 2) are provided.
A figure corresponding input-1 can be found in this repo too.
For Python code, try the following to test your code
```
python ./solution.py < input-x.txt > my-output-x.txt
```
For C++ code, try the following to test your code
```
g++ -o mybinary solution.cpp
./mybinary < input-x.txt > my-output-x.txt
```

Your output `my-output-x.txt` needs to be *match exactly* to the given `output-x.txt`.
On Unix-based systems you can use `diff` to compare them:
```
diff my-output-x.txt output-x.txt
```
On Windows you can use `fc` to compare them:
```
fc my-output-x.txt output-x.txt
```

# Submission

If you want to upload a single file, make sure the file is named as `solution.py` (for Python) or `solution.cpp` (for C++).
If you submit via GitHub, make sure your file is located in directory `assignment3/problem1/solution.py` (for Python) or `assignment3/problem1/solution.cpp` (for C++).

# Hints

Use adjacency list to store all the edges.

In: Computer Science

C++ Write a program that declares two variables:a string firstName and int age.Write a function, called...

C++

Write a program that declares two variables:a string firstName and int age.Write a function, called getName, that when called, prompts the user for their first name.

The function should return the first name and store it in the firstName variable.

Write a function, called getAge, that when called, prompts the user for their age.

The function should return the age and store it in the age variable.

Write a function, that uses the firstName and age as arguments.In the function, print out the person’s name and age.

In: Computer Science

Create a class called evaluateValue that declares 3 integer class variables: zeroValue, positiveValue and negativeValue. These...

  • Create a class called evaluateValue that declares 3 integer class variables: zeroValue, positiveValue and negativeValue. These should be declared as public and you should not use automatic properties to declare them.
  • Your class should have a constructor that takes one integer argument. In the constructor you will code if statements to set one of the three class variables (indicators) to 1 if the number sent to the constructor is either equal to zero, negative, or positive.
  • In the class provide a method printit() used to print the results
    • Evaluate the positive, negative, and zero indicator to determine which line to print. If the indicator is set to 1 then the indicator is true.
    • You will print one of three statements;
      • The number was zero.
      • The number was positive.
      • The number was negative.
  • In the default wrapper class named assignment3 and containing Main write the code in Main that declares one integer variable: val1.
  • Use Console Write and Readline and the convert method to take the integer entry from the keyboard and pass it to the evaluateValue constructor.
  • Instantiate an evaluateValue object and pass the integer values to the constructor.
  • From Main call the printit method which will print the resulting evaluation in the class object.

In: Computer Science

1 Pick the HTML snippet that uses a non-modifiable input named “recipient” with the value “edmonds...

1 Pick the HTML snippet that uses a non-modifiable input named “recipient” with the value “edmonds [email protected]”.

Group of answer choices

a <input type="submit" name="recipient" value="[email protected]">
b <input type="text" name="recipient" value="[email protected]">
c <input type="value" name="recipient" value="[email protected]">
d <input type="hidden" name="recipient" value="[email protected]">

2 Which of the following is the most accurate statement regarding internal hyperlinks?

Group of answer choices

a The “internal” refers to the host machine on which the browser is running

b The “internal” refers to the internal contents of a table

c Internally-linked location names can be assigned to any id in an HTML5 document

d href="page.html&name" is the proper format used to link to an internal location of another page

3 The ______________ element provides input options for a text input element. The browser can use these options to display autocomplete options to the user (hint: this can be used regardless of a user’s previous form inputs).

a value

b datalist

c step

d autocomplete

In: Computer Science

Please use python: # Problem Description Given a directed graph G = (V, E), find the...

Please use python:

# Problem Description

Given a directed graph G = (V, E), find the number of connected components in G.

# Input

The graph has `n` vertices and `m` edges.
There are m + 1 lines, the first line gives two numbers `n` and `m`, describing the number of vertices and edges. Each of the following lines contains two numbers `a` and `b` meaning there is an edge (a,b) belong to E. All the numbers in a line are separated by space. (`1 <= a,b <= n`)

You can assume that 2 <= n <= 10000, 1 <= m <= 50000.

Your code should read the input from standard input (e.g.
using functions `input()/raw_input()` in Python and `cin/scanf` in C++).

# Output

One number representing the number of connected components in the graph.


Your code should write the output to standard output (e.g. using functions `print` in Python and `cout/printf` in C++).

# Requirement

Your algorithm should run in O(|V| + |E|) time.

Time limtation: 5 seconds.

Memory limitation: 1.0 GB.

# Environment

Your code will be running on Ubuntu 18.04.5.

Now only accept C++ and Python2/Python3 code, g++ version 7.5.0 and Python versions are Python 2.7.17 and Python 3.6.9.

# Examples and Testing

Some examples (e.g., input-x.txt and output-x.txt, x = 1, 2) are provided.
A figure corresponding input-1 can be found in this repo too.
For Python code, try the following to test your code
```
python ./solution.py < input-x.txt > my-output-x.txt
```
For C++ code, try the following to test your code
```
g++ -o mybinary solution.cpp
./mybinary < input-x.txt > my-output-x.txt
```

Your output `my-output-x.txt` needs to be *match exactly* to the given `output-x.txt`.
On Unix-based systems you can use `diff` to compare them:
```
diff my-output-x.txt output-x.txt
```
On Windows you can use `fc` to compare them:
```
fc my-output-x.txt output-x.txt
```

# Submission

If you want to upload a single file, make sure the file is named as `solution.py` (for Python) or `solution.cpp` (for C++).
If you submit via GitHub, make sure your file is located in directory `assignment3/problem1/solution.py` (for Python) or `assignment3/problem1/solution.cpp` (for C++).

# Hints

Use adjacency list to store all the edges.

In: Computer Science

You are asking to develop a “Triangle Guessing” game in Python for the assignment. The program...

You are asking to develop a “Triangle Guessing” game in Python for the assignment. The program accepts the lengths of three (3) sides of a triangle as input from a player. The program output should indicate whether the triangle is a right triangle, an acute triangle, or an obtuse triangle.

1.Tips to help you for this assignment: Make sure each side of the triangle is a positive integer. Use try/except for none positive integer input.

2. Validating the triangle. That is the sum of the lengths of any two sides of a triangle is greater than the length of the third side. Use try/except for invalid sides input.

3. For any wrong input, tell the player what is wrong and asking to re-enter.

4. Allow a player to play multiple times, for example, using a while loop. Remind the player what input to stop the game.

5. Develop your game/program a user friendly one. Document your program by adding comments: Introduce/describe the program including the author, date, goal/purpose of the program Document every variable used at the program even the name is meaningful Explain/comment operation/activity/logic of your code. For example, “Checking whether the inputs are positive integers” and “Checking the validity the 3 lengths to see if they are able to form a triangle”

6. Testing your program for all possible input and every of the 3 possible triangles

In: Computer Science

Too often, statistics are used to ‘prove’ some point or to persuade an audience to some...

Too often, statistics are used to ‘prove’ some point or to persuade an audience to some particular point of view, without really being accurate, complete, or honest. This issue has been the subject of numerous texts. You may be interested in reading such titles as Damned Lies and Statistics, or How to Lie with Statistics. Explain why the use of analytics contributed to the problem. Discuss the consequences of the matter. Did the company/organization involve suffer any adverse consequences?

In: Computer Science

Convert the attached C++ code to working Java code. Be judicious in the change that you...

Convert the attached C++ code to working Java code. Be judicious in the change that you make. This assignment is not about re-writing or improving this code, but rather about recognizing the differences between C++ and Java, and making the necessary coding changes to accommodate how Java does things. PLEASE DO NOT use a built-in Java QUEUE (or any other) container. Additional resources for assignment:

#include <iostream>

#include <string>

using namespace std;

class pizza

{

public:

string ingrediants, address;

pizza *next;

pizza(string ingrediants, string address)

{

this->address = address;

this->ingrediants = ingrediants;

next = NULL;

}

};

void enqueue(pizza **head, pizza **tail, pizza *thispizza)

{

if (*head == NULL) *head = thispizza;

else (*tail)->next = thispizza;

*tail = thispizza;

return;

}

pizza* dequeue(pizza **head, pizza **tail)

{

pizza* pizzatodeliver = NULL;

if (*head != NULL)

{

pizzatodeliver = *head;

*head = (*head)->next;

}

if (*head == NULL) *tail = NULL;

return pizzatodeliver;

}

void deliver(pizza **head, pizza`** tail)

{

pizza *thispizza = dequeue(head, tail);

if (thispizza == NULL)

{

cout << "No deliveries pending" << endl; return;

}

cout << "Deliver a pizza with " << thispizza->ingrediants

<< " to " << thispizza->address << endl;

}

int main()

{

pizza *first = NULL, *last = NULL;

enqueue(&first, &last, new pizza("pepperoni", "1234 Bobcat Trail"));

enqueue(&first, &last, new pizza("sausage", "2345 University Drive"));

deliver(&first, &last);

enqueue(&first, &last, new pizza("extra cheese", "3456 Rickster Road"));

enqueue(&first, &last, new pizza("everything", "4567 King Court"));

enqueue(&first, &last, new pizza("coffee beans", "5678 Java Circle"));

deliver(&first, &last);

deliver(&first, &last);

deliver(&first, &last);

deliver(&first, &last);

deliver(&first, &last);

cin.get();

return 0;

}

In: Computer Science

Write a C program to store the parameters of a circle on a 2D plane: the...

Write a C program to store the parameters of a circle on a 2D plane: the x and y coordinates of the center point and r, the radius. All three parameters are real (floating point) numbers.

-Define a type to store the parameters of a circle. Write a function that receives the parameters of two circles as function parameters, and returns whether the two circles overlap or not. (Two circles overlap if the distance between their center points - computed by the Pythagorean theorem - is less than the sum of their radius.)

-Write a function that asks the user to enter the parameters of a circle, creates the circle, and returns it.

-Expand the type definition and the functions to a program that reads the data of two circles, decides if they overlap, and displays a message accordingly.

In: Computer Science

Accessing applications in the Cloud is easier than traditional applications, as it can be a matter...

Accessing applications in the Cloud is easier than traditional applications, as it can be a matter of just going to a separate website. What are the dangers of this benefit? In a minimum one-page document, discuss this ability and benefit of using Cloud services for applications and where the pitfalls are. Relate your discussion to a specific application type for your comments. Discuss how this may be a benefit or not to a company using the Cloud for its applictions.

In: Computer Science

Use Python programming to find most popular single products and co-purchased products from the large transaction...

Use Python programming to find most popular single products and co-purchased products from the large transaction data: retail.csv. Each row in the file is one purchase transaction from a customer, including a set of product ids separated by commas. The first column is transaction ID, column 2-3 are the products ID purchased in this transaction. It is worth mentioning that if the value in third column is zero, it means this customer only purchased one product (the one in second column).

Note:

• Co-purchased products is defined as a pair of products purchased in the same transaction. For example a row is: "2 24 35". Then 24 and 35 is a pair of copurchased products IDs,.

• To find co-purchased product in each transaction, you might use a nested loop.

• Write top 10 single products and top 10 co-purchased product pairs into a new file: output.txt

In: Computer Science