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:
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:
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