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

Use an example to briefly explain the features of a structured program.
Write the pseudocode for a program that will continue prompting a user for a value whilst the total of all values remain less than 100. The program must keep track of the number of times the loop executes and display the number of times the loop executed once the loop had finished executi
Write the pseudocode for an application that will:
a. Prompt a user for three numbers.
b. Store the values entered by a user in an array as they are provided by
the user.
c. Ask a user if they would like to search for a value:
i. If the user wishes to search for a value, the user needs to be
prompted for a value to search for. If the value is found, a
notification needs to be provided to the user.
d. Use a for loop to cycle through the arrays in order to calculate and
display the total of the values stored in the array.

The application should use a text file to capture the whole vehicle accidents data structure. To do this, add two methods to your center class:

1.    A method to save the content of the created Java structure into a text file.

2.    A method to restore the saved content back into an appropriate Java data structure for next run time.

Java provides a facility to create your own Exceptions which are basically derived classes of Exception. Write a class that defines a duplicate exception. The duplicate exception will be thrown if accidents are duplicated in the accidents list.


Design and implement a separate testing class to test the designed classes and check if classes meet the requirements.




By means of examples, explain what programming environments and users environments refer to.
Produce the equivalent 'for loop for the while loop. Make use of pseudo code to formulate
how do you write the pseudocode for an application that will:
a. Prompt a user for three numbers.
b. Store the values entered by a user in an array as they are provided by
the user.
c. Ask a user if they would like to search for a value:
i. If the user wishes to search for a value, the user needs to be
prompted for a value to search for. If the value is found, a
notification needs to be provided to the user.
d. Use a for loop to cycle through the arrays in order to calculate and
display the total of the values stored in the array

and how would you write pseudocode for a program that will continue prompting a user for a
value whilst the total of all values remain less than 100. The program must
keep track of the number of times the loop executes and display the number of
times the loop executed once the loop had finished executing.
how to draw item at home create a Java console program that uses println() statements to draw that item.
One way to determine how healthy a person is by measuring the body fat of
the person. The formulas to determine the body fat for female and male are
as follows:
Body fat formula for women:
A1 ¼ (Body weight  0.732) + 8.987
A2 ¼ Wrist measurement (at fullest point) / 3.140
A3 ¼ Waist measurement (at navel)  0.157
A4 ¼ Hip measurement (at fullest point)  0.249
A5 ¼ Forearm measurement (at fullest point)  0.434
B ¼ A1 + A2 – A3 – A4 + A5
246 | Chapter 4: Control Structures I: Selection
Body fat ¼ body weight – B
Body fat percentage ¼ body fat  100 / body weight
Body fat formula for men:
A1 ¼ (Body weight  1.082) + 94.42
A2 ¼ Waist measurement  4.15
B ¼ A1 – A2
Body fat ¼ body weight – B
Body fat percentage ¼ body fat  100 / body weight
Write a program to calculate the body fat of a person.
The roots of the quadratic equation ax
2 + bx + c ¼ 0, a 6¼ 0 are given by the
following formula:
b ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
b2 4ac p
2a
In this formula, the term b
2 4ac is called the discriminant. If b
2 4ac ¼ 0,
then the equation has a single (repeated) root. If b
2 4ac > 0, the equation
has two real roots. If b
2 4ac < 0, the equation has two complex roots.
Write a program that prompts the user to input the value of a (the
coefficient of x
2
), b (the coefficient of x), and c (the constant term), and
outputs the type of roots of the equation. Furthermore, if b
2 4ac  0, the
4
Programming Exercises | 243

program should output the roots of the quadratic equation. (Hint: Use the
method pow or sqrt from the class Math to calculate the square root.
Chapter 3 explains how to use these methods.)
Write a program that prompts the user to input three numbers. The
program should then output the numbers in nondescending order.
LATEST TUTORIALS
APPROVED BY CLIENTS