Java | JSP | JSF Answers

Questions answered by Experts: 3 611

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

write a java application to calculate the exponent value of a number using the following specifications:
.prompt the user to enter an interger value
.pass the interger value to the method square, which squares the number and to a method cubes the number. The result must be returned to the main method.
The main method must print the results along with a suitable message
Hello! How can I measure time of executing of this program? Thanks!

package hanoi;

public class Test {

/**
* @param args
*/
public static void main(String[] args) {
final byte size = 35;
Tower t = new Tower(size);
t.MoveTower(size, 1, 3, 2);
System.out.println(t.getSteps());
System.out.println(Math.pow(2, size) - 1);
}

}
Design and implement an application that performs flashcard testing of simple mathematical problems. Allow the user to pick the category. Repetitively display a problem and get the user’s answer. Indicate whether the user’s answer is right or wrong for each problem, and display an ongoing score.
Does quicksort use more comparisons than merge sort? Why is it faster if it uses more comparisons?
You are to write a program to compute grades for computing program. Your program
should perform the following;
1. Accept input (in marks) from users
2. Calculate final mark taking into account exam and incourse marks as follows;
a. System must prompt the user for one’s name, student id, exam and incourse
marks. [You may assume the weightage for exam and incourse is 50%
respectively]
b. Display final mark (see 3(b) for other conditions)
3. Display final grade
a. The possible grades are:
0 <= average mark < 50 - NN
50 <= average mark < 60 - PA
60 <= average mark < 70 - CR
70 <= average mark < 80 - DI
80 <= average mark <= 100 - HD
b. A student would have failed if marks obtained is less than 50 for either the exam
or incourse component in which case the final mark for the student would be the
lower of the two.
Example:
Exam Mark (%): 40
Incourse Mark (%): 60
Final Mark (%): 40
Problem 2.
2.1.Make a program that allows you to create a 3 X 4 integer array. Your program will initialize the array with random numbers from 0 to 1000. Your program also will identify and display the largest value, smallest value, sum and average value of all data in the array.
Read a positive integer n. From 1 to n monitor the occurrence of 1. Your program should contain the method Monitor1. Include an option to repeat the process.

Sample Output
Enter the value of n: 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Total Occurrence of 1: 8

Try again Y/N?
1) write a method called larger that accepts two floating point parameters (of type double) and returns true if the first parameter is greater than the second, and false otherwise.

2)write a method called sumRange that accepts two integer parameters representing a range. Issue an error message and return zero if the second parameter is less than the first. Otherwise, the method should return the sum of the integers in the range, inclusive.
Write a main program class that instantiates a Deck and several Card
objects and calls each of their methods. The purpose of this class is to verify that
your supporting classes work correctly.
Use a one-dimensional array to solve the following problem: A company pays its salespeople on a commission basis. the salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who grosses $5000 in sales in a week receives $200 plus 9% of the $5000, or a total of $650. Write an application (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson's salary in truncated to an integer amount):
750, 1200, 5000, 7575, 10000, 9250, 12500, 3560, and 4800.
LATEST TUTORIALS
APPROVED BY CLIENTS