Assume that x is a variable that has been declared as an int and been given a value . Assume that oneMore is a function that receives a single integer parameter and returns a value that is one greater than its argument . (So if you pass 7 to oneMore it will return 8. Thus, the expression oneMore(9) has the value 10.

Assume that x is a variable that has been declared as an int and been given a value . Assume that oneMore is a function that receives a single integer parameter and returns a value that is one greater than its argument . (So if you pass 7 to oneMore it will return 8. Thus, the expression oneMore(9) has the value 10.

LANGUAGE: JAVA

CHALLENGE:

Assume that x is a variable that has been declared as an int and been given a value . Assume that oneMore is a function that receives a single integer parameter and returns a value that is one greater than its argument . (So if you pass 7 to oneMore it will return 8. Thus, the expression oneMore(9) has the value 10.

Write an expression whose value is four more than x without using the standard Java arithmetic operators (*,+, etc.). Instead, use calls to oneMore to accomplish this.

In this exercise you must write this as a single expression — you must not write any statements . Also, you may only use the oneMore function– no other functions or operators.

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days – Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level