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

Three integer numbers (x,y,z)are known as Paty Triple if the three numbers satisfy the following criterion:

X^2 + Y^2 = Z^2

The first few triples are shown below.

Count X Y Z

1) 3 4 5
2) 5 12 13
3) 6 8 10
4) 7 24 25
5) 8 15 17


The program should generate all such numbers where X and Y are in the range 1 to 100 using the following guidelines:

Use a loop to generate the value for X in the range 1 to 100.
Now,use a nested loop to generate the values for Y. Your loop should not generate duplicates- for e.g.,(3,4,5) and (4,3,5) are the same.
Calculate the sum of the squares of the value X and Y.
Using the Math.sqrt method.calculate the square root of the above sum.The Math.sqrt method returns a double type.(For e..g, Math.sqrt(13) would return 3.6055…)
Cast the above double value to an integer,say Z. Now,check if the square of this integer is the same as the value from step (c)
If the
Help me with my code so if the tortilla chips is checked it should display its extras cost and description.

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

class MyProgram extends JFrame implements ActionListener{
public JCheckBox bp,tchips,csoup,cpasta,
gbread;
public JTextField itemcost;
public JTextArea itemdesc;
public JLabel idesc,icost,extras;
public MyProgram(){
Container pane=getContentPane();
pane.setLayout(null);

pane.add(extras=new JLabel("Extras"));
extras.setBounds(34,50,70,20);
pane.add(bp=new JCheckBox("Baked Potato"));
bp.setBounds(30,80,150,20);
bp.setOpaque(false);
//baked potato description: oven baked potato halves
//item cost: $4.00
pane.add(tchips=new JCheckBox("Tortilla Chips"));
tchips.setBounds(30,110,150,20);
tchips.setOpaque(false);
//Tortilla Chips description: light & crispy corn chips
//item cost: $10.90

pane.add(csoup=new JCheckBox("Chicken Soup"));
csoup.setBounds(30,140,150,20);
csoup.setOpaque(false);
//chicken soup description: with
Hi, Iam santosh, how can download videos from url like youtube video url or facebook videos urls in java
"Write a program that plays a word game with the user. The program should ask the user to enter the following:

His/her Name

His/her Age

Name of a City

Name of a College

A Profession

A Type of Animal

A Pet's Name

After the user has entered these items, the program shoulld display the following story, inserting the user's input into the appropriate locations:

There once was a person named NAME who lived in CITY. At the age of AGE, NAME went to college at COLLEGE. NAME graduated and went to work as a PROFESSION. Then, NAME adopted a(n) ANIMAL named PETNAME. They both lived happily every after!
Create an interface named Comparison whose method can be used to compare two Time object. The Method will include isGreater,isLess,and is Equal.
. Create an application that displays a series of at least four survey questions; the survey can be on any social or political topic you want, and each question should have at least three possible numeric-choice answers. At the end of the survey, use a dialog box to ask whether the user wants to (1) enter another set of responses to the same set of questions or (2) quit. Continue to accept sets of responses until the user chooses to quit, and then display the results of the survey for each question indicate how many users choose the first option, second option and so on

using JOptionpane
Some while ago, the European Union decreed that all traders in in the UK sell their goods by the kilo and not by the pound (1 kilo = 2.2 pounds). The following pseudo code has been arrived at in order to carry out this conversion:
BEGIN
DISPLY prompt for value in pounds
ENTER value to old value + 2.2
DISPLAY value in kilos
END

Implement this program, remembering to declare any variables that are necessary.

JAVA programming
A group of students have been told to get into teams of a specific size for their class work. design and implement a program that prompts for the number of students in the group and the size of the teams to be formed, and display how many teams can be formed and how many students are left without a team.
Problem : Super ASCII String Cost
A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets ('a'-'z') and the ascii values will starts from 1 (i.e ascii value of 'a' is 1 and 'z' is 26). Now given a string S, you can perform operations, namely, add, delete and replace of any character present in the string. Every operation will consists of following costs

add = 2 unit
replace = 1 unit
delete = 3 unit

Your task is to convert the string to super ascii with the minimum cost. While converting the string to super ascii, the final string should contain the same characters as in the input string.
Input Format:

First line starts with T i.e. number of test cases, and then T lines will follow each containing a string "S".
Output Format:

Print the minimum cost of conversion for each string to a Super Ascii string.
Constraints:
1<=T<=100
1<=|S|<=300, S will contains only lower case alphabets ('a'-'z').
Sample Input
Implement FLAMES game
F-Friend
L-Love
A-Affection
M-Marriage
E-Enemy
S-Sister
LATEST TUTORIALS
APPROVED BY CLIENTS