Implement Server And Client Program In C There Are Two Clients X And Y Both Esse

Implement server and client program in C++. There are two clients, X and

Y (both essentially identical) that will communicate with a server. Clients X and Y will each

open a TCP socket to your server and send a message to your server. The message contains the

name of the client followed by your name (e.g., “Client X: Alice”, “Client Y: Bob”).

The server will accept connections from both clients and after it has received messages from

both X and Y will print their messages and then send an acknowledgment back to your clients.

The acknowledgment from the server should contain the sequence in which the client messages

were received (“X: Alice received before Y: Bob”, or “Y: Bob received before X: Alice”). After

the server sends out this message it should output a message saying – “Sent acknowledgment to

both X and Y”. Your server can then terminate. Once your clients receive the message from the

server, they should print the message that they sent to the server, followed by the reply received

from the server.

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Import Java Scanner 3 2pp Tweet Generator Author Replace With Your Name Public C

import java.util.Scanner;/** * 3.2PP Tweet Generator * * Replace with your name */ { void main(String[] args) {Scanner sc = Scanner(System.in);String handle; int tweets; System.out.println();System.out.println();System.out.();handle = sc.next();System.out.();tweets = sc.nextInt();}}Program: TweetBotVariables:Scanner scString handle, some user’s Twitter identity (without @)String adjective, a one word adjectiveint tweets, user’s total tweetsint followers, their number of followersint following, number of other users they are followingint difference, difference between followers followingSteps: Create Scanner sc Display the title of the program: Prompt person’s Twitter handle without the leading @ sign and store in handle4. Prompt for an adjective (e.g., good, bad) to describe them and store in adjective5. Prompt for person’s number of tweets store in tweets Prompt how many followers they have store in followers Prompt number they are following store in following Calculate their influence followers – following store in difference Display the following formatted messages, where each highlighted entryrepresents that variable’s value:#adjective @handle has only followers followers!Net influence of difference not bad since only tweeted tweets times.@realhandle would be a better handle though

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Import Java Random Import Java Arrays Public Class Binaryarray Private Int Data

19.9 (Recursive Binary Search) Modify Fig. 19.4 to use recursive method recursiveBinarySearch to perform a binary search of this array. The method should receive the search key, starting index and ending index as arguments. If the search key is found, return its index in the array. If the search key is not found, return -1.

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Import Java Public Class Exceptiontesterapp Public Static Void Main String Args

Intro to Java:(only need source code and will tip)(Two attachments: “ExceptionTesterApp.java” and an image of figure 14-7 for convenience) In this exercise, you’ll experiment with ways to throw and catch exceptions:1.) Add code to Method3 that throws an unchecked exception by attempting to divide an integer by zero. Compile and run the program and note where the exception is thrown.2.) Delete the code you just added to Method3. Then, add a statement to this method like the one in figure 14-7 that creates an object from the RandomAccessFile class, but use the string “products.ran” in place of the path variable. The constructor for this class throws a checked exception named FileNotFoundException. Note the error message that indicates that you haven’t handled the exception. If this error message isn’t shown, compile the class to display the error message.3.) Add throws clauses to all of the methods including the main method. Then, run the program to see how a checked exception can propagate all the way out of a program. 4.) Add the code necessary to handle the FileNotFoundException in Method1. To do that, you’ll need to remove the throws clauses from the main method and Method1, and you’ll need to add a try statement to Method1 that catches the exception. The catch block should display an appropriate error message. Run the program to make sure the exception handler works.-Thank you very much

  • Attachment 1
  • Attachment 2

import java.io.*;public class ExceptionTesterApp {public static void main(String args) {System.err.println("In main: calling Method1.");Method1();System.err.println("In main:…

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Import Java Public Class Doublylinkedlist Private Node Head Private Node Tail Pu

Need some help on an assignment. Below is the question to the assignment and attached is what I have so far. Could I get it to making it more efficient? Also I am getting an error with my current code. Could you input some light notes in the revised version so I could follow along? Thank you

Write a menu driven program that implements the following doubly linked list operations :

  • INSERT (at the beginning)
  • INSERT_ALPHA (in alphabetical order)
  • DELETE (Identify by contents, i.e. “John”, not #3)
  • COUNT
  • CLEAR
 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Import Java Import Java Public Class Binarysearchtreelt E Extends Comparablelt E

Complete TestBinarySearchTree program to test the following methods. you must thoroughly test these methods with multiple different BinarySearchTrees!!!!!

search

insert

delete

inorder

preorder

postorder

path

leftSubTree

rightSubTree

getNumberOfLeaves

sameTree

  • Attachment 1
  • Attachment 2
 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Import Java File Import Java Filenotfoundexception Import Java Printwriter Impor

import java.io.File;

import java.io.FileNotFoundException;

import java.io.PrintWriter;

import java.util.Scanner;

public class MathOp2 {

 public static void main(String[] args) throws FileNotFoundException {

  Scanner scanner = new Scanner(new File(“MathInput.csv”));

  PrintWriter printWriter = new PrintWriter(new File(“Math_Results.csv”));

  int total = 0;

  while (scanner.hasNext()) {

   total = 0;

   String readLine = scanner.nextLine();

   String[] getData = readLine.split(“,”);

   if (getData[1].trim().equals(“+”)) {

    int operand = Integer.parseInt(getData[0]);

    total = operand + Integer.parseInt(getData[2]);

    printWriter.write(operand + “+” + Integer.parseInt(getData[2])

      + “, = ,” + total + “n”);

   } else if (getData[1].trim().equals(“-“)) {

    int operand = Integer.parseInt(getData[0]);

    total = operand – Integer.parseInt(getData[2]);

    printWriter.write(operand + “-” + Integer.parseInt(getData[2])

      + “, = ,” + total + “n”);

   } else if (getData[1].trim().equals(“*”)) {

    int operand = Integer.parseInt(getData[0]);

    total = operand * Integer.parseInt(getData[2]);

    printWriter.write(operand + “*” + Integer.parseInt(getData[2])

      + “, = ,” + total + “n”);

   } else if (getData[1].trim().equals(“/”)) {

    int operand = Integer.parseInt(getData[0]);

    total = operand / Integer.parseInt(getData[2]);

    printWriter.write(operand + “/” + Integer.parseInt(getData[2])

      + “, = ,” + total + “n”);

   }

  }

  Scanner userInput = new Scanner(System.in);

  System.out.println(“Do you want to save the results (Y/N)?”);

  String choice = userInput.nextLine();

  if (choice.equals(“Y”)) {

   printWriter.close();

  }

  System.out.println(“do you want to review the results (Y/N)?”);

  choice = userInput.nextLine();

  if (choice.equals(“Y”)) {

   scanner = new Scanner(new File(“Math_Results.csv”));

   while (scanner.hasNext()) {

    System.out.println(scanner.nextLine().replace(‘,’, ‘ ‘));

   }

  }

  scanner.close();

 }

}

Error: Could not find or load main class week8.Week8

Java Result: 1

BUILD SUCCESSFUL (total time: 1 second)

I do not know how or what I am doing wrong. please help

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Import Import Import Public Java Applet Applet Java Java Event

1. Find the JAVA code for Hangman. I need it without using applet and swing, just need it in command prompt. (Hangman)2. Find the week7. I did some part, please complete it (week7 pdf and oddcalculator

  • Attachment 1
  • Attachment 2
  • Attachment 3

Week 7 Pair Exercise – Odds Calculator You volunteer your weekends at 305-­‐Gambler, an anonymous helpline. After answering a few phone calls you start to realize that your callers have no idea what their probabilities for winning their games actually are. You decide on a strategy for counseling that introduces long-­‐shot odds in order to establish a baseline for comparison to the odds they actually have in their game of choice. Some of these long-­‐shot odds are: • The odds of being struck by lightning is 1 in 2,000,000; at all during your lifetime is 1 in 3,000. • The odds of dying due to an asteroid impact is 1 in 200,000. • The odds of finding a pearl in an oyster you are eating is 1 in 12,000. • The odds of becoming a professional football player, assuming you played in high school, is 8 in 10,000. • Under normal circumstances the odds of having identical twins is 3 in 1,000; quadruplets is 1 in 705,000. • The odds that the Dolphins will win the next super bowl is 1 in 80. You noticed that the most common addiction was to the state lottery system. These vary widely in how they are played and so you want a program that takes input and does it for you automatically. To establish a valid calculation of the caller’s odds you decide to write a program that asks for the range of numbers (example: 1 – 52), and how many numbers are drawn (for example: 6 numbers) in their game of choice. It will also ask whether or not the order that the numbers are drawn matters. Your task is to create a program that will calculate the odds based on three inputs: (1) the range of numbers, (2) the count of numbers drawn from this pool, (3) whether the order matters (i.e. if the drawing was 1, 2, 3 but your bet was for 3, 2, 1 you actually lost). After calculating the odds, it will print out the odds that were calculated, and any of the comparisons presented above that are actually more favorable than those odds that were just calculated. Use the following as an example: Example -­‐ The Florida Lottery: 1. The range is 53 numbers. 2. There are 6 numbers drawn. 3. The order does not matter. Using this example, the odds for the first ball being drawn is 1/53. Since there is now one less ball the odds for the second number is 1/52. Since there are now two less balls the odds for the third number is 1/51, and so on until the odds for the sixth and final number is 1/48. The odds are therefore 53 * 52 * 51 * 50 * 49 * 48 = one in 16,529,385,600. If order did matter, you stop here and these are the odds calculated (what your program should output). However, the order does not matter. So in this case, you must eliminate all the possible combinations for those 6 numbers. Possible combinations are (6!) which is 6 * 5 * 4 * 3 * 2 * 1 = 720. You divide the original calculation by this number to get the final probability. The final result is 16,529,385,600/720 = 22,957,480. Your program will print out that the odds for winning this game is 1 in 22,957,480. The program will then print out any of the odds above, which are actually less than the calculated odds. In this case, every single one is lower so all of them would be printed to screen. Requirements: • The program will ask for an integer number to indicate the range of numbers in the game. (How many balls are in the hopper?) o The program will verify that this number is not negative, and if it is it should continue prompting the user until a valid input is provided. • The program will ask for the count of numbers to be drawn. (How many balls are drawn from the hopper to be the winning set?) o You cannot draw a negative number of numbers, and you also can’t draw more than you have so the program will verify that this number is not negative, and is also less than the range. It will continue prompting the user until a valid input is provided. • The program will then ask if the order matters as either (yes or no) or (true or false). o You must validate that they put in valid input. If they did not, you will continue prompting the user until a valid input is provided. • The program will then calculate the exact odds based on these three inputs and print them to screen. • The program will also then output any of the statements above, which are actually lower odds than those that were calculated. Instructions: 1. You may work with a “coworker” on this exercise, or choose to do it alone. 2. First, work through on paper exactly what the requirements are asking you to do. 3. Once have worked through the requirements on paper, then code. 4. When you have finished, upload the project file to the Blackboard Week 7 pair exercise dropbox as a zipped file with the following name: “Pair7_Student1_Student2.zip” Some sample input and corresponding output:

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Import Csv Import Matp Lot Lib Pyplot As Pit Data With Open Attack Type Freque

Can someone please explain to me what I am doing wrong/what I am missing to be able to output a graph. I am getting an error: [float(dd[1]) for dd in data[1:]] from like 8 down. I have attached a sample of the data

  • Attachment 1
  • Attachment 2

import CSVimport matp Lot Lib . pyplot as pitdata = [ ]with open ( ‘ attack_ type_ frequency . CSV’ ,’ r’) as to :reader = csV . reader ( fp , deLimiter = ‘ It ‘ )for row in reader :data . append ( row )DOS = [ float ( dd [ 1 ] ) for ad in data [ 1 : ]]UZR = [ float ( dd [1] ) for ad in data [ 1 : ] ]R 21 = [ float ( dd [ 1 ] ) for ad in data [ 1 : ]]PROBE = [ float ( dd [ 1 ] ) for ad in data [ 1 : ]]fig , ax = pit . subplots ( figsize = ( 10 , 5 ) , dpi = 100 )ax . scatter(DOS , UZR, R21 , PROBE , alpha = 0 . 7, 5 = 150 , edgecolor=’ yellow’ )ax . set_ * label( " Attack number detected " , fontsize = 12 )ax . set_ y label ( " Attack frequency " , fontsize = 12 )

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Importer That Incurs Costs In Gbp And Bills Its Customers In Usd Is Concerned Ab

A U.S. importer that incurs costs in GBP and bills its customers in USD is concerned about the depreciation of USD against GBP due to GBP payables of £10,000,000 in a month. To hedge (protect) the position, the importer decides to use futures markets. Currently GBP contracts (62,500 GBP each) are traded at 1.5290. Spot rate is 1.5310 (i.e., GBP/USD 1.5310). Suppose the importer takes an equal futures position to its cash market position (GBP 10m) at 1.5290. Assume that the futures contract price and spot rates are 1.5995 and 1.6020, respectively, when the hedge is liquidated. What should the unit cost of GBP be for the importer in terms of USD?

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW