Question: ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- 3a) Using only conditionals and relational operators, write the method smallest only that takes two numbers and returns the smallest positive one. If

 ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- 3a) Using only conditionals and relational operators, write the

-------------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------------------------

method smallest only that takes two numbers and returns the smallest positive

3a) Using only conditionals and relational operators, write the method smallest only that takes two numbers and returns the smallest positive one. If neither argument is positive, it returns 0. For example, smallest Positive (7,4) and smallest Positive (4,7) both return 4 smallest Positive (7, 4) and smallest Positive (-4,7) both return 7, and (6 marks) smallest Positive (-7 4) returns 0. returns the smallest positive of x and y or 0 for two non-positive arguments public int smallest Positive (int x, int y) 3b) using only logical (Boolean) operators, write the method mixture that takes three Booleans and returns true if and only if they contain at least one true and also at least One false. For example, mixture (true, false, false) and mixture (false, true, true) both return true but mixture (true, true, true) returns false. (4 marks) returns true iff x, y, z are a mixture of true and false public boolean mixture (boolean x, boolean y, boolean 7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!