Questions
Why is it important to have a Network Security? Discuss the use of network security components....

Why is it important to have a Network Security?

Discuss the use of network security components.

Why is it important to use Firewall for Computer Networks?

In: Computer Science

Assignment6A: This used to be entertainment. If you haven’t played the classic game Pong, then you...

Assignment6A: This used to be entertainment. If you haven’t played the classic game Pong, then you are now required to do so. Though it doesn’t capture the poor quality of the original, you can find an emulator at Pong-2.com. Play it (using the keyboard).   Do you see how the ball bounces off of the walls and the paddles? You’re going to learn how to do this by creating class Ball.

A Ball has an X and Y position. Equally important, a ball has an x velocity and a y velocity. Every time the ball moves (in one unit of time), it changes its X and Y position by its x and y velocity. However, before moving it, you need to check to see if it’s touching a wall. If so, you need to reverse either its x or y velocity depending on whether or not its touching a wall. What is the ball’s location if its touching a wall? For simplicity, we’re going to assume that the ball is on a 10x10 field and that the x and y velocities can only be -1, 0, or +1.

Your task is to 1) write class Ball that has the variables/attributes above, 2) has a constructor that takes in the starting X and Y position as well as the starting X and Y velocity, 3) has a method called “move” that takes no parameters and updates the position of the ball and 4) has a print statement called “print” that takes no parameters and prints out the ball’s current position.

You must call the class “Ball” and put it in a file called Ball(.java, .cs, .cpp, .h). To test your ball, you should create a file called Assignment6A(.java, .cs, .cpp) that creates a ball based off of user input and calls the “move” and “print” methods of the ball the number of times the user wants. It should behave like the sample output below.

Sample Output #1:

x:

7

y:

4

x velocity:

1

y velocity:

1

Number of moves:

20

X:7 Y:4

X:8 Y:5

X:9 Y:6

X:8 Y:7

X:7 Y:8

X:6 Y:9

X:5 Y:8

X:4 Y:7

X:3 Y:6

X:2 Y:5

X:1 Y:4

X:0 Y:3

X:1 Y:2

X:2 Y:1

X:3 Y:0

X:4 Y:1

X:5 Y:2

X:6 Y:3

X:7 Y:4

X:8 Y:5

X:9 Y:6

Sample Output #2:

x:

5

y:

2

x velocity:

0

y velocity:

-1

Number of moves:

20

X:5 Y:2

X:5 Y:1

X:5 Y:0

X:5 Y:1

X:5 Y:2

X:5 Y:3

X:5 Y:4

X:5 Y:5

X:5 Y:6

X:5 Y:7

X:5 Y:8

X:5 Y:9

X:5 Y:8

X:5 Y:7

X:5 Y:6

X:5 Y:5

X:5 Y:4

X:5 Y:3

X:5 Y:2

X:5 Y:1

X:5 Y:0

In: Computer Science

What is an EA implementation methodology? Who is responsible for execution of the EA program and...

What is an EA implementation methodology?

Who is responsible for execution of the EA program and EA methodology?

How often should an EA be updated? Why?

In: Computer Science

Solve the following problems - assembly - computer organization and architecture- william stallings 1) What is...

Solve the following problems - assembly - computer organization and architecture- william stallings

1) What is the difference between the twos complement representation of a number and
the twos complement of a number?

2) What are the four essential elements of a number in floating-point notation?

3) Give a reason for the use of guard bits.

In: Computer Science

When a contractor buys materials, he or she takes them to the contractor checkout desk. The...

When a contractor buys materials, he or she takes them to the contractor checkout
desk. The clerk enters the contractor name into the system. The system displays
the contractor information, including his/her current credit standing.
The clerk then opens up a new ticket (sale) for the contractor. Next, the clerk then
scans in each item to be purchased. The system finds the price of the item and
adds the item to the ticket. At the end of the purchase, the clerk indicates end of
sale. The system compares the total amount against the contractor’s current credit
limit, and if it is acceptable, finalizes the sale. The system creates an electronic
ticket for the items, and the contractor’s credit limit is reduced by the amount of
the sale. Some contractors like to keep a record of their purchases, so they request
that the ticket details be printed out. Others aren’t interested in a printout.

Given the above scenario, do the following:
a. Develop an activity diagram for case 2.

In: Computer Science

Write a program in which, you define and call each of the following functions, note that...

Write a program in which, you define and call each of the following functions, note that YOU CANNOT USE ARRAY NOTATION IN ANY FUNCTION AT ALL IN THIS EXERCISE, ONLY USE POINTER NOTATION TO MANIPULATE ARRAYS IN THE FUNCTIONS:

1. function read_array, that takes an array of 6 doubles and prompts the user to fill it through the keyboard.

2. function reverse_array, that takes an array of 6 doubles and reverses its contents.

3. function swap_arrays, that takes two arrays of type double and swaps their contents.

4. function print_array, that prints an array of 6 doubles.

5. call all these functions properly in your main program.

In: Computer Science

Java programming Question1 You will create a full program called LetterGrade that will have the user...

Java programming

Question1 You will create a full program called LetterGrade that will have the user enter in 2 test scores as double values. It will compute the average and then using else..if statements it will display the letter grade based on my grading scale listed in the course outline.

In: Computer Science

write a java program for a restaurant menu. including price , add taxes and include tip

write a java program for a restaurant menu. including price , add taxes and include tip

In: Computer Science

What are the differences and similarities in Bing and Google Webmaster Guidelines?

What are the differences and similarities in Bing and Google Webmaster Guidelines?

In: Computer Science

What is internal and external fragmentation. Explain circumstances where one might be preferred over the other...

What is internal and external fragmentation. Explain circumstances where one might be preferred over the other

List one similarity and one difference between paged memory and demand paging memory allocation. Explain two (2) circumstances where one might be preferred over the other.

What are the fundamental differences between paging scheme and segmented memory allocation? List both advantages and disadvantages of each neatly using tables

Which (3) tables are used by the memory manger to keep track of the segments in memory? Describe each table.

Why are segmentation problem like, compaction and external fragmentation removed in the combined segmented/demand paged memory allocation?

Give an example of each, first-in-first out (FIFO) and least-recently–used (LRU) policy.

In: Computer Science

language: python A local biologist needs a program to predict population growth. The inputs would be:...

language: python

A local biologist needs a program to predict population growth. The inputs would be:

  1. The initial number of organisms, as an int
  2. The rate of growth (a real number greater than 1), as a float
  3. The number of hours it takes to achieve this rate, as an int
  4. A number of hours during which the population grows, as an int

For example, one might start with a population of 500 organisms, a growth rate of 2, and a growth period to achieve this rate of 6 hours. Assuming that none of the organisms die, this would imply that this population would double in size every 6 hours. Thus, after allowing 6 hours for growth, we would have 1000 organisms, and after 12 hours, we would have 2000 organisms.

Write a program that takes these inputs and displays a prediction of the total population.

An example of the program input and output is shown below:

Enter the initial number of organisms: 10
Enter the rate of growth [a real number > 1]: 2
Enter the number of hours to achieve the rate of growth: 2
Enter the total hours of growth: 6

The total population is 80

also make sure it test for these cases

Test Case 1

Test for 100 organisms with growth rate of 5 over 2 hrs over 25 hrs total

Test Case 2

Test for 10 organisms with growth rate of 2 over 2 hrs over 6 hrs total

Test Case 3

Test for 0 organisms with growth rate of 5 over 1 hr over 6 hrs total

Test Case 4

Test for 7 organisms with growth rate of 7 over 7 hrs over 7 hrs total

In: Computer Science

Using C language 0. (3pts.) Using opendir() and readdir(), open the current directory and output all...

Using C language

0. (3pts.)
Using opendir() and readdir(), open the current directory and output all filenames until there are no more. Include a main that does this below.

1. (4pts.)
Parse the dirent struct to see if an entry is a directory or a file. If it is a directory, prepend "./" to the filename before printing it out. Include a main that does this below.

2. (3pts.)
Open a file handle to each file, use lseek to determine the file's size in bytes and print out the file's size in bytes next to its name. Include a main that does this below.

EX. (3pts.)
Add a color formatting element. Print out executable binaries in bold red, regular files in light green, directories in light blue and anything else in white. Be careful - changing the console printout color is a durable operation that is global in scope, so once you change the color, anything printed from anywhere in your Process will be in in that color. It is a good practice to always presume the color is incorrectly set before you print and to set it to what you want before you print anywhere (especially in informational or error outputs). You will also need to find a way to determine if a file is executable or not

In: Computer Science

Java Assignment: The layout of Farmer John's farm is quite peculiar, with a large circular road...

Java Assignment:

The layout of Farmer John's farm is quite peculiar, with a large circular road running around the perimeter of the main field on which his cows graze during the day. Every morning, the cows cross this road on their way towards the field, and every evening they all cross again as they leave the field and return to the barn.

As we know, cows are creatures of habit, and they each cross the road the same way every day. Each cow crosses into the field at a different point from where she crosses out of the field, and all of these crossing points are distinct from each-other. Farmer John owns exactly 26 cows, which he has lazily named A through Z (he is not sure what he will do if he ever acquires a 27th cow...), so there are precisely 52 crossing points around the road. Farmer John records these crossing points concisely by scanning around the circle clockwise, writing down the name of the cow for each crossing point, ultimately forming a string with 52 characters in which each letter of the alphabet appears exactly twice. He does not record which crossing points are entry points and which are exit points.

Looking at his map of crossing points, Farmer John is curious how many times various pairs of cows might cross paths during the day. He calls a pair of cows (a,b)(a,b) a "crossing" pair if cow aa's path from entry to exit must cross cow bb's path from entry to exit. Please help Farmer John count the total number of crossing pairs.

INPUT FORMAT (file circlecross.in):

The input consists of a single line containing a string of 52 upper-case characters. Each letter of the alphabet appears exactly twice.

OUTPUT FORMAT (file circlecross.out):

Please print the total number of crossing pairs.

SAMPLE INPUT:

ABCCABDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZ

SAMPLE OUTPUT:

1

In this example, only cows A and B are a crossing pair.

In: Computer Science

Write two Java programs and verify that they work. Program 1 should: Read a UTF-8 encoded...

Write two Java programs and verify that they work.

Program 1 should:

  • Read a UTF-8 encoded text file
  • Print to the console the hex values for the bytes it read in.
  • Convert the text to UTF-16
  • Print to the console the hex values for the converted bytes
  • Write the UTF-16 text to a file

Program 2 should do the same as program 1, except program 2 goes from UTF-16 to UTF-8

Note: we are supposed to write two java programs, the first program should read utf8 encoded text file and the second program should write utf16 text file. So, if you can give me the java code that can read and write utf8 and utf16 text files respectively , I would be happy. Thank you.

In: Computer Science

Linux project deployment Script Create a script “setup.sh” to automate the deployment of a flask application....

Linux project deployment Script

Create a script “setup.sh” to automate the deployment of a flask application. The script must install all software dependencies such as:

  1. Python3

  2. Pip3

  3. Git

Use github to clone this repository.

Install the dependencies given in requirements.txt

Start the server by executing the following command “gunicorn wsgi:app”

requirements.txt

Click==7.0

Flask==1.0.2

Flask-Cors==3.0.7

Flask-JWT==0.3.2

Flask-SQLAlchemy==2.3.2

gunicorn==19.9.0

itsdangerous==1.1.0

Jinja2>=2.10.1

MarkupSafe==1.1.1

PyJWT==1.4.2

six==1.12.0

SQLAlchemy==1.3.1

werkzeug>=0.15.3

In: Computer Science