Questions
The application of syntax analysis techniques in query processing system such as SQL You should cover:...


The application of syntax analysis techniques in query processing system such as SQL

You should cover:
1) What is the problem?
2) What is the compiler construction techniques used to solve the problem
3) How to solve the problem using the compiling techniques.

In: Computer Science

Which of the following statements are/is true? Select all that apply. A. Stateful inspection firewalls can...

Which of the following statements are/is true? Select all that apply. A. Stateful inspection firewalls can detect SYN attacks. B. Both application-level and circuit-level gateways do not allow a direct end-to-end connection between the connecting parties. C. Stateful inspection firewalls, circuit-level gateways and application-level gateways provide reactive network defense, whereas packet filtering firewalls provide proactive network defense.

In: Computer Science

Write a program that uses the defined structure and all the above functions. Suppose that the...

Write a program that uses the defined structure and all the above functions. Suppose that the class has 20 students. Use an array of 20 components of type studentType. Other than declaring the variables and opening the input and output files, the function main should only be a collection of function calls. The program should output each student’s name followed by the test scores and the relevant grade. It should also find and print the highest test score and the name of the students having the highest test score.

In: Computer Science

C# (Tic-Tac-Toe) Create class TicTacToe that will enable you to write a complete app to play...

C# (Tic-Tac-Toe) Create class TicTacToe that will enable you to write a complete app to play the game of Tic-Tac-Toe. The class contains a private 3-by-3 rectangular array of integers. The constructor should initialize the empty board to all 0s. Allow two human players. Wherever the first player moves, place a 1 in the specified square, and place a 2 wherever the second player moves. Each move must be to an empty square. After each move, determine whether the game has been won and whether it’s a draw. If you feel ambitious, modify your app so that the computer makes the moves for one of the players. Also, allow the player to specify whether he or she wants to go first or second. If you feel exceptionally ambitious, develop an app that will play three-dimensional Tic-Tac-Toe on a 4-by-4-by-4 board. (Use Console Clear)

In: Computer Science

Write code to define a function named mymath. The function has three arguments in the following...

Write code to define a function named mymath. The function has three arguments in the following order: Boolean, Integer, and Integer. It returns an Integer.
The function will return a value as follows:

1. If the Boolean variable is True, the function returns the sum of the two integers.
2. If the Boolean is False, then the function returns the value of the first integer - the value of the second Integer.

In: Computer Science

In the caeser cipher encryption and decryption program below, what do the two lines if(ch >...

In the caeser cipher encryption and decryption program below, what do the two lines

if(ch > 'z'){

ch = ch - 'z' + 'a' - 1;

}

if(ch < 'a'){

ch = ch + 'z' - 'a' + 1;

}

mean???

I understand that it has something to do with ASCII characters and makes sure that if the encryption/decryption character is more than "z", then it would loop back to "a" instead of outputting a charcter like "{" . I just need more information and a better theoritical explanation about that line. Thank you! :)

#include

#include

using namespace std;

//Encryption function

void encryption(char msg[100], int key) {

int i;

char ch;

  

for (i = 0; msg[i]; ++i) {

  

ch = msg[i];

  

if (ch >= 'a' && ch <= 'z') {

ch = ch + key;

if(ch > 'z'){

ch = ch - 'z' + 'a' - 1;

}

  

msg[i] = ch;

} else if (ch >= 'A' && ch <= 'Z') {

ch = ch + key;

if(ch > 'Z'){

ch = ch - 'Z' + 'A' - 1;

}

  

  

msg[i] = ch;

}

}

}

//Decryption function

void decryption(char msg[100], int key) {

int i;

char ch;

  

for (i = 0; msg[i]; ++i) {

  

ch = msg[i];

  

if (ch >= 'a' && ch <= 'z') {

ch = ch - key;

if(ch < 'a'){

ch = ch + 'z' - 'a' + 1;

}

  

msg[i] = ch;

} else if (ch >= 'A' && ch <= 'Z') {

ch = ch - key;

if(ch < 'A'){

ch = ch + 'Z' - 'A' + 1;

}

  

msg[i] = ch;

}

}

  

}

int main() {

  

int x;

int key;

char msg[100];

  

cout << "Enter a message: ";

cin.getline(msg, 100);

cout << "Enter key: ";

cin >> key;

  

cout << "Please select the following:\n" << endl;

cout << "1) Encryption" << endl;

cout << "2) Decryption" << endl;

cin >> x;

  

switch (x) {

case 1:

  

encryption(msg, key);

cout << "\nEncrypted message: \n" << msg << endl;

  

break;

  

case 2:

  

decryption(msg, key);

cout << "\nDecrypted message: \n" << msg << endl;

  

break;

  

}

  

return 0;

}

In: Computer Science

Create a class Sentence with an instance variable public Word[] words. Furthermore: The class should have...

Create a class Sentence with an instance variable public Word[] words.

Furthermore: The class should have a constructor Sentence(int size), where size determines the length of the sentence field of a given Sentence.

