Java Mathematical Expressions Notes On 19-9-20 Class9 PDF
Java Mathematical Expressions Notes On 19-9-20 Class9 PDF
like positive numbers result but if the value is -0.5 then it rounds off to
nearest lower integer unlike 0.5
EX: (Negative numbers)
System.out.println( " round with negative="+Math.round(-1.5));//-1
System.out.println( " round with negative="+Math.round(-1.9));//-2
System.out.println( " round with negative="+Math.round(-1.2));//-1
(Positive numbers)
(n)
ICSE BASED QUESTIONS
REFER PAGES FROM 161 TO 164 FROM TB for assignments
H.W
Write down the following expressions in Java:
(b) a2 + b3 + c4
(c) (a + b)2
ab
(d) ∛(mn) + mn 3
Programs:
1.Write a program to calculate the value of the given expression:
1 + 2 + 3
a2 b2 c 2
2. The standard form of quadratic equation is represented as:
ax2 + bx + c = 0
where d= b2 - 4ac, known as 'Discriminant' of the equation.
Write a program to input the values of a, b and c.
Calculate the value of discriminant and display the output to the
nearest whole number.
If roots are imaginary d= -b ± √b2-4ac
2a