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

Body Mass Index (BMI) is one of the criteria that is used to calculate whether one is fit or not basing on a person’s height (m) and weight (kg). The criterion is very simple; if one’s BMI is 25 or greater, it signifies overweight. A BMI less or equal to 18.5 indicates underweight. Lastly, a BMI greater than 30 shows obesity.

You have been requested to create a program that that helps the Namibian Defence Forces’ (NDF) Captain to calculates the BMI of a person (BMI = weight/height2) and also determine whether the person has also completed running 10 km in the required time. Men should complete 10km in less than 60 minutes for them to be accepted. Women should do that under 80 minutes. Both males and females are accepted if their BMI is less than 25 and greater than 18.5. For 2018 intake, there are already 6 males selected and 1 female. The values for gender, mass and weight are enter by user inputs


Write a java program that specifies three parallel one dimensional arrays name length, width, and area. Each array should be capable of holding a number elements provided by user input. Using a for loop input values for length and width arrays. The entries in the area arrays should be the corresponding values in the length and width arrays (thus, area[i] =  length [i]* width [i]) after data has been entered display the following output:



Using a do-while loop create a program that will prompt the user for a number and then print out a list 5 odd numbers above the given number(inclusive).

input: -25

output: -25 -23 -21 -19 -17

Create a do-while loop that ask the user to enter two numbers. The numbers should be added and sum displayed. The loop should ask whether the user he or she wishes to perform the operation again. If so the loop should repeat; otherwise it should terminate


Create a program that takes in a student first name and average mark obtained, the system should the group the students using the first vowel in their name. For example if the student name is Jena, then the student belongs to group E and if the name was Jack then the student belongs to group A[HINT: Make use of the indexOf() and contains() methods from the string class]. The program should further categorize the mark is follows:

 

 Marks obtained

Grade Level

Message

80 – 100

1

Magnificent!!

70 – 79

2

Excellent!!

60 – 69

3

Good work!!

50 – 59

4

Good!!

0 – 49


Fail – Try again next Year!!

Greater than 100 or

less than 0

X

Invalid Marks!!, Marks too high. Or Invalid Marks!!, Negative marks not allowed.

 

Sample run 1:

Enter student full names: Johnathan

Enter average mark obtained: 88

Output: Hi Johnathan, you were placed in group O

Grade Level: 1

Comment: Magnificent!!

Create a program that takes in a student first name, the system should the group the students using the first letter in their name modulus 10 [ Remember that characters are considered as numeric values, hence ‘J’%10 is a valid calculation ]. For example if the student name is Cena, then the student belongs to group 7 because ‘C’%10 = 7 and if the name was Jack then the student belongs to group 4. The program should further use the group number to get the group lecturer and class date as follows: [Hint: If the result is 0 then the student belongs to group 10]

 

 

 Groups

Group Lecturer

Class date

1 , 7, 9

Mr. V. Paduri

Monday

2 , 4, 5

Ms. N. Nashandi

Wednesday

3, 6, 10

Mr. S. Tjiraso

Friday

 


Create a for loop program that prompts a user for two integers. If the second integer is greater than the first one, your program should then display multiples of the first integer up till the product of the two entered values. If the second integer is smaller than the first, your program displays error.

Sample Run 1   Enter integer1: 2   Enter integer2: 5  Output 1: multiples = 2 4 6 8 10                        




Using a while loop create a program that will prompts the user for two numbers and then print out a list of all the numbers between the given numbers (inclusive) squared.

Sample Run1

Enter two numbers: 4 8

Output1: List = 16 25 36 49 64 

Sample Run2

Enter two numbers: -2 -6

Output2: List = 36 25 16 9 4

Using a while loop create a program that will prompt the user for a positive number and then print out a multiplication list of all the between the given number and one(inclusive), These are referred to as the factorial and it is only applicable for positive numbers, see link for more info(https://en.wikipedia.org/wiki/Factorial)

Sample Run1

Enter a number: 4

Output1: Result = 4 x 3 x 2 x 1 = 24

Sample Run2

Enter a number: -6




Using a for loop create a program that will prompts the user for two numbers and then print out a summation list of all the between the two given numbers, starting from the small number to the big number. For negative numbers use brackets when printing the summation

Sample Run1

Enter two numbers: 1 10

Output1: Sum = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55

Sample Run2

Enter two numbers: -3 3

Output2: Sum = (-3) + (-2) + (-1) + 0 + 1 + 2 + 3 = 0

LATEST TUTORIALS
APPROVED BY CLIENTS