Write the required lines of code

Assignment Help Programming Languages
Reference no: EM13804617

Question 1. Write the listenSocket method (server-side program).

a - Write the required lines of code that will create a ServerSocket object with a port number 3421 on which the server program is going to listen for client communications.

b- Write the required lines of code that will create a new socket object.

c - Write the required lines of code that will read the data sent over the socket connection from the client program.

Question 2. Write the listenSocket method (client-side program) with the hostname mydevry2 and port number 2431. Write it to send the data over the socket connection to the server and read the text sent by the server back to the client. (Points : 30)

Question 3. Complete the following Java Applet program that will check whether the input value (integer) is even or odd.

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class CheckInput {

JLabelresultLbl;
JLabelinputLbl;
JTextFieldinputTxt;
JButton check;

public void init() {
JPanel panel = new JPanel(new GridLayout(4,2));
panel.add(new JLabel("Input:"));
inputTxt = new JTextField();
panel.add(inputTxt);
panel.add(new JLabel("Result:"));
resultLbl = new JLabel();
panel.add(resultLbl);
check = new JButton("Check");
panel.add(check);
check.addActionListener(this);
getContentPane().add(panel);
}
public void actionPerformed(ActionEvent arg0) {
}
}

Question 4.

a - Create a new cookie with the following information:

Name: userEmail
Value: [email protected]

b - Add the above cookie to the response header.

c - Retrieve the value of the above cookie from the list of all available cookies. (Points : 30)

Question 5. Write a program that will create two threads and will print out the following information:
o Thread 1:
M
N
o Thread 2:
P
R

Reference no: EM13804617

Questions Cloud

Write about effect of moderate alcohol consumption on fetuin : Write a research paper about "Effect of moderate alcohol consumption on fetuin-A levels in men and women: post-hoc analyses of three open-label randomized crossover trials".
Weight training program : Your task is to design your own weightlifting program using all the information and resources that are provided in this chapter for you. By following all the steps you will design a program that is especially designed for you.
Discuss about managing priorities : Managing Priorities
Different kinds of organisation and different country contex : Understand key contemporary labour market trends and their significance for different kinds of organisation and in different country contexts.
Write the required lines of code : Write the required lines of code that will create a ServerSocket object with a port number 3421 on which the server program is going to listen for client communications. Write the required lines of code that will create a new socket object
About communication channels : Communication Channels
Assignment on technology issues : Technology Issues
How can she increase the number of files : A Microsoft Word user noticed that another user in her department has more than four files listed in the recently used files list in the Files pull-down menu. How can she increase the number of files listed on her computer
Technology in online learning : Technology in Online Learning

Reviews

Write a Review

Programming Languages Questions & Answers

  Use of various bash commands

Assignment On: This work will require scripting the use of various bash commands and / or small programs that involve directory and file structures.

  Design pseudocode to enter names of two primary colors

Design a pseudocode program that prompts the user to enter the names of two primary colors to mix. If the user enters anything other than "red", "blue", or "yellow".

  Write application to inputs ten numbers from user

Write the application to inputs ten numbers from user, each number can be between 10 and 100, inclusive. As each number is read in determine if it is number already entered.

  Rewrite the extract.pl using bioperl

Rewrite the "extract.pl" using BioPerl, including the use of Bio::SeqIO to read the genome FASTA file ("mystery_seq1.fas") and the use of Bio::Seq for obtaining coding sequences and translating sequences.

  Write program to calculate distance and time hurricane take

Write C++ program that will calculate the distance and time it will take (days/hours) for hurricane to reach Ft. Lauderdale if: Hurricane is at coordinates 16 N, 64 W, just SE of South Fla. off in Atlantic, with a speed of 20 mph.

  Console application for a furniture company

Write a C# console application for a furniture company.  Ask the user to choose P for pine, O for oak, and M for mahogany. Show the price of a table manufactured with the chosen wood.

  Design employee objects-display each object-s yearly salary

Design two employee objects and display each object's yearly salary. Then provide each employee 10% raise and display each Employee's yearly salary again.

  Design a modularized body mass index program

Design a modularized Body Mass Index (BMI) Program which will calculate the BMI of a team player. The formula to calculate the BMI is as follows:

  Write the program which processes test data

Write the program which processes test data. Output must be student's ID, followed by answers, followed by test score, followed by test grade. Suppose the following grade scale.

  Modify the inventory program to use a gui

Modify the Inventory Program to use a GUI. The GUI should display the information one product at a time, including the item number, the name of the product

  Program that prompts the user to enter the mass of a person

Write a program that prompts the user to enter the mass of a person in kilograms and outputs the equivalent weight in pounds.

  Write a shell script to read students first names

Write a shell script that reads 5 students' first names, last names and grades and then it calculates the average, maximum and minimum grade.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd