Questions
You need to write a program that reads in two integers from cin and outputs an...

You need to write a program that reads in two integers from cin and outputs an horribly inefficent calculation of the median value.

First count from the first number to the second, but stop one short.

Then, count from that number back towards the first, again stopping one short.

Continue until you reach a single number.

In: Computer Science

5. Paint the ceiling You want to build yourself a house. The building company you hired...

5. Paint the ceiling You want to build yourself a house. The building company you hired can only build houses with sides from their specific set s. That means they can build you a square house or a rectangular one but if and only if its length and width belong to the set s. This month, they have a special promotion: they will paint the ceiling of a new house for free...but only if its area is not more than a. You want them to do it for free but you also want to be sure that the house will be comfortable and not too small. How many possible house configurations can you create to have the ceiling painted for free given the side lengths offered? There is a method to how the company decides what lengths of sides to produce. To determine n lengths of wall segments to offer, they start with a seed value s0, some variables k, b and m, and use the following equation to determine all other side lengths s[i]: s[i]=((k*s[i-1]+b) mod m)+1+s[i-1]) for 1 si

In: Computer Science

Langton Ant Program: This assignment will apply Langton's ant a two-dimensional universal turning machine on a...

Langton Ant Program:

This assignment will apply Langton's ant a two-dimensional universal turning machine on a 2 dimensional X by X grid where each grid cell is of the color white or black and the ant can be described as one of eight states ie. cell color and orientation.

Create a X by X square grid of “Cell”s that are either black or white. Begin with the “ant” in the center of the grid ( X must be a odd number/integer). Start the ant in a “up” orientation in the center of the board. Perform N steps where each step has to follow some simple rules:

  1. If the ant is on a white tile turn 90° clockwise, then change the color of the tile & move forward one unit
  2. If the ant is on a black tile turn 90° counterclockwise, change the color of the tile and then move forward one unit.

You are to program the `Cell` class according to the following:

Cell color:

The `Cell` class will store the cell's color as a private member variable named `color` of type `CellColor` where `CellColor` is an enumeration data type defined as:

“enum CellColor {white, black};”

Constructor :

The `Cell` class will be constructed using the default constructor i.e. will not accept any arguments. The constructor will set `color` to `white` upon construction.

Cell Color Mutator

The `Cell` class will contain a public member function called `change_color` to change the `color` member. I.e. if `color` is set to `white`, calling `change_color( )` will change the `color` to `black`. The member function `change_color` will return type `void` and will accept no input parameters.

Cell Color Accessors

The `Cell` class will contain two "getter" functions to access `color`.

1.) Must be named `get_color`, will return type `CellColor`, must return the value of `color`, and must accept no input parameters. `get_color must return the value of `Cell`'s `color` member.

  1. Must be named `get_color_string`, must return type `std::string`, and must accept no input. `get_color_string` must return "1" if `color` is `black` and must return "0" if `color` is `white`.

The template we will be using to declare the “Cell” class

Cell.hpp:

#include

// Declare an enumeration data type to store the Cell's color

enum CellColor {white, black};

// Declare the Cell Class

class Cell {

public:

          // Declare default constructor to initialize color to white

          // Declare member function getter for the color (get_color). Returns CellColor

          // Declare a member to flip the color (change_color)

          // Declare a member to print the string for this color.

          // white = "0", black = "1"

private:

          // Declare the color of this cell (color) as type CellColor

};

#endif

Cell.cpp:

#include "Cell.hpp"

(This is only part 1. of this assignment so I only need the code for this part I described and not the grid and ant movement yet)

In: Computer Science

describing a modern approach to artificial intelligence. Look for something within the last 2 years. Below...

describing a modern approach to artificial intelligence. Look for something within the last 2 years.

Below are the details for your post:

Focus on identifying a modern AI strategy (may even consider AI related software).

Give a quick write-up on the strategy but keep in mind this is not meant to have you explain the details as if you were the expert.

What was interesting about the strategy?

What impact could you envision for using this strategy?

How might it be used in the future?

Create sections/paragraphs to address each writing topic. Provide link to video.

A critique would provide both pros and cons while also taking a position on the value by describing a benefit or lack thereof.

In: Computer Science

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