Computer Science

 Describe a search strategy for the image you created that would find documents with the date “2020” on the device 

Array, Vectors, and Linked list discussion response

Please respond to the following discussion response with a minimum of 200 words and use a reference. 

 

ArrayList:

Characteristics:

  • ArrayList is used to store components and remove components at any  time because it is flexible to add and remove the components.  
  • ArrayList is similar to arrays but the arrays were deterministic and ArrayList was non-deterministic.
  • ArrayList allows adding duplicate components.
  • ArrayList maintains the order of components in the order of insertion.

The following statement shows how to initialize the ArrayList.

ArrayList list=new ArrayList();

The above list object is used to add different types of components into ArrayList.

ArrayList list=new ArrayList();

The above list object is used to add only the String type component  into the ArrayList. If someone tries to add other types of components  then it provides a compile-time error.

The following statement shows how to add components into ArrayList.

list.add("Cat");
list.add("Dog");
list.add("Cow");
list.add("Horse");

add() is the method used to add components into the ArrayList. Here  the String type is specified so the parameters are enclosed with the  double-quotes. Instead of String Integer type is provided then the  number is passed as a parameter without double-quotes.

The following statement shows how to update components in ArrayList.

list.set(1,"Goat");

Now the component at index 1 is set as Goat instead of Dog. In the  set() method the first parameter specifies the index value and the  second parameter specifies the updated component.

The following statements show how to get all the components that were stored in the ArrayList.

for(String str: list)
{
System.out.println(str);
}

From the above statement, the for-each loop is used to iterate the ArrayList to get all the components in the ArrayList.

Iterator it=list.iterator();
while(it.hasNext())
{
System.out.println(it.next());
}

From the above statement, the Iterator interface is used to get the ArrayList components.

The following statement shows how to remove components from the ArrayList.

list.remove(0);

Now the component at index 0 is deleted from the ArrayList.

The following is the java code that implements the ArrayList.

import java.util.*;
public class ArrayListDataStructure
{
public static void main(String[] args)
{
ArrayList list=new ArrayList();
list.add("Cat");
list.add("Parrot");
list.add("Horse");
list.add("Cow");
list.add("Dog");
System.out.println("ArrayList Components");
for(String str:list)
{
System.out.println(str);
}
list.set(2, "Golden Fish");
System.out.println("nArrayList Components after update");
for(String st:list)
{
System.out.println(st);
}
System.out.println("Size of ArrayList:"+list.size());
list.remove(3);
System.out.println("nArrayList Components after Delete");
for(String str:list)
{
System.out.println(str);
}
System.out.println("Size of ArrayList:"+list.size());
list.add("Love Birds");
Collections.sort(list);
System.out.println("nArrayList Components after Sorting");
for(String str:list)
{
System.out.println(str);
}
}
}

LinkedList:

  • Characteristics of LinkedList are the same as ArrayList like  allowing duplicate components, components stored in the order of  insertion, and non synchronized.
  • The difference is that manipulation is fast in LinkedList as  compared to ArrayList because the ArrayList needs more shifting to  remove a component but the LinkedList does not need shifting.

The following statement shows how to initialize the LinkedList.

LinkedList ll=new LinkedList();

The following statement shows how to add components into LinkedList.

ll.add("James");
ll.add("Daniel");
ll.addFirst("Hepson");
ll.addLast("Shibi");

The following statement shows how to update components in LinkedList.

ll.set(2,"Anisha");

The following statements show how to get all the components that were stored in the LinkedList.

for(String st:ll)
{
System.out.println(st);
}

The following statement shows how to remove components from LinkedList.

ll.remove(3);

The following is the java code that implements LinkedList.

import java.util.Collections;
import java.util.LinkedList;
public class LinkedListDataStructure
{
public static void main(String[] args)
{
LinkedList ll=new LinkedList();
ll.add("Dhanya");
ll.add("Daniel");
ll.add("Xavier");
ll.addFirst("Hepson");
ll.addLast("Shibi");
System.out.println("LinkedList Components");
for(String st:ll)
{
System.out.println(st);
}
ll.set(2,"Anisha");
System.out.println("nLinkedList Components after update");
for(String st:ll)
{
System.out.println(st);
}
System.out.println("Size of LinkedList:"+ll.size());
ll.remove(3);
System.out.println("nLinkedList Components after Delete");
for(String st:ll)
{
System.out.println(st);
}
System.out.println("Size of LinkedList:"+ll.size());
Collections.sort(ll);
System.out.println("nLinkedList Components after Sorting");
for(String st:ll)
{
System.out.println(st);
}
}
}

