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

you have a single aircraft with 40 which flies between New York and London. the first 10 seats a first class while the rest are economy. passengers are required to make bookings for their flights. seats can be reserved and unavailable when paid for. implement the plane as a linked list of seats nodes, in java. seats can be added or removed from the plane as desired. this plane can then be checked if it is empty or full when making a reservation for a customer or if there is a desired seat available. implement an appropriate interface the user or clerk will be using to make these reservations. a reservation should have the traveler's details and the seats reserved and this information needs to be stored persistently. you are required to use a database. i just need the help with communicating with the database. just the explanation please .
Assume there is a triangle shape as..

(0,0)
(1,0) (1,1)
(2,0) (2,1) (2,2)
(3,0) (3,1) (3,2) (3,3)
(4,0) (4,1) (4,2) (4,3) (4,4)


So If I receive integers like
1 2 3

I want to store as 1 as

row[0] = 0;
col[0] = 0;

and 2 as


row[1] = 1;
col[1] = 0;

3 as follow.
row[2] = 1;
col[2] = 1;

public class Test {
public static void main(String[] args) {
int i, j;
for(i = 0; i < 5; i++) {
for(j = 0; j <= i; j++)
System.out.printf("(%d,%d)", i, j);
System.out.println();
}
}
}
Write a program that plays a word game with the user. The program should ask the user to enter the following:

His or her name
His or her age
The name of a city
The name of a college
A profession
A type of animal
A pet’s name


After the user has entered these items, the program should 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 ever after!

Prompts And Output Labels: There are no labels here but the prompts should simply be (respectively) "Enter your name: ", "Enter your age: ", "Enter the name of a city: ", "Enter the name of a college: ", "Enter tprofession: ", "Enter a type of animal: ", "Enter a pet name: ". Note that each prompt ends with a ":" followed by one space and is displayed so that the response will appear on the same
Write a program that displays the following pattern:

*
***
*****
*******
*****
***
*

Output. Seven lines of output as follows: The first consists of 3 spaces followed by a star. The second line consists of 2 spaces followed by a 3 stars. The third consists of one space followed by 5 stars, and the fourth consists just of 7 stars. The fifth line is identical to third, th sixth to the second and the seventh to the first.

CLASS NAMES. Your program class should be called StarPattern
getting error as "com.mysl.jdbc.Driver" when trying to run a simple programe named as iit registration
Create programs that, given a range of integers by its lower and upper limit, construct a list of all prime numbers in that range.
Hi, I retrieved 5 Employee Record of Data from Struts Action class to jsp with ajax response. But I don't how how can reserve this dynamic 5 employee records to struts action class. Plese tell me how to send this 5 employee records into struts action class.
kindly help me make a java program that will output 6 pets according to their type. It will first ask the user to enter the type of pet."c" or "d". if the user enters "c" , it will ask the user to enter name for the "cat", else will ask the user to enter name for dog. then output first all cats name, then followed by the list of all dogs name.
Design a currency Converter class in java whose object will handle conversion of three currencies (Dollar, Peso, Pound). A single object of the new currency Converter class you design here will handle all these three currencies. Instead of having specific conversion methods such as toDollar, toPound and so forth, the new currency Converter class supports one generic conversion method call exchange. The method has three arguments: fromCurrency, toCurrency and amount. The first two arguments are String and give the names of currencies. The third argument is the amount that need to be converted. For example, to convert RM250 to dollar, we write:

dollar = converter.exchange(‘peso”, “dollar”, 250.0);


To set the exchange rate for a currency, we use the setRate method. This method takes three arguments. The first two arguments are the currency names, and the third argument is the rate. For example, if the exchange rate for dollar is 2.1 Dollar to Peso1, then we write:

converter.setRate(“dollar”, “peso”, 2.1);

In addition, the class also have the following method:

updateRate (“fromCurrency”, “toCurrency”, newRate) - The first two arguments are the currency names, and the third argument is the new exchange rate.


Finally, test your program by creating its object in the main() method.
problem with run any import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import javax.swing.JOptionPane;

/**
An applet that lets a user choose a color by specifying
the fractions of red, green, and blue.
*/
public class ColorApplet extends Applet
{
public ColorApplet()
{
String input;

// ask the user for red, green, blue values

input = JOptionPane.showInputDialog("red:");
float red = Float.parseFloat(input);

input = JOptionPane.showInputDialog("green:");
float green = Float.parseFloat(input);

input = JOptionPane.showInputDialog("blue:");
float blue = Float.parseFloat(input);

fillColor = new Color(red, green, blue);
}

public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D)g;

// select color into graphics context

g2.setColor(fillColor);

// construct and fill a square whose center is
// the center of the window

Rectangle square = new Rectangle(
(getWidth() - SQUARE_LENGTH) / 2,
(getHeight() - SQUARE_LENGTH) / 2,
SQUARE
LATEST TUTORIALS
APPROVED BY CLIENTS