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

Create a Weight application that prompts the user for their gender (male or female) and their height and then determines their ideal body weight. The following formula is used to approximate ideal body weight:

men: Ideal Body Weight (in kilograms) = 50 + 2.3 kg per inch over 5 feet.
women: Ideal Body Weight (in kilograms) = 45.5 + 2.3 kg per inch over 5 feet.


import java.util.Scanner;
public class Body{
public static void main (String [] args){

Scanner keyboard = new Scanner(System.in);

System.out.println("Please enter your gender (Male/Female)");
String gender = keyboard.nextLine();

System.out.println("Please enter your height in inches");
double height = keyboard.nextDouble();

/* Fill in answer here
* idealWeight should your variable
*/

System.out.println("Your gender is: "+gender);
System.out.println("Your height is: "+height);
System.out.println("Your ideal weight is: "+idealWeight);
}
}
Write an appropriate decision statement to display You move to the next level. when the value of points is 150 or higher.
. Write a function to return a string that contains random characters where
the length must be equal to the value of the parameter. function(len)
Write a program that will accept an array of 10 integer (0-999) then prints a table the equivalent binary, octal
and hexadecimal.
Create a Program that will ask the user to enter a number n then display n3, (n+1)3,( n+2)3,… 5 times. Use any of the loop statement to implement the program.
Alice is throwing a party with N other guests, including Bob. Bob starts a rumor about Alice by telling it to one of the other guests. A person hearing this rumor for the first time will immediately tell it to one other guest, chosen at random from all the people at the party except Alice and the person from whom they heard it. If a person (including Bob) hears the rumor for a second time, he or she will not propagate it further. Write a program to estimate the probability that everyone at the party (except Alice) will hear the rumor before it stops propagating. Also calculate an estimate of the expected number of people to hear the rumor. For each line of the code, add comments.
Write a program that will accept an array of 10 integer (0-999) then prints a table the equivalent binary, octal and hexadecimal.
Provide a programming example in which multithreading does not provide better performance than a single-threaded solution
II. Write Java program that will accept an array of ten integers then copy all palindrome to another array named PALINDROME. Display the array PALINDROME.
A number is called a palindrome if number is equal to reverse of number e.g. 121 is palindrome because reverse of 121 is 121 itself. On the other hand 321 is not palindrome because reverse of 321 is 123 which is not equal to 321.


III. Write a program that will accept an array of 10 integer (0-999) then prints a table the equivalent binary, octal and hexadecimal.


IV. Create a Program that will ask the user to enter a number n then display n^3, (n+1)^3,( n+2)^3,… 5 times.
Use any of the loop statement to implement the program. 15 points
Sample Output #1:
Enter a number: 1
1 8 27 64 125
Have a nice day!!!!
Write a program that prints a table of all the Roman numeral equivalents of the decimal numbers in the range
1 to 100. Using any Loop statement.
LATEST TUTORIALS
APPROVED BY CLIENTS