Compare the readability and writability of for loop in java

Assignment Help JAVA Programming
Reference no: EM131031713

Question 1 - Use the CreatePublicKeyPair program in the course material to create a key pair. Then use this key pair in the following network application:

• The server is waiting for requests at port 12345.

• The server is multithreaded so that a new thread is created for a new request.

• A client would first generate a random AES private key. Then, he/she will encrypt this key with the public key of the key pair and send it to the server. When the server receives this, it will first decrypt it with the private key. Then, the AES key will be used for encrypting later communication between the client and the server.

• When the client sends in a message, the server would reply according to the following:

o if the message is "How old are you?", the reply would be "About the same as you".
o if the message is "What are you up to now?", the reply would be "I am talking to you".
o if the message is "Bye", the replay would be "See you.". Then, the thread would end.
o if the message is anything else, the reply would be "I do not quite understand."

• The client would have the following GUI entities:

o A textarea for displaying the replies from the server;
o A textinput and a submit button for entering a message to be sent to the client.

• When the client close the client window, the server should take note of this (by catching an exception thrown) and then terminate the corresponding thread.

Write the client and server.

I suggest you to use writeObject in sending anything to and from the server. Note that when you open an ObjectInputStream and ObjectOutputStream on both client and server, please open the ObjectOutputStream first.

Question 2-

(a) Search the internet about the properties of the for loop in Ada, compare the readability, writability and reliability of the for loop in Ada and Java. Explain your answer.

(b) Java 5.0 provides looping on data structures as described in the course materials. State one situation when you do not want to use this feature in looping through a data structure.

Question 3- The longest phrase in the software life cycle is the maintenance phrase. Therefore, the cost of maintenance is a significant portion of the total cost of the software. Which of readability, writability and reliability of a language do you think is most important if you want to reduce the maintenance cost of a software? Explain your answer.

Question 4- The exception handling feature in Java is not available in early programming languages such as C. Do you think this feature can increase the readability, writability or reliability of Java? Explain your answer.

Question 5- Most modern languages allow the use of '_' as connectors in identifiers, e.g. my_type. However, COBOL uses '-' as connectors in identifiers, e.g. my-type. Do you thing that we should use '-' instead of '_' in Java?

Question 6-

(a) Describe the main use of a variant record type.

(b) Why it is not available in Java?

Reference no: EM131031713

Questions Cloud

Global logistics and supply chain management : What are the fundamental reasons for Dell's success? What should Dell do next to maintain its competitive advantage? Is its business model still viable? Will the Dell formula work elsewhere? If not, why not?
Mean absolute deviation-which forecast is the most accurate : Forecast A has a MAD (Mean Absolute Deviation) of 6.7. Forecast B has a MAD (Mean Absolute Deviation) of 5.5. Which forecast is the most accurate? Forecast Y has a MAPE (Mean Absolute Percent Error) of 9.8%. Forecast Z has a MAPE (Mean Absolute Perce..
How is practice enriching children learning : Did it help me see something in a new light/understand something I didn't know before? Eg how is practice enriching children's learning? What theories are you aware of that look at this
Recommended option breakeven : Finally, the investors ask that the recommended option breakeven in no more than 10 months. With these considerations in mind, the options are explained in subsequent paragraphs.
Compare the readability and writability of for loop in java : Search the internet about the properties of the for loop in Ada, compare the readability, writability and reliability of the for loop in Ada and Java. Explain your answer
Write a pages eassy for accounting class : Write a pages eassy for accounting class. General Ledger Software: As part of the class, students will be assigned to obtain an understanding of accounting related soft-wares.
The daily demands for a typical product : As part of the analysis, the daily demands for a typical product (Product 1) over the past six months have been collected and provided in the spreadsheet. You are asked to determine the total safety stock reduction if the warehouses are consolidated ..
Produce a dat file based on transactions : To help you out with this task, I am providing a file Indexed-to-Sequential-Conversion.cbl that, when properly embedded in a project, will convert an indexed file (which is not readable with a text editor) into a sequential file.
Determining the general fund resources : When equipment was purchased with general fund resources, which of the following accounts would have been increased in the general fund?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Provide java code to create and initialize an array

Provide Java code to create and initialize an array of integers (Java primitive int), floats or any other Java primitive type of your choice. You pick the array name and length.

  Algorithm analysis with advanced data structures

Write a program to help the merchants devise a sequence of transmutations that would change silver into gold with the smallest possible total fee paid to the alchemists.

  An elementary calculation yields the result

An elementary calculation yields the result that theoretically, the probability of turning up 7 when two dice are thrown is 1/6, or .166666. But what if more dice are thrown? If 3 dice are thrown, what is the probability that some 2 of three sum to 7..

  Difference between the abstract class and interface

1. What is the difference between the Abstract Class and Interface.2. Write a java Program that counts number of words in each line of the file.

  Write a short java application

You will write a short Java application that will accept five strings from the user. Each String will be a word in a sentence.

  Write java program to simulate a ecosystem

Write a java program to simulate an ecosystem containing two types of creatures, bears andfish. The ecosystem consists of a river, which is modeled as a relatively large array. Each cell of array should contain an Animal object, which can be a Bea..

  Explain how the loop displaying the menu

Explain how the loop displaying the menu is exited, what value does menuSel have when the program finishes? Describe what happens next when menuSel gets this value.

  Achieving simplicity and merely being simplistic

What is the difference between achieving simplicity and merely being simplistic?

  Write a program that creates a two-dimensional array

Write a program that creates a two-dimensional (2D) array initialized with test data (for instance, use Random method to prepare an array of integers).

  Writing a program to calculate the terms

The third programming project involves writing a program to calculate the terms of the following sequence of numbers: 0 1 2 5 12 29 ... where each term of the sequence is twice the previous term plus the second previous term. The 0th term of the s..

  Write a program that creates an apartment object and prompts

Create a structure named Apartment that contains data fields to hold the number of bedrooms, the number of bathrooms, and the monthly rent for the apartment.

  Accepts a binary number from the user

Write a Java test program that accepts a binary number from the user. You should store the binary number in a String. Your program should then use afor loop to sequence through every character in the String, counting the number of ones, zeros, and..

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