Nội dung text Assignment 02- Branching
Question: 5 It’s 11:59 PM, and Harun is desperately trying to finish a math assignment before the deadline. The final question involves a strange piecewise function, and Harun needs to write a program to verify the answers before submitting. The function is defined as follows: Your task is to help Harun by writing a Java program that takes the value of x as input from the user and displays the corresponding value of f(x) according to the formula. Sample Input Output -3 output: -6 1 output: 2 4 output: 15 10 output: 302