35 Create a Python program to sniff and analyze packets The programs will have to achieve the

35. Create a Python program to sniff and analyze packets. The programs will have to achieve the following goals: – Capture at least 5000 network packets while using a browser visiting websites, such as www.pace.edu so that the program can sniff out packets between the browser and the web sites. – Group and tally source IP addresses in the packets sniffed out. Show the frequencies of unique source IP addresses accessed. – Group and tally destination IP addresses in the packets sniffed out. Show t

Read More

In pythonYou have been asked to create a form to gather data using a Python program It should

In pythonYou have been asked to create a form to gather data using a Python program. It should allow the user to enter the information and check to see if the data is valid. Once the data has been validated, save the information as a line in a comma separated value file. After the data has been save, clear the form so that that next person can enter their data.The form should look like the following:Using the example programs in the module, construct the GUI data entry form.Upon completion of

Read More

Write a Lisp program that generates a list containing all legal successor states for any state in

Write a Lisp program that generates a list containing all legal successor states for any state in the Missionaries and Cannibals problem. Your program should be invoked by the function call: (mac-next state) where state is of the form (m,n,b), with m representing the number of missionaries (0-3) on the left bank, n representing the number of cannibals (0-3) on the left bank, and b representing whether the boat is on the right side (r) or the left side (I) of the river. For example: (mac-next (33I)) => ((22r) (32r) (31r)) (mac-next (31r)) => ((32I) (33l)) (mac-next (33r)) => nil Your function should check whether the inputted state is in the proper format. If not, an error message should be displayed instead of the list of successor states.

Write a Lisp program that generates a list containing all legal successor states for any state in the Missionaries and Cannibals problem. Your program should be invoked by the function call: (mac-next state) where state is of the form (m,n,b), with m representing the number of missionaries (0-3) on the left bank, n representing the number of cannibals (0-3) on the left bank, and b representing whether the boat is on the right side (r) or the left side (I) of the river. For example: (mac-next (3

Read More

Write the entire code for the following The purpose of this assignment is to learn use of the

Write the entire code for the following: The purpose of this assignment is to learn use of the simplest type of functions.Problem Statement#include Using namespace std;int main(){cout <<"------n" <<"| |n" <<"------n";cout <</t "------n" <</t"| |n" <</t" ------n";cout <</t/t"------n" <</t/t"| |n" <</t/t"------n";return 0;}The objective of this assignment is to modify the above program such that it uses different functions to show each different panel and the structure of the program should look like the one shown in Fig. 2. The execution result of the modified program should be identical to that of the previous version.What to doMake copy of the previous program (note: if you have improved that program since then, you should copy the improved version).In the previous program t you wrote a program using a single function main(), whose structure looked like that shown in Fig. 1 at the end of the assignment, to display a multi-panel comic strip.Modify the program so that it uses a different function to show each different panel and the structure of the program should look like that shown in Fig. 2 at the end of the assignment.On Linux, the sleep() function from the unistd.h library can be used to cause the program to pause for a specified number of seconds.For example, if one calls sleep(1), the program will pause for 1 second.Modify the definition of each panel-display function so that it pauses the program for 1 second after displaying the designated panel.Compile and run the program.Update the documentation part accordingly and re-compile/execute the program to ensure that you did not accidentally change any other part of the program.Correct any mistakes before proceeding to the next assignment.HintsTo use the sleep() function, you need to include the following line at the top of your program: #include Here is an example of how to use the sleep() function in a panel-display function:void display_panel_1() { // code to display panel 1 sleep(1); } Note: The use of the sleep() function will cause the program to pause for 1 second after displaying each panel. This will give the user time to see each panel before moving on to the next one.To clear the screen between each panel, you can use the system("clear") function. system("clear"); Simple FunctionsFunctions are blocks of code that can be called repeatedly from different parts of your program. Functions can make your code more organized and reusable.Here's a simple example of a function that prints out text and then waits for one second:#include #include void printMessage() { cout << "Hello, I'm a function!" << endl; sleep(1); } int main() { printMessage(); return 0; } When you run this program, the output will be:Hello, I'm a function! In this example, the printMessage function is defined using the void keyword, which indicates that the function does not return any value. The function contains a cout statement that prints out the message "Hello, I'm a function!" and a sleep function call that pauses the program for one second. The main function is the entry point of the program, and it calls the printMessage function. sleep()The sleep function can be used to cause a program to pause for a specified number of seconds. This can be useful when you want to display information to a user and give them time to read it before continuing on to the next piece of information.On Linux, the sleep function is part of the unistd.h library, which is a standard library for Unix-based systems. To use sleep in a C++ program on Linux, you need to include the following line at the top of your program:#include The sleep function takes a single argument, which is the number of seconds that the program should pause for. For example, the following code will cause the program to pause for 1 second:sleep(1); Example#include #include using namespace std; int main() { cout << "Starting program...n"; cout << "Pausing for 2 seconds...n"; // The sleep function is used to pause the program for a specified number of seconds. // In this case, we are using the sleep function from the unistd.h library to pause the program for 2 seconds. sleep(2); cout << "Program resumed.n"; cout << "Exiting...n"; return 0; } The output of the program will be:Starting program... Pausing for 2 seconds... Program resumed. Exiting... This program demonstrates how to use the sleep function from the unistd.h library to pause the program for a specified number of seconds. In this example, the program outputs some text to the console, pauses for 2 seconds using the sleep function, and then outputs some more text to the console before exiting.

Write the entire code for the following: The purpose of this assignment is to learn use of the simplest type of functions.Problem Statement#include Using namespace std;int main(){cout

Read More

Question 1 Feeding your pet dog 7 Marks Dogs eat food which creates energy that they use to go

Question 1: Feeding your pet dog [7 Marks] Dogs eat food, which creates energy that they use to go about their lives. But how much food should you feed your dog? Your job is to write a simple program that helps people decide how much to feed their dog per day. Note: Creating more than one Scanner on System.in in the same program will cause problems. Create ONE Scanner in main, and pass it to any methods that need it. a) Weight How much you should feed your dog depends on how much it weighs. For every pound of the dog, they should have a quarter cup of food. Write a method called convertKGtoLB that accepts one double parameter - a weight in kilograms (kg). The method should calculate and return a double value - the same weight converted to pounds (lb). Write a method called readWeight that receives a Scanner as a parameter. Using the Scanner, the method should read in a dog's weight from the user and return it as a double. Ask the user if they want to enter a weight in kilograms or pounds - prompt the user to enter the letters 'k' for kilograms or 'p' for pounds. Then read in the user's response using the Scanner. If the user enters something other than 'k' or 'p', assume that they want to use pounds and print a reasonable message telling them so. Then prompt the user to enter the dog's weight in the chosen units and read it in as a double. This method should return the weight in pounds. If they entered the weight as kilograms, convert it to pounds by using the convertKGtoLB method. Puppies need more food to grow big and strong. Puppies should eat a half cup of food per pound they weigh. Write a method called readIsPuppy that receives a Scanner as a parameter. Using the Scanner, the method should read in if the dog is a puppy (a baby dog). Ask the user if the dog is a puppy - prompt the user to enter the letters 'y' for yes or 'n' for no. Then read in the user's response using Scanner. If the user enters something other than 'y' or 'n', assume that it is not a puppy and print a reasonable message telling them so. This method should return a boolean. Return true if the dog is a puppy, or false if not a puppy. c) Activity Level More active dogs will need more food. For every four miles walked a day, a dog should get a quarter cup more food. Write a method called convertKMtoMI that accepts one double parameter - a distance in kilometers (km). The method should calculate and return a double value - the same distance converted to miles (mi). Write a method called readActivityLevel that receives a Scanner as a parameter. Using the Scanner, the method should read in a dog's daily walking distance and return it as a double. Ask the user if they want to enter a distance in kilometers or miles - prompt the user to enter the letters 'k' for kilometers or 'm' for miles. Then read in the user's response using the Scanner. If the user enters something other than 'k' or 'm', assume that they want to use miles and print a reasonable message telling them so. Then prompt the user to enter the dog's daily walking distance in the chosen units and read it in as a double. This method should return the distance in miles. If they entered the distance as kilometers, convert it to miles by using the convertKMtoMI method. d) Breed Some dog breeds have special requirements. Labradors and Golden Retrievers should get a quarter cup more food per 5 pounds they weigh. German Shepherds should get a quarter cup more food per seven pounds they weigh. Bernese Mountain Dogs should get a quarter cup less food per ten pounds they weigh. Other breeds do not have special considerations. Write a method called readDogBreed that receives a Scanner as a parameter. Using the Scanner, the method should read in a dog's breed and return it as a char. Prompt the user to enter a letter to represent their dog breed as follows: 'l' for Labrador, 'r' for Golden Retriever, 'g' for German Shepherd, 'b' for Bernese Mountain Dog, or 'o' for other. Then read in the user's response using Scanner. If the user enters something other than 'l', 'r', 'g', 'b' or 'o', assume that their dog is other and print a reasonable message telling them so. This method should return the letter of the dog breed. e) Calculate the Amount Write a method called findFoodAmount that accepts several parameters - a weight in pounds (lb), whether the dog is a puppy, the dog's daily walking distance (mi), and the dog's breed. The method should compute and return the amount of food to feed the dog. In addition to the amounts stated above, the following must also be considered: - Overweight dogs should get one cup less. An overweight Labrador, Golden Retriever, or German Shepherd is over 80 lbs. An overweight Bernese Mountain Dog is over 90 lbs. There is no limit known for other breeds of dogs. - Puppies should also get one cup less, but overweight puppies (over 80/90 pounds, as above) should not have a reduction in their food. f) Print the amount Write a method called printFoodAmount that accepts the amount of food to feed the dog. The method should print a nice message telling the user how much food to feed their dog. Question 2: Farkle Scoring [8 Marks] Farkle is a dice game where you roll six dice and try to be the first to score 10,000 points or more. Your job is to create a Farkle scoring program. Given one to six dice, you will determine the score for those dice. Farkle Rules: - Each person rolls six dice and sees if they have rolled any scoring dice or combinations. Any dice that score may be set aside. You must set aside at least one scoring dice of your choice, if possible, but it is not required to set aside all scoring dice. Then you may choose to roll the remaining dice. - For example, if you rolled 1-3-3-5-5-6, you could set aside the 1 and the two 5's for scoring, or you could choose to set aside only the 1. All dice that are not set aside may be rerolled. - If all six dice are set aside for scoring, you can roll all six dice again and continue adding to your accumulated score. Or you can bank your points, end your turn, and pass the dice to the next player. - Your turn continues until either you decide to stop and score your points, or until you fail to roll any scoring dice on a throw (known as a Farkle) and all your points gained so far on that turn are lost. - At the end of your turn, any points you have scored are written down and the dice are passed to the next player. Reminder 1: Your job is to create a Farkle scoring program. Given 1 to 6 dice in ascending order, you will determine the score for those dice. You are not implementing a complete game. Reminder 2: This assignment should be completed using material from Weeks 1-6. (No loops needed!) c) Print the score Write a method called printScore that accepts the score. The method should print a nice message telling the user how much they scored. If the user scored zero points, the program should print "Farkle!". Example Outputs: Dice to Score: 123456 Points Earned: 3000 Dice to Score: 123555 Points Earned: 600 Dice to Score: 223346 Farkle!

Question 1: Feeding your pet dog [7 Marks] Dogs eat food, which creates energy that they use to go about their lives. But how much food should you feed your dog? Your job is to write a simple program that helps people decide how much to feed their dog per day. Note: Creating more than one Scanner on System.in in the same program will cause problems. Create ONE Scanner in main, and pass it to any methods that need it. a) Weight How much you should feed your dog depends on how much it weighs. For

Read More

Many usercreated passwords are simple and easy to guess Write a program that takes a simple

Many user-created passwords are simple and easy to guess. Write a program that takes a simple password and makes it stronger by replacing characters using the key below, and by appending " " to the end of the input string. - I becomes 1 - a becomes @ - m becomes M - B becomes 8 - s becomes $ 6 in binary is 110; the algorithm outputs the bits in reverse.

Many user-created passwords are simple and easy to guess. Write a program that takes a simple password and makes it stronger by replacing characters using the key below, and by appending ” ” to the end of the input string. – I becomes 1 – a becomes @ – m becomes M – B becomes 8 – s becomes $ 6 in binary is 110; the algorithm outputs the bits in reverse.

Read More

For the digraph below use the decreasing time list algorithm to create a priority list then

For the digraph below, use the decreasing time list algorithm to create a priority list, then schedule with two processors. Select the correct resulting schedule. T4 (11)

For the digraph below, use the decreasing time list algorithm to create a priority list, then schedule with two processors. Select the correct resulting schedule. T4 (11)

Read More