Assignment 5

  You shall write a C++ program that:

  1. Reads an arbitrary number of whitespace-delimited tokens from standard input.
  2. Determines and prints (to standard output) two decimal integer values:
    1. The number of input tokens that are valid Scrabble words (case-insensitive), i.e. those that can be found in /srv/datasets/scrabble-hybrid.
    2. The total number of points that all those words would be worth in Scrabble, according to the letter values in /srv/datasets/scrabble-letter-values.

Specific Requirements

  1. You may assume that the number of valid words and the total number of points will not exceed the range of an unsigned 64-bit integer.
  2. Open and read the contents of each relevant data file exactly once.
  3. Make sure to use STL components that will avoid any gross inefficiencies (excessive computation and/or storage) in your program. Your program should at least be able to process each of the example inputs below in no more than 5 seconds, on our server.
  4. Print the two integer values in the order specified above, and make sure your output contains no other numeric decimal values. Otherwise, the format of output is up to you.

Demonstrate Your Knowledge of Advanced SQL

 

This assignment will test your understanding of conditional logic, views, ranking and windowing functions, and transactions, as shown in the videos. The prompt includes 10 questions.

You will need to create your own test database and tables using the criteria below. Please submit your answers using only one file. The preferable format is a text file with a .sql extension. You can easily edit the file using a text editor such as Notepad ++, which is available online for free.

Prompt: A manufacturing company’s data warehouse contains the following tables.

                                          Region

region_id (p)

region_name

super_region_id (f)

101

North America

102

USA

101

103

Canada

101

104

USA-Northeast

102

105

USA-Southeast

102

106

USA-West

102

107

Mexico

101

Note: (p) = “primary key” and (f) = “foreign key”. They are not part of the column names. 

                    Product

product_id (p)

product_name

1256

Gear – Large

4437

Gear – Small

5567

Crankshaft

7684

Sprocket

                                        Sales_Totals

product_id (p)(f)

region_id (p)(f)

year (p)

month (p)

sales

1256

104

2020

1

1000

4437

105

2020

2

1200

7684

106

2020

3

800

1256

103

2020

4

2200

4437

107

2020

5

1700

7684

104

2020

6

750

1256

104

2020

7

1100

4437

105

2020

8

1050

7684

106

2020

9

600

1256

103

2020

10

1900

4437

107

2020

11

1500

7684

104

2020

12

900

Answer the following questions using the above tables/data:

  1. Write a CASE expression that can be used to return the quarter number (1, 2, 3, or 4) only based on the month.
  2. Write a query which will pivot the Sales_Totals data so that there is a column for each of the 4 products containing the total sales across all months of 2020.  It is OK to include the product_id values in your query, and the results should look as follows:

tot_sales_large_gearstot_sales_small_gearstot_sales_crankshaftstot_sales_sprockets6200545003050

3. Write a query that retrieves all columns from the Sales_Totals table, along with a column called sales_rank which assigns a ranking to each row based on the value of the Sales column in descending order.

4. Write a query that retrieves all columns from the Sales_Totals table, along with a column called product_sales_rank which assigns a ranking to each row based on the value of the Sales column in descending order, with a separate set of rankings for each product.

5. Expand on the query from question #4 by adding logic to return only those rows with a product_sales_rank of 1 or 2.

6. Write a set of SQL statements which will add a row to the Region table for Europe, and then add a row to the Sales_Total table for the Europe region and the Sprocket product (product_id = 7684) for October 2020, with a sales total of $1,500. You can assign any value to the region_id column, as long as it is unique to the Region table. The statements should be executed as a single unit of work. Please note that since the statements are executed as a single unit of work, additional code is needed.

7. Write a statement to create a view called Product_Sales_Totals which will group sales data by product and year.  Columns should include product_id, year, product_sales, and gear_sales, which will contain the total sales for the “Gear – Large” and “Gear Small” products (should be generated by an expression, and it is OK to use the product_id values in the expression).  To accomplish this, you need a CASE statement. The product_sales column should be a sum of sales for the particular product_id and year, regardless of what kind of product it is. The gear_sales column should be a sum of sales only in the case where the product is either “Gear – Large” or “Gear Small”.  Else in the case that the product is neither “Gear – Large” or “Gear Small”, the value for gear_sales should be 0.

8. Write a query to return all sales data for 2020, along with a column showing the percentage of sales for each product.  Columns should include product_id, region_id, month, sales, and pct_product_sales.

9. Write a query to return the year, month, and sales columns, along with a 4th column named prior_month_sales showing the sales from the prior month.  There are only 12 rows in the sales_totals table, one for each month of 2020, so you will not need to group data or filter/partition on region_id or product_id.

10. If the tables used in this prompt are in the ‘sales’ database, write a query to retrieve the name and type of each of the columns in the Product table. Please specify the ‘sales’ database in your answer.

Previous
 

Organ Leader and Decision Making

 This week’s journal article focuses on attribution theory and how it influences the implementation of innovation technologies.  Two types of employee attributions are noted in the article (intentionality and deceptive intentionality), please review these concepts and answer the following questions:

  1. Provide a high-level overview/ summary of the case study
  2. Note how constructive intentionality impacts innovation implementations
  3. Find another article that adds to the overall findings of the case and note how attribution-based perspective enhances successful innovation implementations.  Please be explicit and detailed in answering this question.

