Java HW help

 

Q1: Treasure Cave

Imagine you find a hidden cave filled with with N different types of metal bars
(gold, silver, platinum, steel, etc.) Each type of metal bar has some value
vi, and there are xi bars of that metal in the cave
(for i = 0, 1, 2, 3, … N-1). You want to bring back as many bars as of the
treasure as you can, but your bag can only fit W bars. How do you choose how
many bars of each metal to bring home to maximize the total value?

For example, if your bag can store 7 bars and you have gold, silver, platinum,
and steel in these quantities:

[4, 10, 2, 4] // 4 bars of gold, 10 silver, 2 platinum, 4 steel

and these values

[3, 1, 5, 2]  // gold worth 3 per bar, silver worth 1, platinum 5, steel 2

Then you would want to take this much of each metal

[4, 0, 2, 1]  // all the gold, no silver, all the platinum, 1 steel bar

             // for a total value of 24 (4*3 + 2*5 + 1*2)

Write bestValue() which takes in an integer W, an array of counts, and an
array of values. It should return the best value you can earn by picking the
bars optimally. Your code should run in O(nlogn).

  • Hint #1: This can be done using a Greedy approach.
  • Hint #2: Consider sorting with a custom Comparator

 

Q2. Treasure Cave with Fused Bars–Value

Now assume that for each type of metal, all of the bars are fused together so
that you’re forced to all the bars of a certain type, or none of them.

This means that you sometimes should not take the metal that has the highest
value, because it either will not fit all in your bag (since you have to take
all the bars), or other metals of lesser will be worth more overall value when
combined together.

Write bestValueForFused, which takes in the arguments from above, and returns
the value of the best picks possible.

bestValueForFused(4, [], []) // 0 (the cave is empty)

bestValueForFused(4, [4, 10, 2], [3, 1, 5]) // 12 (take metal 0, even though metal 2 is worth more per bar)

bestValueForFused(4, [4, 2, 2], [3, 2, 5]) // 14 (take metal 1 and metal 2)

bestValueForFused(6, [4, 2, 1], [3, 3, 5]) // 18 (take metal 0 and metal 1)
  • Hint #1: Greedy won’t work here.
  • Hint #2: Start by computing the total value of each metal (i.e. the number
    of bars * value per bar).
  • Hint #3: For each metal, you can either take it or not. If you take it, your
    bag capacity decreases by the corresponding amount. How could you translate this
    idea into a recursive subproblem?

Q3. Treasure Cave with Fused Bars–Picks

This question is optional and worth extra credit.
Write bestPicksForFused(), which solves Q2 but returns an array of bools, where
each element in the array describes whether we picked metal i.

bestPicksForFused(4, [], []) // []

bestValueForFused(4, [4, 10, 2], [3, 1, 5]) // [true, false, false]

bestValueForFused(4, [4, 2, 2], [3, 2, 5]) // [false, true, true]

bestValueForFused(6, [4, 2, 1], [3, 3, 5]) // [true, true, false]

DRIVER CODE :::

 

