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 to take a String as input then display the words and each character's position its below.

Example:

Enter a String

Elephant are large

12345678 91011 1213141516


: Write a java program that simulates a traffic light. The program lets the user select one of three lights: red, yellow, or green with radio buttons. On entering the choice, an appropriate message with “stop” or “ready” or “go” should appear in the console .Initially there is no message shown.


Create a class Teacher(Tid, Tname, Designation, Salary, Subject). Write a Java program to accept the details of ‘n’ teachers and display the details of teacher who is teaching Java Subject.(Use array of Object)


create a java program will concatenate the basic information of the students given the default variables name.



Hi my name is Dew C. Corpuz My Birhtday is on January 1 1997 I am 24 years old One of the student of BSIT

create a java program will concatenate the basic information of the students given the default variables name

Create a flowchart and a java program of the problem stated as follows. Create

user-defined methods that will perform 4 functionalities of an Automated Teller

Machine(Withdraw, Deposit, Transfer, Balance Check)

1. Withdraw (method name: withdraw)

* Input the amount to be withdrawn. Compute for the remaining balance after

the operation (balance = balance - withdrawn)

2. Deposit (method name: deposit)

* Input the amount to be deposited. Compute for the updated balance after

the operation (balance = balance + deposit)

3. Transfer (method name: transfer)

*Input the account number and the amount to be transferred. Compute for the

updated balance after the operation (balance = balance – moneySent)

4. Balance Check (method name: balanceCheck)

* Display the remaining balance.


There are two lists of numbers. Create a resultant list whose elements are the product of

the elements of the two lists.

Example: List A List B List C

21 30 630

50 10 500

.... .... ....


Write a Java program using a one-dimensional array that accepts as input an integer

value asking for the number of elements for each list. This will be used to generate random

numbers (5 to 69) for the one-dimensional arrays (List A and List B). The program will

compute for the product and store it in another array (List C). Display the result similar to

the Example above.


Create class named PIZZA. Data field include a string for toppings( such as pepperoni), an integer for diameter in inches(such as 12), and a double for price(such as 23.70).

Include methods to get and set values for each of these fields. 


B. Create an application name TESTPizza the intantiates one demonstrate the use of Pizza set and get methods.

Save the application TestPizza.java




import java.util.*;



class App {


public static void main(String[] args) {

Scanner in = new Scanner(System.in);

System.out.println("Enter a String: ");

String line = in.nextLine();

boolean space = true;

boolean first = false;

for (int i = 0; i < line.length(); i++) {

if (line.substring(i, i + 1).equals(" ")) {

System.out.print(line.substring(i, i + 1));

space = !space;

first = false;

} else if (space) {

if (!first) {

System.out.print(line.substring(i, i + 1) + ".");

first = true;

}

} else {

System.out.print(line.substring(i, i + 1));

}

}

System.out.println();

in.close();

}

}

Do the coding without using boolean, array and split


Create a java program that generates elements (randomly from 10 – 75) of a 2-dimensional array


(5x5) using the Random Class then perform the following:


1) Output the array elements


2) Output the sum of prime numbers in the array


3) Output the elements in the main diagonal.


4) Output the sum of the elements below the diagonal.


5) Output the sum of the elements above the diagonal.


6) Output the odd numbers below the diagonal.


7) Output the even numbers above the diagonal.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS