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

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);


.




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. 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 for π.

. The last term in this sum, tn, will be the first term whose absolute value is less than 10 -10 2. A method called absoluteValue, which takes as its only parameter a value of type double, and returns a value of type double. The parameter represents an arbitrary number, and the value returned by the method represents the absolute value of this arbitrary number. The absolute value of a number x, denoted |x|, is x if x is greater than or equal to 0, and -x if x is less than 0. double value MathAssignment.absoluteValue(-42.0);


Calculate sin x using the following formula:


where t0 = x. To calculate the other terms in the sum, we use the following formula:


where ti is an arbitrary term, and ti+1 is the next term. For example:


A company is planning to provide an extra discount to it's customers. Every order has an order ID associated with it which is a sequence of digits. The discount is calculated as the count of unique repeating digits in the order ID. Write a code to find the discount percentile given to the customers.

A company is planning to provide an extra discount to it's customers. Every order has an order ID associated with it which is a sequence of digits. The discount is calculated as the count of unique repeating digits in the order ID. Write a code to find the discount percentile given to the customers.

Rewrite the following expressions using an if...else statement. (Assume that all variables are declared properly.)

a. (x < 5) ? y = 10 : y = 20;


Create a stack class in java where the stack is defined using an String type array and the size of the stack is provided by an instance variable. There should be an instance variable to track the top index of the stack. Define a constructor to initialize the size of the stack and the variable to track the top index of the stack. It is to be said that the minimum size of the stack should be 10. Define two methods void push(String item) and String pop() to conduct the insertion and deletion process in the stack. After filling up the stack with the maximum items possible, pop out 4 items from the stack and then output the sum of the remaining items in the stack.


A showroom announces the discount (on the total cost of the items purchased) as per slabs provided below:


Total Cost and Discount in percentage :

Less than Rs. 3000 = No Discount

Rs. 3001 to Rs. 6000 = 10%

Rs. 6001 to Rs.10000 = 25%

Above Rs. 10,000 = 40%


Write a program to input the total cost from the user in main function and calculate and display the total amount to be paid by the customer after availing the discount. Implement the program using Class and Object.


The function accepts two positive integers ‘r’ and ‘unit’ and a positive integer array ‘arr’ of size ‘n’ as its argument ‘r’ represents the number of rats present in an area, ‘unit’ is the amount of food each rat consumes and each ith element of array ‘arr’ represents the amount of food present in ‘i+1’ house number, where 0 <= i


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


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS