I have been stuck and having trouble
understanding this question for days and I keep getting errors with my code I am currently using Java with processing NOT PYTHON JAVA. This is a picture or the question and what the result is supposed to look like
Question 2: Create a sketch named Q2_TwoSeven_firstname. The purpose of this program is to determine which of two entered numbers is closest to 27 without going over. The program will start by asking the user/student for two numbers. Each number must be stored in an appropriately named variable. These numbers are passed to a function, described below. This function returns a single value. Print the message the value returned is # where the # is the value returned by the function. Write a function according to the following criteria: • accepts two integer parameters. • returns the value of the parameter that is nearest to 27 without going over. • returns zero if they both go parameters are greater than 27. • returns zero if either parameter is zero or a negative number or if both are negative. • Give your function an appropriate name based on the characteristics above.
1 Some examples you can use to test your function: Parameters Return Value 19, 27 27 27, 19 27 18,5 18 5, 18 18 19, 28 19 28, 19 19 18, 18 18 35, 32 0 28, 29 0 19,-1 0 -1, 19 0 -5, -2 0 18,0 0 0,9 0 0,0 0 01 1
Input ? Please enter number 1 OK Cancel
Input ? Please enter number 2 20 OK Cancel
х The value returned is 26
I have been stuck and having trouble understanding this question for days and I keep getting errors with my code I am cu
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
I have been stuck and having trouble understanding this question for days and I keep getting errors with my code I am cu
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!