Suppose x and y are variables of type double write a code


Problem

1. Suppose x and y are variables of type double. Write a code fragment that sets y to x if x is positive and to 0 otherwise.

2. Suppose x and y are variables of type double. Write a code fragment that sets y to the absolute value of x without calling the Math.abs function. Use an if statement.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Suppose x and y are variables of type double write a code
Reference No:- TGS02626347

Expected delivery within 24 Hours