Java | JSP | JSF Answers

Questions answered by Experts: 3 611

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

Use a for loop to generate an array of ten random integers, all in the range from 100 to 200, inclusive. Use the Arrays class to both sort and display the entire array. Next, pass the array as the sole argument to a method that doubles each element of the array and then returns the array. Use a foreach loop to show all elements in the returned array on one line separated by a single space. This latter loop should also determine the sum of all elements in the returned array.
Write a class named Distance that contains the following two methods, then write a test program named TestDistance that uses just one loop to generate the table below. TestDistance should run both statiic methods below in the loop.
Write a program that generates a table showing the sine, cosine, and tangent for angles from 0 to 90 degrees. Each line in the table should increment the angle by 5 degrees. Include column headings.
Write a program that prompts the user for an even multiple of 29 that is under 50. Respond to the user's input as appropriate
Write a program that prompts the user for an even multiple of 29 that is under 50. Respond to the user's input as appropriate.
Hi there i am so sorry to bother with such a length question but i am unable to do it. I am struggling with the following question:

Once the user starts the thread by clicking a button, the program must choose a random image out of an image array, and display the image in the center. When the program starts, the user must be prompted for their name. The time must also be displayed (hh:mm) and must be part of the thread, to keep it updated. The pictures name must be displayed in the appropriate box. When the user stops the thread, the picture name must be cleared and the component in which the image was found must be set to a random color. The thread must also be stopped when the exit button is clicked.
i have an assignment to create a subject marks calculator in java netbeans, I've already done the GUI which includes the labels : mark, total, percentage, textfields for those 3. i have to find the percentage and the coding must be done in a calculate button and the percentage must appear in the percentage label when running the program. This is the code i have :

public static void main(String[] args){
int total, score;
float percentage;
Scanner inputNumScanner = new Scanner(System.in);

System.out.println("Enter the total, or max, score: ");
total = inputNumScanner.nextInt();

System.out.println("Enter the score obtained: ");
score = inputNumScanner.nextInt();

percentage = (score * 100/ total);

System.out.println("The percentage is = " + percentage + " %");
}

but the problem is that it is not appearing in the GUI.
1. encrypt the information word by word.
2.use the last alphabetic character in each word as the key for encrypting that word.
3.consider the value of each alphabetic character as its alphabetic position i.e.
a=A=1
b=B=2
and so on
z=Z=26
1.for every word use the last alphabetic charater in the world as the key.replace all the
alphabetic character in the word with new alphabetic characters formed by subtracting the key value
from each character.
2.key character(last alphabetic character in each word)should not be encrypted.
3.encryption should be performed only on alphabetic characters and not on non-alphabetic character
such as digits or special character.
4.all alphabetic characters should be preserved as uppercase in their respective position but should be replaced with the new character.
In a class room everyone is very friendly and has bonded with others in a short span of time. During the exams, students will sit along with their friends and will write the exams, which actually resulted in the finding that only a few members in the batch are good at studies and others are not. After getting several complaints from the staff members, the Principal has agreed to change the sitting pattern during the exams for which she has formed a committee. Using a spy, committee was able to get a list of close friends for all the students in the class. Now using this list they want to identify two groups of people such that a person in one group must not be a friend to any other in the same group. Your task is to help the committee
A Milkman serves milk in packaged bottles of varied sizes. The possible size of the bottles are {1, 5, 7 and 10} litres. He wants to supply desired quantity using as less bottles as possible irrespective of the size. Your objective is to help him find the minimum number of bottles required to supply the given demand of milk.

Input Format:

First line contains number of test cases N Next N lines, each contain a positive integer Li which corresponds to the demand of milk.

Output Format:

For each input Li, print the minimum number of bottles required to fulfill the demand

Constraints: 1 <= N <= 1000

Li > 0

1 <= i <= N

Sample Input and Output

SNo. Input Output 1
2 17 65

2 7
LATEST TUTORIALS
APPROVED BY CLIENTS