Java | JSP | JSF Answers

Questions: 3 611

Answers by our 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 & Filtering

Create a class Employee with basic_sal as its data member. Write a program to calculate the gross pay of an employee, with the allowances provided below.

Dearness Allowance = 21% of the Basic Pay

House Rent Allowance = 12% of Basic Pay

Provident Fund = 6.45% of Basic Pay

Net Pay = Basic Pay + Dearness Allowance + House Rent Allowance

Gross Pay = Net Pay − Provident Fund


Implement the program using the concept of Single Inheritance


Please someone help me with this program i am too frustrated solving this


Write a program to take a String as input then display the number of x characters word has in ascending order.

Example:

Enter a String

China is world most populous country

Number of 2 characters word : 1

Number of 4 characters word : 1

Number of 5 characters word : 2

Number of 7 characters word : 1

Number of 8 characters word : 1

Here, ascending is 2,4,5,7,8 don't return like 5,2,4,8,7

Hint: length(), charAt(), indexOf(), compareTo(), substring(), equals() can be used.

Note: Array, Split function as well as ternary operators i.e. ? : are not to be used.


Plan, code and compile a BowlingLane class that will model a 5 Pin Bowling Lane. The bowling lane will have 5 pins which can be either upright or knocked down. Use 5 boolean variables to represent the pins. Next, create a client program that will:

  • instantiate a bowling lane object after prompting the user for the states of each of the 5 pins (up or down);
  • Display the bowling lane object to the user in a friendly way so they can clearly see which pins are up and which pins are down.
  • Using a separate method you must build into the bowling lane object, classify the lane configuration and display it to the user. The rules are as follows:
  • If pins 2 & 3 or 3 & 4 are down, display HS - Headsplit.
  • If pins 2, 3 & 4 are all down, display A - Aces.
  • If all the pins are down, display X - Strike.
  • display the sum of the pins that have been knocked down. NOTE! The pin values are different than the pin locations. Pins 1 & 5 are worth 2 points, pins 2 & 4 are worth 3 points, and pin 3 is worth 5 points.

Develop a Java program to compute and display all prime numbers between two numbers that the user enters(eg if the user enters 2 and 12 it displays 3,7,11 each in a new line. If the user enters the same numbera, program must keep giving an error message and prompting user to enter different numbers only. Use array to store numbers, use appropriate functions and control structures

The Fibonacci sequence is constructed by adding the last two numbers of the sequence so far to get the next number in the sequence. The first and the second numbers of the sequence are defined as 0 and 1. We get:

0, 1, 1, 2, 3, 5, 8, 13, 21…

 

Write a function which takes input as a number:

  • If the given number is a Fibonacci number, print the number
  • If the given number is NOT a Fibonacci number, print the sum of all odd Fibonacci numbers less than the given number.




Swati bought 600 shares of stock at a price of Rs 20 per share. She must pay her stock broker a 2% commission for the transaction.


Faizan and Hamza are brothers. In three years, Hamza will be five years younger than two time’s Faizan’s current age. Write a Java program to calculate and display Hamza’s age


Swati bought 600 shares of stock at a price of Rs 20 per share. She must pay her stock broker a 2% commission for the transaction.


Write a program that the display the following:

-The amount paid for the stock alone (without the commission)

-The amount of the commission

-The total amount paid 


A method called sine, which takes as its only parameter a value of type double, and returns a value

of type double. The parameter represents an angle expressed in radians, and the value returned by

the method represents the trigonometric sine of this angle. For example, suppose the following method

call is executed:


double sin = MathAssignment.sine(1.047197551);

After the execution of the above method call, the value stored in variable sin will be (approximately)

0.866025404, as the sine of 1.047197551 radians is approximately 0.866025404. The

sine of an angle x, denoted sin x, can be calculated using the following algorithm:

• If x < -π, repeatedly add 2π to x until -π ≤ x ≤ π. Conversely, if x > π, repeatedly subtract 2π

from x until -π ≤ x ≤ π. You MUST use 3.141592653589793 as a value


LATEST TUTORIALS
APPROVED BY CLIENTS