Vector:

  • Vector is also a dynamic array so there is no size limit.
  • Vector class implements List interface so all the methods in List interface can be used in Vector.
  • Vector is synchronized so it is better to use vector in thread-safe implementation.

The following statement shows how to initialize a Vector class.

Vector vec=new Vector();

The following statement shows how to add components to a Vector.

v.addElement("Cake");
v.addElement("Biscuit");
v.addElement("IceCream");
v.addElement("Chocolate");

The following statement shows how to update components in Vector.

v.set(1,"Drinks");

The following statement shows how to remove components from the Vector.

v.remove(3);

The following is the java code that implements Vector.

import java.util.Collections;
import java.util.Vector;
public class VectorDataStructure
{
public static void main(String[] args)
{
Vector v =new Vector();
v.addElement("Cake");
v.addElement("Biscuit");
v.addElement("IceCream");
v.addElement("Chocolate");
System.out.println("Vector Components");
for(String st:v)
{
System.out.println(st);
}
v.set(1,"Drinks");
System.out.println("nVector Components after update");
for(String st:v)
{
System.out.println(st);
}
System.out.println("Size of Vector:"+v.size());
v.remove(3);
System.out.println("nVector Components after Delete");
for(String st:v)
{
System.out.println(st);
}
System.out.println("Size of Vector:"+v.size());
v.add("Biscuit");
Collections.sort(v);
System.out.println("nVector Components after Sorting");
for(String st:v)
{
System.out.println(st);
}
}
}

ArrayList:

The ArrayList is a resizable array that can be used to store  different types of components at any time. In ArrayList components can  be added anywhere by specifying the index.

The following is the description of the code

  • Initialize an ArrayList class.
  • Use add() method to add components into the ArrayList class.
  • For-each loop is used to print the components.
  • Use the set() method to update the component.
  • Use the remove() method to delete the component.
  • Use size() to get the current size of the ArrayList.
  • Use the sort() method in Collections to sort the components in the ArrayList.

LinkedList:

LinkedList class is used to implement the Linked List linear data  structure. The components are not stored in the neighboring address and  it is stored as containers.  

The following is the description of the code.

  • Initialize the LinkedList class.
  • Use add() method to add components into the LinkedList class.
  • For-each loop is used to print the components.
  • Use the set() method to update the component.
  • Use the remove() method to delete the component.
  • Use size() to get the current size of the LinkedList.
  • Use the sort() method in Collections to sort the components in the LinkedList.

Snip of the Output:

Vector:

Vector is the growable array. Vector is synchronized so it has legacy  methods. Iterators can not be returned by the vector class because if  any concurrent changes occur then it throws the  ConcurrentModificationException.

The following is the description of the code

  • Initialize the Vector class.
  • Use and elements() method to add components into the Vector class.
  • For-each loop is used to print the components.
  • Use the set() method to update the component.
  • Use the remove() method to delete the component.
  • Use size() to get the current size of the Vector.
  • Use the sort() method in Collections to sort the components in the Vector.

Alternative Sites and Disaster Recovery

Compare hot sites and mobile sites.

Task Requirements

Many organizations plan for disasters by arranging for an alternative site in which the organization can

continue operations if the main location is unable to function. These alternate locations can be in different

buildings, different cities, or even different states, which depend on the type of disaster being prepared

for.

A hot site includes all the equipment and data necessary to take over business functions. A mobile site

can be set up in an outside space close to an impacted site.

Answer the following question(s):

1. In what type of situation would you choose a hot site rather than a mobile site? Explain your

answer.

2. In what type of situation would you choose a mobile site rather than a hot site? Explain your

answer.

Fully address the questions in this discussion; provide valid rationale for your choices.

Required Resources

§ Course textbook

§ Internet access

Submission Requirements

§ Format: Microsoft Word (or compatible)

§ Font: Arial, size 12, double-space

§ Citation Style: Follow your school’s preferred style guide

§ Length: 1/2–1 page

IT345 Week 9 A

Week 9 Discussion –

2222 unread replies.2222 replies.

Welcome to Week 9

To conclude this course, we cover professional ethics as it relates to technology. Additionally, we specifically address ethics as it relates to computer professional. This is due to the amount of private, sensitive, and proprietary information they have access to.

Pick a scenario below and post your reply by Wednesday at midnight. Your response should be at least 300 words and appropriately cites your resources.

Respond to two of your classmates by Sunday at midnight. Your responses should be at least 150 words and should be substantive. You should offer additional resources, insight, or other helpful feedback. A simple “I like your post” will result in a 0.

You will not be able to see your classmates’ posts until you make your first post.

  • Scenario 1
    • Your company is developing a free email service that will include targeted advertising based on the content of the email messages (similar to Google’s Gmail). You are part of the team designing the system. What are your ethical responsibilities?
  • Scenario 2
    • As part of your responsibilities, you oversee the installation of software packages for large orders. A recent order of laptops for a local school district requires webcam software to be loaded. You know that this software allows for remote activation of the webcam. What are your ethical responsibilities? What would you do?
  • Scenario 3
    • Three MIT students planned to present a paper at a security conference describing security vulnerabilities in Boston’s transit fare system. At the request of the transit authority, a judge ordered the students to cancel the presentation and not to distribute their research. The students are debating whether they should circulate their paper on the Web. Imagine that you are one of the students. What would you do?

Discussion

We learn from our readings that the use of mobile devices in our society today has indeed become ubiquitous.  In addition, CTIA asserted that over 326 million mobile devices were in use within The United States as of December 2012 – an estimated growth of more than 100 percent penetration rate with users carrying more than one device with notable continues growth.  From this research, it’s evident that mobile computing has vastly accelerated in popularity over the last decade due to several factors noted by the authors in our chapter reading. In consideration with this revelation, identify and name these factors, and provide a brief discussion about them.

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 (for example, an article from the UC Library) 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.

At least one scholarly source should be used in the initial discussion thread. Be sure to use information from your readings and other sources from the UC Library. Use proper citations and references in your post.

Discussion 2:

This is a required assignment worth 50 points (50-points/1000-points). Assignment must be submitted by the due date. No late assignments are allowed. Please discuss the following topics and provide substantive comments to at least two other posts. 

Q1 – Describe how a cloud-based database management system differs from an on-site database.

Q2 – Define and describe load balancing. Discuss how you might use IaaS to implement load balancing.

Q3- Compare and contrast a cloud-based disk storage device (with a file system) with a cloud based database.

Q4 – Define SAML and describe its purpose.

operating system

is file deallocation important? Explain your answer and describe how long you believe your own system would perform adequately if this service were no longer available.  Discuss the consequences and any alternatives that users might have.

SQL

QUIZ 

Please review provided ERD for Sales in ****database

Only Assumptions :

Total order quantity is: sum(quantityOrdered ) as Qty,

TotalAmount is: sum(priceEach*quantityOrdered) as total

construct SQL statement joining all necessary tables, RUN it and choose correct result.

EXAMPLE of possible sql to find TotalAmount for officeCode = 1 :

select sum(od.priceEach * od.quantityOrdered) as total , of.officeCode

from yhelen.orders o join yhelen.orderdetails od on o.orderNumber = od.orderNumber 

join yhelen.products p on p.productCode = od.productCode join 

yhelen.customers c on c.customerNumber = o.customerNumber join

 yhelen.employees e on e.employeeNumber = c.salesRepEmployeeNumber join

 yhelen.offices of on of.officeCode = e.officeCode 

group by 2

Consider the following method

  

Consider the following method: 

public static int secret(int value) {

int prod = 1;

for(int i =1; i <= 3; i++) {

prod = prod * value;

}

return prod;

}

1.What is the output produced by the following Java statements: 

2.What does the method secret do?