The class should have an instance method public boolean isValid() that determines the validity of a sentence according to the rules detailed below.

Also create a public nested class Word, with instance variables String value and Type type.

Within this class, you must create: A public enum type Type that contains NOUN, ADJECTIVE, and VERB. The constructor Word(String value, Type type).

RULES FOR SENTENCE VALIDITY:

1.A sentence must have a length of at least 1.

2. A NOUN must be followed by a VERB (unless it is at the end of a sentence).

3.An ADJECTIVE must be followed only by another ADJECTIVE or a NOUN.

4.A sentence must have one and only one VERB.

5. A sentence must end in a NOUN or in a VERB.

In: Computer Science

Please post screenshots of outputs. Also make sure to use stacks and queues. You will design...

Please post screenshots of outputs. Also make sure to use stacks and queues.

You will design a program to keep track of a restaurants waitlist using a queue implemented with a linked list. Make sure to read pages 1215-1217 and 1227-1251

1. Create a class named waitList that can store a name and number of guests. Use constructors to automatically initialize the member variables.

2. Add the following operations to your program:

a. Return the first person in the queue

b. Return the last person in the queue

c. Add a person to the queue

d. Delete a person from the queue

3. Create a main program to test your class. Your main program should contain the following options.

a. Add a guest (adds the reservation name and number of guests)

b. Delete a guest (the user must give you the name to delete, the list may be empty or the guest may not be in the list)

c. Show last guest waiting (return NONE if the queue is empty)

d. Show first guest waiting (return NONE if the queue is empty)

e. Exit Name your program LastName First Initial Lab9. Example. SerranoGLab9.cpp..

In: Computer Science

In Python. The file “essay.txt” attached to this assignment includes an essay. The essay includes a...

In Python. The file “essay.txt” attached to this assignment includes an essay. The essay includes a couple of sections that are separated by two consecutive newline characters (i.e. ‘\n’) that are shown as empty lines between the sections if you open the file in a text editor like Notepad. Each section starts with a title followed by a couple of paragraphs; the title and the paragraphs are separated by a newline character. Each paragraph includes a couple of sentences that are ended with either a period or a question mark which is followed by a space character if the paragraph has more sentences. Explore the explained organization of the file by opening the file in Notepad before moving on to the programming part. Use this file to write a program that:

1. Displays the number of sections, paragraphs, lines, words, and characters (excluding the white-space and punctuation characters) included in this essay.

2. Lists all the distinct words included in the essay in a lexical order (i.e. alphabetical order regardless of the length of each word.)

3. Displays a sorted list of distinct words included in the essay including the number of occurrences of each word in the essay on the screen. The output list is a two-level sorted list that is first sorted by the length of the words and second all the words of a specific length are alphabetically sorted. A sample output of this step could be like:

Length Word Number of Occurrences

1 a 24

1 I 5

2   am 5

Hint: In order to access all the words of a specific length more efficiently, you may need to create a dictionary including the items in the format of “length : listOfWords” where length is of the type of int that is used to retrieve a list including all the words of that length as the value. Assumptions and requirements

1. The file does not include any punctuation mark other than period, comma, or question mark.

2. There is either one space or a comma followed by a space between two consecutive words in a sentence.

3. There is no digit or apostrophe character included in the file.

4. This program is case-insensitive for the first letter of the words, however, a word that is all in uppercase is considered as a distinct word (i.e. it is an abbreviation). For example, the words “Air” and “air” are considered as the same word, however, the word “AIR” is not the same as any of the two previous words.

Essay.txt

