Java | JSP | JSF Answers

Questions: 4 418

Answers by our Experts: 3 943

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Java socket related classes to create a dictionary client To get familiar with the socket library in Java,



• Establish a connection with a DICT server, and receive the initial welcome message.



• Finish a connection with a DICT server by sending a final QUIT message, receiving its reply, and closing the socket connection.



• Requesting, receiving, parsing and returning a list of databases used in the server. Each database corresponds to one dictionary that can be used to retrieve definitions from. Examples include one or more regular English dictionaries, a Thesaurus, an English-French dictionary, a dictionary of technical terms, a dictionary of acronyms, etc. In the interface, the user will have the option of selecting a specific database, or all databases.




Write a program to find sum middle 2 or 3 digits (if odd number of digits) of an entered number.

Example: for even number of digits

Input

4567

Output

5+6=11

2nd Example: for odd number of digits

Input

123

Output

2

3rd e.g.

Input

12345

2+3+4=9


monica has cooked n dishes and collected the data on the level of satisfaction for all the dishes from a guest. the guest returns an array, where the ith element of the array is the liking level of the ith dish. also, the time taken to cook the ith dish is i. like-to-time coefficient of a dish is calculated by multiplying the time taken to cook food with its liking level, i.e., input 2[i]. totally like-to-time coefficient is calculated by summing up all individual coefficients of dishes. you want the total like-to-time coefficient to be maximum. you can also remove some dishes, in which case, a new coefficient is calculated using the left dishes. find the maximum sum of all possible like-to-time coefficients.​

To write a java program that reads a file name from the user, displays information about whether the file exists, whether the file is readable, or writable, the type of file and the length of the file in bytes.


Write a program that calculates and prints the bill for a cellular telephone company. The company offers two types of service: regular and premium. Rates vary based on the type of service and are computed as follows: Regular service: $10.00 plus the first 50 minutes are free. Charges for over 50 minutes are $0.20 per minute. Premium service: $25.00 plus: a. For calls made from 6:00 a.m. to 6:00 p.m., the first 75 minutes are free; charges for over 75 minutes are $0.10 per minute. b. For calls made from 6:00 p.m. to 6:00 a.m., the first 100 minutes are free; charges for over 100 minutes are $0.05 per minute. Your program should prompt the user to enter an account number, a service code (type char), and the number of minutes the service was used. A service code of r or R means regular service; a service code of p or P means premium service. Treat any other character as an error. Your program should output the account number, type of service, number of minutes the telephone


 Display the Most Expensive Book

Displays the most expensive book from the list. For example, consider the following list of books:


Introduction to AI 1200.00 450

Reinforcement Learning 1300.99 1000

Deep Learning: Practical 1575.60 850

When we select the option, it displays the following output:

Deep Learning: Practical 1575.60 850


You may use the following header for this method:

static void showMostExpensive(String[][] books, int currentSize)


Write a program to take two strings as input then display the string which is longer. If both the strings are of same length then appropriate message will come using length().

Output:

Enter first String

Hello World

Enter second String

hello wOrLd

Both Strings are of same length


Question 1: Write a program that uses java.io.BufferReader to read the lines from the text file that is stored on disk. Handle the exceptions with following two ways:

1. Using try-catch-finally block

2. By throwing it up the call stack to the caller method.


Using ArrayList create a book borrowing system. Create ListBook.txt that list all the book information such as bookId, bookTitle, bookAuthor, bookGenre. 

  • Display all the book available from ListBook.txt
  • User can search the book that want to borrow by bookId or bookTitle
  • User can sort the book by bookGenre
  • count and display how many book user borrow
  • display the expected time the user should returned the book

Write a program to create 2 single dimension arrays in order to store 10 numbers respectively, then merge the values of both the arrays into third array so that the values of first array and second array will be alternate to each other, then display values of the merged array.

Alternate means third array will carry values of first and second arrays as follows:

c[0]=a[0]

c[1]=b[0]

c[2]=a[1]

c[3]=b[1]

c[4]=a[2]

c[5]=b[2]

c[6]=a[3]

c[7]=b[3]

..... where above digits are the index position not the values

Use java.util.* package and for loop.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS