Questions
Sorry now I want this question to be answered Write a group of template functions for...

Sorry now I want this question to be answered

Write a group of template functions for
examining and manipulating a collection of
items via the collection’s forward iterator.
For example, one of the functions might have
this prototype:
template <class Iterator, class T>
Iterator find(
Iterator begin,
Iterator end,
const T& target
);
The find function searches the range starting at
*begin and going up to (but not including) *end. If
one of these elements is equal to the target, then the
iterator for that element is returned; if the target is
never found in the range, then the end iterator is
returned.

Discuss and design other functions for your tool-
kit that manipulates a collection. As a starting point,

please use the linked-list toolkit from the previous
chapter.

In: Computer Science

Describe the wireless solution you would recommend for EACH of the following three organizations, and give...

Describe the wireless solution

you would recommend for EACH of the following three organizations, and

give the rationale

for your decision using at least

three criteria

for that choice. There could be a combination

of these options for an individual organization.

1.

General Hospital

– GH has five floors, each about 30,000 square feet in size for a total of 150,000

square feet. They want to provide a wireless overlay network in addition to their 100Mb switched

wired network. They have a bid for 802.11g access points at a cost of $100 each and a bid for

802.11n access points for $300 each. They expect to need 200 NICs. 802.11b NICs came built into

their laptop and desktops. 802.11n NICs cost about $100 each.

What would you recommend and

WHY?

2.

Central University

– CU wants to add a wireless overlay network to one 20,000 square foot floor

in its business school building. They have a bid for 802.11g access points at a cost of $100 each

and a bid for 802.11n access points for $300 each. Students will buy their own computers, most

of which will come with 802.11n NICs.

What would you recommend, and WHY?

3.

Ubiquitous Offices

UO provides temporary office space in cities around the country. They have

a standard office layout that is a single floor with outside dimensions of 150 feet wide by 150 feet

long. The interior is drywall offices. They have a switched 100Mb

wired LAN but want to add

WLAN as well.

Data rates have been shown to slow dramatically when the distance from a laptop

to the wireless access point (radius of circle) exceeds 25 feet

.

a.

How many access points would you recommend and where would they be placed?

b.

Draw the office and show where the access points would be located.

c.

Show coverage for each access point with a circle, and label the channels (1, 6,

In: Computer Science

What is the maximum Ethernet II frame size? This value is calculated by combining the byte...

  1. What is the maximum Ethernet II frame size? This value is calculated by combining the byte values of _______ for the header, _______ for any data, and ____ for the FCS.

  1. A value of 0x0001 in an ARP packet’s Operation field indicates the packet is an ___Ethernet __? This field size is _____ bytes.

  1. A value of 6 in an ARP packet’s Hardware Size field tells you:

That Mac addresses are being used as the hardware type and the size of this address is 6 bytes in length.

  1. What is the maximum ARP packet size? How is this value derived (be specific)?

  1. For an ARP request, all the fields of the ARP packet are filled in except the target hardware address. Why?

  1. The following is an example of an ARP _______.

IP Address               MAC Address          Type

123.45.67.80             60:23:a6:f1:c4           Static

123.45.67.89             60:23:a6:21:e0          Dynamic

123.45.67.99             60:23:a6:c2:25          Dynamic

  1. The Address Resolution Protocol is defined in RFC _______, as of what month and year?

  1. The special Ethernet destination address of all one bits means the broadcast address for the local network. This value in hexadecimal is _______?

  1. What happens to a frame if the calculated checksum does not match the checksum on the frame?

  1. Explain the general aim of an ARP cache poisoning attack?

In: Computer Science

In an online banking application, the customer may transfer fund between the saving account and the...

In an online banking application, the customer may transfer fund between the saving account and the checking account.

  1. Explain what data integrity means in this context.
  2. Explain what origin integrity means in this context.
  3. Explain what availability means in this context.
  4. Explain what confidentiality means in this context.
  5. Explain what non-repudiability means in this context.

In: Computer Science

In reference to network access control, describe some of the access control mechanism used by a...

In reference to network access control, describe some of the access control mechanism used by a network administrator to filter, inspect and detect different forms of traffic.

In: Computer Science

Python3 Write a program to implement the Pokemon game should ask the user to enter their...

Python3

Write a program to implement the Pokemon game should ask the user to enter their type and compare it with a randomly chosen computer type and correctly display who wins/ties.

In: Computer Science

JAVA- List, Stacks, Queues, Sets, And Maps Question 1 Given that you want to be able...

JAVA- List, Stacks, Queues, Sets, And Maps

Question 1

Given that you want to be able to return the items that come immediately before and after a given node. Which variation of a list would be best suited?

1. Circular single-linked list

2. All options are equally good

3. Double linked list

4. Single linked list with header and trailer nodes

5. Single-linked list

Question 2
One of the statements is correct for stacks and queues

1. Both data structures must be implemented using an array

2. Both data structures must be implemented using a linked list

3. Both data structures must have a counter that holds the number of items used

4. Basic operations push, pop, enqueue and dequeue take constant time

Question 3

Assume List list = new ArrayList (). Which mappings below are correct? ( Several options possible)

1. list.add("Red");

2. list.add(new java.util.Date());

3. list.add(new E); // E is a generic type

4. list.add(new ArrayList());

5. list.add(new Integer(100));

Question 4

What is the Comparator interface used for? (Several options possible)

1. To compare objects differently than the compareTo method for them to work.

2. To sort items that have not implemented Comparable interface.

3. To separate the logic of the objects from the rest of the code so that it is easier to operate the code testing.

4. To increase the speed of sorting elements that implement the Comparable interface.

Question 5

What is the difference between Lists, Sets, and Maps? (Several options possible)

1. List allows duplicates, while Sets only allows unique elements. Maps allow duplicate values, but keys for them must be unique.

2. Lists allow multiple elements in it to be null objects, Maps allow multiple null values, but only one null key, while Sets allow only one null value in it.

3. Usually, Lists are sorted, while Sets are unsorted.

4. Lists have no limit on the number of items they can contain, while Sets and Maps can only hold up to 1 million items.

Question 6

When to Use List

1. Want to store items and an identifier for the items

2. Want to access items using index

3. Want to keep track of the items

4. Want only unique values

Question 7

When to use Map

1. Want to store items and an identifier for the items

2. Want to access items using index

3. Want to keep track of the items

4. Want only unique values

Question 8

When to use Set

1. Want to store items and an identifier for the items

2. Want to access items using index

3. Want to keep track of the items

4. Want only unique values

Question 9

Suppose arrayList is an ArrayList and linkedList is a LinkedList. Both contain one million items. Analyze the following code:
A:
for (int i = 0; i < arrayList.size(); i++)
    sum += arrayList.get(i);

B:
for (int i = 0; i < linkedList.size(); i++)
    sum += linkedList.get(i);

1. Code fragment A runs faster than code fragment B

2. The code snippets run just as fast

3. Code fragment B will fail since LinkedList does not have method get (int)

4. Code fragment B runs faster than code fragment A

Question 10

Which data type should you use if you allow duplicate storage and you should be able to insert items anywhere without using a lot of resources?

1. ArrayList

2. AVL three

3. LinkedList

4. Stack

5. Set

Question 11

What type of container would be best suited for creating a dictionary program?

1. LinkedList

2. Map

3. Stack

4. Set

5. ArrayList

Question 12

Link names of operations with function they have in an ArrayDeque

Poll

1. insert the item at the end of ArrayDeque

2. Returns the first element of ArrayDeque

3. Returns and removes first element of ArrayDeque

Question 13

Link names of operations with function they have in an ArrayDeque

Offer

1. insert the item at the end of ArrayDeque

2. Returns the first element of ArrayDeque

3. Returns and removes first element of ArrayDeque

Question 14

Link names of operations with function they have in an ArrayDeque

Peek

1. insert the item at the end of ArrayDeque

2. Returns the first element of ArrayDeque

3. Returns and removes first element of ArrayDeque

In: Computer Science

language is c++ I need to take a num and put it into an array one...

language is c++

I need to take a num and put it into an array one number at a time suck that the hundredths place is at 10^3, tens is 10^2 and so on

For milestone 1 you need to build a constructor that converts a int to a bigInt

You need to peel off each digit from the int and place it into the appropriate location in the array of int. To do this you need to use integer division and mod.

bigint(int)
int digit, 
    num = 128;
digit = num % 10;  // num mod 10 is 8 in this case.
num = num / 10;    // num div 10 is 12.
digit = num % 10;  // digit is now 2
num = num /10;     // num is now 1
digit = num % 10;  // digit is now 1
num = num /10;     // num is now 0

So you can build a loop that goes until num == 0 and peel off each digit, putting them in the array.

In: Computer Science

Prove a language {wwR0m where wR is the reverse of w and w has m 0’s...

Prove a language {wwR0m where wR is the reverse of w and w has m 0’s } is not context-free using the pumping lemma.

In: Computer Science

ADT SORTED LIST Fill in the missing code in the following code segment.          void SortedType::PutItem(ItemType...

ADT SORTED LIST

Fill in the missing code in the following code segment.

        

void SortedType::PutItem(ItemType newItem)

{

            NodePtr newNode;                 // pointer to node being inserted

            NodePtr predLoc;                    // trailing pointer

            NodePtr location;                    // traveling pointer

            boolean moreToSearch;

            location = listData;

            predLoc = NULL;

            moreToSearch = (location != NULL);

            length++;

           

// Find insertion point

           

// Prepare node for insertion

           

// Insert node into list

}

In: Computer Science

Please use the Scheme programming language with Dr. Racket to solve a and b below. (Use...

Please use the Scheme programming language with Dr. Racket to solve a and b below. (Use Scheme and not Python)

Write before–in–list?, which takes a list and two elements of the list. It should return #t if the second argument appears in the list argument before the third argument:

> (before–in–list? '(back in the ussr) 'in 'ussr)
#T
> (before–in–list? '(back in the ussr) 'the 'back)
#F

The procedure should also return #f if either of the supposed elements doesn't appear at all.

In: Computer Science

C++ language There are 100 integers in the inputfile.txt. Read each integer in the inputfile.txt and...

C++ language

There are 100 integers in the inputfile.txt. Read each integer in the inputfile.txt and store each one in the array named myArray. After that, complete the code in the function printArray(...) to output the elements in the array with the following format:

  • - Each output line should consist of 10 integers

  • - Each integer should be separated by | The output should be exactly as shown

  • Array contains the following elements 12 | 32 | 34 | 56 | 78 | 21 | 14 | 19 | 92 | 14 | 67 | 83 | 95 | 70 | 24 | 29 | 58 | 34 | 69 | 32 | 42 | 73 | 24 | 26 | 32 | 90 | 32 | 37 | 19 | 77 | 26 | 62 | 31 | 84 | 51 | 54 | 19 | 33 | 59 | 31 | 86 | 54 | 93 | 46 | 52 | 44 | 79 | 69 | 42 | 64 | 14 | 34 | 15 | 89 | 34 | 76 | 10 | 44 | 53 | 81 | 16 | 83 | 85 | 77 | 56 | 10 | 43 | 11 | 88 | 15 | 67 | 94 | 61 | 26 | 95 | 41 | 28 | 91 | 31 | 94 | 29 | 77 | 32 | 58 | 32 | 35 | 72 | 69 | 75 | 56 | 12 | 99 | 59 | 71 | 90 | 47 | 70 | 71 | 16 | 64 |

then find the minimum and the maximum elements in the array

Complete the code to find the min and max values of all the integers in myArray. The output should look exactly as shown:

The min value of the elements in the array is : 10
The max value of the elements in the array is : 99

In: Computer Science

A local client needs to take his static web page for ordering organic vegetables and build...

A local client needs to take his static web page for ordering organic vegetables and build a dynamic page. He doesn't have much money to spend, so we are going to write orders to a flat file. He is also going to need a page that he can go to that will display his orders.

He has already met with Sharron, so we've got a specification already assembled. Here are the details:

The customer will go to a form page where they can enter an order for vegetables. The file will be called orderVegetables.php. Here are products a customer can order:

  • 5 lb Potatoes, $6.00 each
  • 3 lb Carrots, $3.75 each
  • 1 Cauliflower, $4.00 each

The customer should be able choose a quantity of items beside any of the vegetable options. Only allow orders where there is at least one thing ordered. Also, if the total price is over $50 then they qualify for free delivery, otherwise delivery cost is $5.00. (You can apply the delivery fee after tax, or before). Be sure to also capture the customers name, email and phone number on the form so the client can contact them to setup delivery. Make sure each order has the date and time of the order as well. Don't forget to use \r\n for a new line at the end of each record.

When the user clicks 'submit,' a POST request is made to processVeggies.php where the order is written to the file veggie-orders.txt. The text file should be simply a storage place in lieu of using a proper database. Some would call it a 'flat-file' storage system. Make sure to lock the file before appending, and to unlock it afterwards. Display a thank you message to the client and print their order details to the screen. Let them know that they will be contacted within the next business day.

Of course the client would like a page to view all the orders. This file will be called viewOrders.php. The client would like a link on this page to reset the orders (reset the veggie-orders.txt file) called Reset Orders. This link will call a file resetOrders.php. The client will typically print off a days worth of orders and then reset the form for the next day. Don't worry about locking the file on your reset page.

Good luck! We need this prototype soon!

- Ima Plant

Senior Consultant,
Acme International Inc.

====

The order form also needs to capture customer name, phone number, and email.

What to expects

1. The input page (named orderVegetables.php) needs to have the following fields:

a. Select drop-down fields should be used to allow users to choose a quantity for each item. Limit the options to 0-30.

b.We also need fields for name, email, and phone number.

2. Look and Feel: Use bootstrap or not, your choice. The header of each page should contain a masthead/header image that would befit an upscale veggie shop. Please use GIMP, MS PAINT or some other editor to create this header image for the top of your page. Or better yet, set your header text using <h1> or <h2> and set the image you create as a background-image in your CSS. As well, all formatting should be done using CSS in an external stylesheet. Please use a div with an id of 'container' to hold your content. Ensure that this simple theme is present for ALL of your pages!

3. The processing page (named processVeggies.php) needs to include the following:

a. Order details gathered from input form.

b. Whether or not delivery is free - display a message to the user one way or the other (include dollar sign and two decimal places - that is, format for currency)

c. Assume a provincial tax rate of 15%

d. Calculate and display the details of their order, net amount before tax, tax amount, delivery amount, and total amount.

e. Include the time, date, and year (for Atlantic Canada) that the order was processed.

f. Ensure that there is some type of validation on the processing page. If someone tried to run it without accessing the form page first, it should give the user a link back to the order page.

4. The processing page (processVeggies.php) should also write this order to a file.

a .Ensure file is accessible to your script, but hidden from public browsing. Please note that veggie-orders.txt MUST be stored one directory behind your publishing directory. "$DOCUMENT_ROOT/../veggie-orders.txt" would be an example.

b. Orders file should be delimited by a "\t" or some other delimiter. " \r\n" at the end of each line.

5. The viewOrders.php page should open the file for reading only and display, in html, all of the pending orders for the day. The look and feel of this page should follow the store's theme. Though this page would be used only by administrators of the site, we will not lock it down. For now, assume it will be live for all to view. Please create a table to hold all of the pending orders. Each line of the order file could be a table row. You can keep this simple, no need to use explode() or list() if you don't want to. As well on this page, create a hyperlink to resetOrders.php (see below). If there are no pending orders, ensure there is a message to the user stating the fact.

6. Create another page called resetOrders.php. This page should reset the orders file (delete the file contents), give the user confirmation that the file has been cleared and give them a link/instructions on what to do next.

7. All pages should be accessible via links. So there should be some sort of menu.  I DON'T need a link to process orders as that would be silly. Remember menus should go at the top of your pages.

8.Comments, Code Formatting, Submission Packaging (variable naming, page naming).

In: Computer Science

I need to translate my java code into C code. import java.util.Scanner; class CS_Lab3 { public...

I need to translate my java code into C code.


import java.util.Scanner;
class CS_Lab3 {

public static void main( String args[] ) {

Scanner input = new Scanner( System.in );
// create array to hold user input
int nums[] = new int[10];
int i = 0, truthCount = 0;
char result = 'F', result2 = 'F';

// ask user to enter integers
System.out.print("Please Enter 10 Different integers: ");

// gather input into array
for ( i = 0; i < nums.length; i++ )

nums[i] = input.nextInt();
  
/**********************************
Now I have the input. Remember that for all x P(x)
is equivalent to P(x1) ^ P(x2) ^ ... ^ P(xn)
and there exists an x P(x) is equivalent to P(x1) v P(x2) v ...
v P(xn).
***********************************/

// Here you check the variables against the given statement
// statement 1: For all x ((x < 0) --> x is even)
for ( i = 0; i < nums.length; i++ ) {

// pass values into lessThanZero method
if ( (lessThanZero( nums[i] )) == 'T' )
truthCount += 1;
  
} // end for

/*******************
you want to have truth count == 10 to show that all
values are true.
********************/
if ( truthCount == 10 )
System.out.println( "a) is True" );
  
else
System.out.println( "a) is False" );
  
truthCount = 0;
  
// start of checking nums against statement b
for ( i = 0; i < nums.length; i++ ) {

if ( (lessThanZero(nums[i])) == 'T' )
truthCount += 1;

} // end for

/**********************
You want truthCount > 0 to have a valid statement
***********************/
if ( truthCount > 0 )
System.out.println( "b) is True" );
  
else
System.out.println( "b) is False" );
  
truthCount = 0;

// start of checking nums against statement c
for ( i = 0; i < nums.length; i++ ) {

/*********
Here you want to check if the num[i] < 0 and num[i] / 2 == 0
so you want a method that will check to see if a number is even
**********/
if ( and( lessThanZero(nums[i]), isEven(nums[i]) ) == 'T' )
truthCount += 1;
  
} // end for

if ( truthCount > 0 )
System.out.println( "c) is True" );
  
else
System.out.println( "c) is False" );
  
truthCount = 0;

// start of checking nums against statement d
for ( i = 0; i < nums.length; i++ ) {

if ( or( divByThree(nums[i] - 1), divByTwo(nums[i] - 1) ) == 'T' )
truthCount += 1;

} // end for

if ( truthCount == 10 )
System.out.println( "d) is True" );
  
else
System.out.println( "d) is False" );

} // end main

public static char lessThanZero( int in_int ) {

char output;

if ( in_int < 0 )
output = 'T';
  
else
output = 'F';
  
return output;

} // end lessThanZero

public static char isEven( int in_int ) {

char output;

if ( in_int / 2 == 0 )
output = 'T';
  
else
output = 'F';
  
return output;

} // end isEven

public static char divByThree( int in_int ) {

char output;

if ( in_int % 3 == 0 )
output = 'T';
  
else
output = 'F';
  
return output;

} // end divByThree

public static char divByTwo( int in_int ) {

char output;

if ( in_int % 2 == 0 )
output = 'T';
  
else
output = 'F';
  
return output;

} // end divByTwo

public static char and ( char a, char b ) {

char andResult;

if ( a == 'T' && b == 'T' )

andResult = 'T';
  
else

andResult = 'F';
  
return andResult;

} // end and

public static char or ( char a, char b ) {

char orResult;
  
if ( a == 'F' && b == 'F' )

orResult = 'F';
  
else
  
orResult = 'T';
  
return orResult;
  
} // end or

} // end class

In: Computer Science

JAD requires strong interpersonal and communication skills on the part of the systems analyst. Are those...

JAD requires strong interpersonal and communication skills on the part of the systems analyst. Are those skills different from the ones that an analyst needs when conducting one-to-one interviews? Explain your answer.

In: Computer Science