What is pollution?
Environmental pollution occurs when pollutants contaminate the natural surroundings. Pollution disturbs the balance of our ecosystems, affect our normal lifestyles and gives rise to human illnesses and global warming. Pollution has reached its peak due to the development and modernization in our lives. With the development of science and technology, there has been a huge growth of human potentials. People have become prisoners of their own creations.
We waste the bounties of our nature without a thought that our actions cause serious problems. We must deepen our knowledge of nature`s laws and broaden our understanding of the laws of the human behavior in order to deal with pollution problems. So, it is very important to know different types of pollutions, their effects and causes on humanity and the environment we live in.

Types, causes, and effects of pollution
Air pollution is one of the most dangerous forms of pollution. A biological, chemical, and physical alteration of the air occurs when smoke, dust, and any harmful gases enter into the atmosphere and make it difficult for all living beings to survive as the air becomes contaminated. Burning of fossil fuels, agriculture related activities, mining operations, exhaust from industries and factories, and household cleaning products entail air pollution. People release a huge amount of chemical substances in the air every day. The effects of air pollution are alarming. It causes global warming, acid rains, respiratory and heart problems, and eutrophication. A lot of wildlife species are forced to change their habitat in order to survive.
Soil pollution occurs when the presence of pollutants, contaminants, and toxic chemicals in the soil is in high concentration that has negative effect on wildlife, plants, humans, and ground water. Industrial activity, waste disposal, agricultural activities, acid rain, and accidental oil spill are the main causes of soil pollution. This type of contamination influence health of humans, affects the growth of plants, decreases soil fertility, and changes the soil structure.
Water pollution is able to lead our world on a path of destruction. Water is one of the greatest natural resources of the whole humanity. Nothing will be able to live without water. However, we do not appreciate this gift of nature and pollute it without thinking. The key causes of the water pollution are: industrial waste, mining activities, sewage and waste water, accidental oil leakage, marine dumping, chemical pesticides and fertilizers, burning of fossil fuels, animal waste, urban development, global warming, radioactive waste, and leakage from sewer lines. There is less water available for drinking, cooking, irrigating crops, and washing.

Light pollution
Light pollution occurs because of the prominent excess illumination in some areas. Artificial lights disrupt the world`s ecosystems. They have deadly effects on many creatures including mammals, plants, amphibians, insects, and birds. Every year many bird species die colliding with needlessly illuminated buildings. Moreover, artificial lights can lead baby sea turtles to their demise.
Noise pollution takes place when noise and unpleasant sounds cause temporary disruption in the natural balance. It is usually caused by industrialization, social events, poor urban planning, household chores, transportation, and construction activities. Noise pollution leads to hearing problems, health issues, cardiovascular issues, sleeping disorders, and trouble communicating. Moreover, it affects wildlife a lot. Some animals may suffer from hearing loss while others become inefficient at hunting. It is very important to understand noise pollution in order to lower its impact on the environment.
Radioactive pollution is the presence of radioactive substances in the environment. It is highly dangerous when it occurs. Radioactive contamination can be caused by breaches at nuclear power plants or improper transport of radioactive chemicals. Radioactive material should be handled with great care as radiation destroys cells in living organisms that can result in illness or even death.

Solutions to pollution problems
Environmental pollution has negatively affected the life of both animals and human-beings. The only way to control current environmental issues is to implement conservation methods and create sustainable development strategies. We should find some effective solutions in order to restore our ecological balance.
First of all, we should make sustainable transportation choices. We should take advantage of public transportation, walk or ride bikes whenever possible, consolidate our trips, and consider purchasing an electric car. It is very important to make sustainable food choices. Choose local food whenever possible; buy organically grown vegetables and fruits or grow your own.
People should conserve energy. Turn off electronics and lights when you are not in the room. Consider what small changes can lead to big energy savings. Use energy efficient devices. It is also essential to understand the concept of reduce, Reuse and Recycle. Try to buy used items whenever possible. Choose products with minimal packaging. Buy reusable items. Remember that almost everything that you purchase can be recycled.
Conserve water as much as possible. Dispose of toxic waste properly. Do not use herbicides and pesticides. Use natural, environmentally friendly chemicals for your everyday chores.

Conclusion
Environmental pollution is one of the biggest problems caused by human activities that we should overcome to see a tomorrow and guarantee our descendants a healthy life.  There are many environmental concerns for communities around the world to address. We should always remember that pollution problems affect us all so each of us has to do his or her best to help restore ecological balance to this beautiful place we call home. Learn about the major polluters in your area to protect the air and water where you live. Encourage people to stop pollution, tell them everything you know about this problem, and protest local polluters together. The masses should be educated on the danger of different types of pollution. People should know everything about all consequences of the environmental

In: Computer Science

Kleptography Describe substitution, Mon alphabets, and other classes, and attacks

Kleptography

Describe substitution, Mon alphabets, and other classes, and attacks

In: Computer Science

Do some online research about the “friendly-scanner” SIP flood/intrusion attack, then answer the following.
 a. Which...

Do some online research about the “friendly-scanner” SIP flood/intrusion attack, then answer the following.


a. Which port does the attack target?

b. Besides flooding to deny service, how does this attack attempt to break in to a VoIP system?

c. What is an effective defense against this attack?

In: Computer Science

Answer the questions in detail: 1. What tasks are necessary to keep a database functional? 2....

Answer the questions in detail:

1. What tasks are necessary to keep a database functional?

2. How do you schedule backups to safeguard data? How do you know/differentiate  what data should be and what data needs to be backed up?

3. What can you do to keep a database working efficiently? What does it mean to have an efficient database?

In: Computer Science

Given an unsorted integer array A of size n, develop an pseudocode with time complexity as...

Given an unsorted integer array A of size n, develop an pseudocode with time complexity as low as possible to find two indexes i and j such that A[i] + A[j] = 100. Indexes i and j may or may not be the same value.

In: Computer Science

Steganography Describe substitution, Mon alphabets, and other classes, and attacks

Steganography

Describe substitution, Mon alphabets, and other classes, and attacks

In: Computer Science

Please no Plagiarism Kleptography: Different type of algorithms, implementations, and write classic algorithms.

Please no Plagiarism

Kleptography:

Different type of algorithms, implementations, and write classic algorithms.

In: Computer Science