Module: Arithmetic expressions


Problem

2 /7


Arithmetic expressions

Theory Click to read/hide

The expression on the right side of the assignment epression allows you to calculate values using various formulas.

What expression can contain
• integer and real numbers (in real numbers, the integer and fractional parts are separated by a dot, not a comma, as is customary in mathematics)
• signs of arithmetic operators:
+ addition
- subtraction
* multiplication
/ division
% remainder of the division


• calls to standard functions through the Math class 
Math.abs(i) absolute value of i   \(|i|\)
Math.sqrt(x) \(\sqrt x\)
Math.pow(x,y) \(x^y\)
• parentheses to reorder

Problem

Write a program that calculates the value of the variable y according to the formula:
y=(1-x2+2,5x3+x4)2

The value of the variable x is set from the keyboard. Define the types of variables x and y yourself.
Display the value of the variable y on the screen