positive rights table

Complete a 1- to 2-page table using the Positive Rights Table Template provided comparing your opinion of the rights listed below to a corresponding ethical theory:

  • The right to a higher education
  • The right to private phone conversations
  • The right to health care
  • The right of a presidential or government candidate to receive time on television

List 1 ethical challenge that could impact a U.S. company that wants to acquire a non-U.S.-based company.

Research paper: Composition

According to Kirk (2016), composition is about how the elements will appear in your design.

Write a research paper that contains the following:

  1. Discuss the visual assets such as charts, interactive controls, and annotations that will occupy space in your work.
  2. Discuss the best way to use space in terms of position, size, and shape of every visible property.
  3. Data representation techniques that display overlapping connections also introduce the need to contemplate value sorting in the z-dimension, discuss which connections will be above and which will be below and why. Show example using any chart or diagram of your choice.

Reference

Kirk, A. (2016). Data Visualisation: A Handbook for Data Driven Design. Thousand Oaks, CA: Sage Publications, Ltd. (Chapter – 7 Interactivity)

INSTRUCTIONS.

1. No Plagiarism.

2. The submission date is Friday (07/17/20).

3. Atleast 3 references in APA format.

4. It should be at least 3 pages (800 words) excluding cover page and reference page.

5. Include a cover page and a table of content.

Java Programming

Please read the instruction from these pictures.

You can use these codes below. 

game.java (The codes of the picture below) : 

https://drive.google.com/file/d/1vggE2dDlb9d7PdE1vB6_AIa2bxytc3Um/view?usp=sharing

Game.java : 

https://drive.google.com/file/d/1Ax_n-lW65wCPXgelFctKGnx93i1KNFdc/view?usp=sharing

GameObject.java : 

https://drive.google.com/file/d/1M3nbQUVt9FjY_aco5YtAN_g-moXgfYhk/view?usp=sharing

Enemy.java : 

https://drive.google.com/file/d/12ZmBwbsH5ltgSI18gWcZJX5DHwgEqYoi/view?usp=sharing

Player.java

https://drive.google.com/file/d/1Kn1PAXE3NONPyYPaeHBBH3gCdjcwaN6l/view?usp=sharing

Deadlocking in Concurrent and Distributed system

 There are 5 resources, A, B, F, G, I, each of which can be acquired and released. There are two resource-user (or thread) types S and T.

 Each instance of S repeatedly executes this code sequence: It acquires I, then A, and then G. It releases A and G. It acquires B. It releases I and then B. 

Each instance of T repeatedly executes this code sequence: It acquires G and then F It releases G It acquires A It releases F and then A 

a) How many instances of S does it take to create deadlock if there are no instances of T? 

b) How many instances of T does it take to create deadlock if there are no instance of S?

c) There are instances of S and of T. How many instances of S and how many instances of T does it take to create deadlock? Note: In some cases, no deadlock is possible no matter how many instances/threads there are. 

cs & ns

(4Q’s, NO PLAGIARISM, by Saturday(10/10) 

1/4 –  A digital forensics professional must know basic IT skills, understand computer architecture and networking, and have analytical and investigative skills, as well as strong attention to detail. Why do think all of these skills are necessary? Please explain. (Min 250 words)

2/4 –  Law enforcement professionals and investigators use digital forensic methods to solve crimes every day. Locate one current news article that explains how investigators may have used these techniques to solve a crime. Explain the crime that was solved and the methods used to determine how the crime was committed. Some examples of crimes solved may include locating missing children, finding criminals who have fled the scene of a crime, or unsolved crimes from the past that have been solved due to the use of new techniques (such as DNA testing).

Your written assignment should be 3-4 paragraphs in your own words and should include a reference citation for your source of information. (Min 250 words)

3/4 – Essay on Packet Sniffing and Wireshark (Min 250 words)

4/4 –  In this module, you learned that random numbers (or, at least, pseudorandom numbers) are essential in cryptography, but it is extremely difficult even for powerful hardware and software to generate them. Go online and conduct research on random number generators. What are the different uses of these tools besides cryptography? How do they work? Explain your answer using your own words in 2-3 paragraphs. (Min 250 words)

PL W2

 

Answer each these questions in a paragraph with at least 2-3 lines. Provide a citation for each answer.

1. What kind of speech was the First Amendment written to protect?

2. Does the First Amendment apply only to spoken words?

3. What does it mean that laws regulating speech must be content neutral?

4. Why are common carriers prohibited from controlling the content of the material they carry? 

5. How does the Supreme Court determine whether material is obscene?

6. Why have attempts to censor the Internet failed in the US?

7. Why not just ban spam? 

8. Why did Facebook ban Alex Jones and Louis Farrakan?

9. Should websites that show how to 3d print guns be banned? 

10. According to the Supreme Court ‘anonymity is a shield from the tyranny of the majority’. What does that mean?