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

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.
Input contains three integers N, L, X in each line

Line1
Brokerage rate
Line 2
Buying amount
Line 3
Selling amount
Line 4
Quantity

Assume STT to be fixed at 0.025%, Service Tax to be fixed at 10.36%, Stamp-duty on total turn-over is fixed at 0.002% and Regulatory charge on total turn-over is 0.004%

Output Format:

Print Profit or Loss as applicable with respect to transaction , and in next line print amount profit/loss faced

Line 1
For Valid Input,print
Profit
Or
Loss

For Invalid Input,print
Invalid Input
Line 2
For Valid Input,print
Amount of Profit / Loss faced in transaction

Sample Test Cases:

SNo. Input Output
1
0.03
315
316
100
Profit
67.42
1
0.03
315
@
100
Invalid Input
1
0.03
315
315.32
100
Loss
0.53
Given a square maze (A) of dimension N, every entry (Aij) in the maze is either an open cell 'O' or a wall 'X'. A rat can travel to its adjacent locations (left, right, top and bottom), but to reach a cell, it must be open. Given the locations of Rrats, can you find out whether all the rats can reach others or not?

Input Format:

Input will consist of three parts, viz.

1. Size of the maze (N)
2. The maze itself (A = N * N)
3. Number of rats (R)
4. Location of R rats (Xi, Yi)

Note:

(Xi,Yi) will represents the location of the i-th rat.
Locations are 1-index based.


Output Format:

Print "Yes" if the rats can reach each other, else print "No"

Constraints:

1<=N<=350
Aij = {'O','X'}
1<=R<=N*N
1<=Xi<=N
1<=Yi<=N
Alice and Bob are playing a game called "Stone Game". Stone game is a two-player game. Let N be the total number of stones. In each turn, a player can remove either one stone or four stones. The player who picks the last stone, wins. They follow the "Ladies First" norm. Hence Alice is always the one to make the first move. Your task is to find out whether Alice can win, if both play the game optimally.

Input Format:

First line starts with T, which is the number of test cases. Each test case will contain N number of stones.

Output Format:

Print "Yes" in the case Alice wins, else print "No".

Constraints:

1<=T<=1000
1<=N<=10000

Sample Input and Output

SNo. Input Output
1
3
1
6
7
Yes
Yes
No
TCS is working on a new project called "TestVita". There are N modules in the project. Each module (i) has completion time denoted in number of hours (Hi) and may depend on other modules. If Module x depends on Module y then one needs to complete y before x.
First line contains T, number of test cases.
For each test case:
First line contains N, number of modules.
Next N lines, each contain:
(i) Module ID
(Hi) Number of hours it takes to complete the module
(D) Set of module ids that i depends on - integers delimited by space.
Output Format:
Output the minimum number of hours required to deliver the project.
Constraints:
1. 1 <= T <= 10
2. 0 < N < 1000; number of modules
3. 0 < i <= N; module ID
4. 0 < Hi < 60; number of hours it takes to complete the module i
5. 0 <= |D| < N; number of dependencies
6. 0 < Dk <= N; module ID of dependencies.
Given text comprising of words and numbers, sort them both in ascending order and print them in a manner that a word is followed by a number. Words can be in upper or lower case. You have to convert them into lowercase and then sort and print them.
Input Format:

First line contains total number of test cases, denoted by N
Next N lines, each contains a text in which words are at odd position and numbers are at even position and are delimited by space
Output Format:

Words and numbers sorted in ascending order and printed in a manner that a word is followed by a number.
Constraints:
1. Text starts with a word
2. Count of words and numbers are the same.
3. Duplicate elements are not allowed
4. Words should be printed in lower case.
5. No special characters allowed in text.

Sample Input and Output

SNo. Input Output
1
2
Sagar 35 sanjay 12 ganesH 53 ramesh 19
Ganesh 59 suresh 19 rakesh 26 laliT 96
ganesh 12 ramesh 19 sagar 35 sanjay 53
ganesh 19 lalit 26 rakesh 59 suresh 96
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.
LATEST TUTORIALS
APPROVED BY CLIENTS