public class HW7 {

public static void main(String[] args) {
// Q1
   System.out.println(bestValue(7, new int[] {}, new int[] {})); // 0
   System.out.println(bestValue(7, new int[] { 4 }, new int[] { 1 })); // 4
   System.out.println(bestValue(7, new int[] { 4, 10, 2, 4 }, new int[] { 3, 1, 5, 2 })); // 24 [5,3,2,1] //24
   System.out.println(bestValue(7, new int[] { 4, 10, 2, 4 }, new int[] { 3, 3, 5, 2 })); // 25
   System.out.println(bestValue(7, new int[] { 4, 10, 2, 4 }, new int[] { 3, 5, 5, 2 })); // 35

// Q2
   System.out.println(bestValueForFused(4, new int[] {}, new int[] {})); // 0
   System.out.println(bestValueForFused(4, new int[] { 4 }, new int[] { 1 })); // 4
   System.out.println(bestValueForFused(4, new int[] { 4, 10, 2 }, new int[] { 3, 1, 5 })); // 12
   System.out.println(bestValueForFused(4, new int[] { 4, 2, 2 }, new int[] { 3, 2, 5 })); // 14
   System.out.println(bestValueForFused(6, new int[] { 4, 2, 1 }, new int[] { 3, 3, 5 })); // 18
   System.out.println(bestValueForFused(6, new int[] { 4, 2, 1 }, new int[] { 3, 2, 9 })); // 21 (3*4+9*1)

// Q3
   System.out.println(Arrays.toString(bestPicksForFused(4, new int[] {}, new int[] {}))); // []    System.out.println(Arrays.toString(bestPicksForFused(4, new int[] { 4 }, new int[] { 1 }))); // [true]    System.out.println(Arrays.toString(bestPicksForFused(4, new int[] { 4, 10, 2 }, new int[] { 3, 1, 5 }))); // [true, false,false]    System.out.println(Arrays.toString(bestPicksForFused(4, new int[] { 4, 2, 2 }, new int[] { 3, 2, 5 }))); // [false, true, true]    System.out.println(Arrays.toString(bestPicksForFused(6, new int[] { 4, 2, 1 }, new int[] { 3, 3, 5 }))); // [true, true, false]    System.out.println(Arrays.toString(bestPicksForFused(6, new int[] { 4, 2, 1 }, new int[] { 3, 2, 9 }))); // [true,false,true]

}

public static int bestValue(int W, int[] counts, int values[]) {
return 0;
}

public static int bestValueForFused(int W, int[] counts, int values[]) {

}

private static int bestValueForFused(int W, int[] counts, int values[], int MetalIndex) {
}

public static boolean[] bestPicksForFused(int W, int[] counts, int values[]) {
return null;
}
}

 

import java.util.*;

public class MetalBar implements Comparable {

private int value;
private int count;

public MetalBar(int value, int count) {
this.value = value;
this.count = count;
}

public int getValue() {
return value;
}

public int getCount() {
return count;
}

public int compareTo(MetalBar otherBar) {
return Integer.compare(otherBar.value, value);
}

public String toString() {
return String.format(“MetalBar(%d, %d)”, value, count);
}

}

cloud computing

DDL  11/12

the first is 1-2 pages with pics

the second is 4-6 pages with pics

references more than 15

 Content: Proposed a [new] idea about cloud computing field, and designed experiments for verification 

Policy Development

 

There is a relationship between policy evaluation and production identification, policy evaluation and policy implement, and policy evaluation and policy formulation.  Can you explain this relationship and why they are important?

Please make your initial post and two response posts substantive. A substantive post will do at least two of the following:

  • Ask an interesting, thoughtful question pertaining to the topic
  • Answer a question (in detail) posted by another student or the instructor
  • Provide extensive additional information on the topic
  • Explain, define, or analyze the topic in detail
  • Share an applicable personal experience
  • Provide an outside source that applies to the topic, along with additional information about the topic or the source (please cite properly in APA)
  • Make an argument concerning the topic.

mad discussion

  

IT Governance and IT Risk Management Practices”

Vincent, N. E., Higgs, J. L., & Pinsker, R. E. (2017). IT Governance and the Maturity of IT Risk Management Practices. Journal of Information Systems, 31(1), 59–77. https://doi.org/10.2308/isys-51365

Etges, A. P. B. da S., Grenon, V., Lu, M., Cardoso, R. B., de Souza, J. S., Kliemann Neto, F. J., & Felix, E. A. (2018). Development of an enterprise risk inventory for healthcare. BMC Health Services Research, 18(1), N.PAG. https://doi.org/10.1186/s12913-018-3400-7

The article on IRB this week discusses broad consent under the revised Common Rule. When you are doing any sort of research you are going to need to have your research plan approved by the University’s institutional review board or IRB. If you have never heard of this term before, please take a look online and find a brief summary of what it is about, before you read the article.  

Please answer the following questions in your main post:

  • What are the main issues that the article addresses?
  • What is the Common Rule?
  • How is this issue related to information systems and digital privacy?

Denial of Service attack

  • Define a denial-of-service attack in your own words.
  • Explain how this type of attack can adversely impact infrastructure.
  • Explain methods organizations can implement to prevent DoS attacks from occurring.
    1000 words 

CSCI 457 Assignment 4 – Address book

 Please develop an app to show the list of all branches of an organization. The branches should be located at different places. You can choose whatever organization you like, and it can be either realistic or fictional. For example, Walmart stores, KFC restaurants, Global Defense Initiative (fictional) bases, etc. Requirements: • The list of the branches should be displayed in a table. • The cells in the table must have a colorful background. You may use any color except black, white, and gray. • Each cell of the table should contain a thumbnail of that branch, with its name and city. • When the user taps on a cell, a new view will pop up, showing the location of the branch on the map. • The pin on the map should contain a thumbnail of the branch, with its address. • On the top-right corner of the map, there should be a button. When the user taps the button, the map should be closed, and the program shall return to the table of the branches. (Hint: Use unwind in Lecture 12.) • When you submit this assignment, please compress the entire project folder into a single zip file and upload it to the submission link. You can find more hints in Lectures 10, 11, 12, and 13. 

ERD vaariables

 

There is a use case associated with  the assignment. You need to incorporate ALL requirements into the ERD,  not just some components into the ERD Diagram. There are various  examples that I have provided throughout the semester. I have pointed to  another one so you know what I am explicitly expecting to see. 

About the ERD Diagram

Deliverables

  • An ERD Diagram (PDF File ONLY)
  • A Word / PDF Document that  describes exactly what is in your ERD. This helps me make sure you know  what you modeled! Also, on that document, please tell me who did what  for the assignment. 
  • Please provide me example screen  shots to a working prototype of your database and/or access to the  database. Make the dataset realistic, not scrap data. I will need to  have access to the database if that is your preferred option until  December 11, 2020 at 11:59pm EST unless I ask otherwise. 

Cloud Computing in Education – Paper – 13 hrs

The topic of the paper is “Cloud Computing in Education”. Paper should consist of following sections and I have listed the section by resources to.

1. Abstract (1/2 page)

2. Introduction ( 1/2 page)

3. (2 pages)

a. Cloud Computing in Higher Education

b. The Challenges of Cloud Computing in Higher Education

– https://www.librarystudentjournal.org/index-php/lsj/article/view/289/321/#need?CSRF_TOKEN=1451c54f7aa59da7d6999c2281cefc17892a7939

4. Proposed Architecture for HE institutes (3 page)

– section 7 in paper- https://www.sciencedirect.com/science/article/pii/S221256711400224X

5. Advantages of using e-learning in the cloud (1/2 page)

– section 4 in paper- https://www.orizonturi.ucdc.ro/arhiva/2014_khe_6_pdf/khe_vol_6_iss_2_100to103.pdf

6. Conclusion (1/2 page)

Abstract, introduction and conclusion can be grabbed from below links(latest paper is the preference)

https://d1wqtxts1xzle7.cloudfront.net/44685282/IJIRSTV2I10084.pdf?1460530711=&response-content-disposition=inline%3B+filename%3DCloud_Computing_in_Education_Sector.pdf&Expires=1602376924&Signature=Bt2TMamjaN5OrthY7dGqyvrJ4LQ3CgctpRpaZTN~n6PA-dtKcjGjU5Mt3SeKQGTHW-t3IvWgomad29U9ZNWKWJKAAl68XvJtOloYi6VlhAQqttNrb52YNLr-yRPiR7kf5JFBtr1pMJk5KIdrXqMq08~iUGCpK0tjFrIJV~2t-cVjoDwQ12O44Y8ii8~HOB1QJ6zTZRcIHbhzlxFzrPSlJplCgssG0NF7FYIjbB5wnLABeo4ldCrbzyVhmg0YPQ9FzTrYpC0~DuMmSAg5AUM3dyfBOPcHRNexKROg7bZDPR5-FXlBrL5hv1vS~rvzOiQ58cptnRMV4NT4JVrylcJuYA__&Key-Pair-Id=APKAJLOHF5GGSLRBV4ZA

https://link.springer.com/chapter/10.1007/978-1-4614-3329-3_2

http://www.ijcte.org/papers/511-G1346.pdf

Discussion 8 – info tech strat plan

In the last week of class, we are going to complete a reflection activity.

This discussion topic is to be reflective and will be using your own words (500 words)and not a compilation of direct citations from other papers or sources. You can use citations in your posts, but this discussion exercise should be about what you have learned through your viewpoint and not a re-hash of any particular article, topic, or the book.

Items to include in the initial thread: 

  • “Interesting Assignments” – What were some of the more interesting assignments to you? 
  • “Interesting Readings” – What reading or readings did you find the most interesting and why? “Interesting Readings”
  • “Perspective” – How has this course changed your perspective? 
  • “Course Feedback” – What topics or activities would you add to the course, or should we focus on some areas more than others?