subject

Aprogrammer wants to define a method called myfunc() that takes a float type as an argument and returns an int type. when called as indicated below, the method call should result in a value of 3.0 for the variable z. float z = myfunc( 23f ); // method called from main() public static int myfunc( float x ) { /* … missing code segment … */ return result; } which of the following code segments will produce the correct result when substituted in the myfunc() method? i. int result = x / 7; ii. int result = (int) x / 7; iii. int result = x; result /= 7;

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:40, pnhandley01
Consider the simple 3-station assembly line illustrated below, where the 2 machines at station 1 are parallel, i. e., the product only needs to go through one of the 2 machines before proceeding to station 2.what is the throughput time of this process?
Answers: 2
image
Computers and Technology, 23.06.2019 02:30, bre563
Research data that is presented using descriptive language is said to be
Answers: 2
image
Computers and Technology, 23.06.2019 03:50, nakeytrag
Iam a bacterium. i cause stomach cramps and diarrhea. i am caused by eating rotten foodssuch as chicken, fish, or eggs. sometimes turtles carry my bacteria. what am i?
Answers: 2
image
Computers and Technology, 24.06.2019 01:00, bellamyciana
What are two ways to access the options for scaling and page orientation? click the home tab, then click alignment, or click the file tab. click the file tab, then click print, or click the page layout tab. click the page layout tab, or click the review tab. click the review tab, or click the home tab?
Answers: 2
You know the right answer?
Aprogrammer wants to define a method called myfunc() that takes a float type as an argument and retu...

Questions in other subjects:

Konu
Mathematics, 30.10.2020 07:20