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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
List the five on-board vehicle subsystems
Answers: 1
question
Computers and Technology, 22.06.2019 21:40
Develop a function to create a document in the mongodb database “city” in the collection “inspections.” be sure it can handle error conditions gracefully. a. input -> argument to function will be set of key/value pairs in the data type acceptable to the mongodb driver insert api call b. return -> true if successful insert else false (require a screenshot)
Answers: 2
question
Computers and Technology, 24.06.2019 01:10
Create a program that will take in a single x and y coordinate as the origin. after the input is provided, the output should be all of the coordinates (all 26 coordinates read from the “coordinates.json” file), in order of closest-to-farthest from the origin.
Answers: 1
question
Computers and Technology, 24.06.2019 13:50
Write a program that performs a simple n-body simulation, called "jumping leprechauns." this simulation involves n leprechauns, numberd 1 to n. it maintains a gold value g_i for each leprechaun i, which begins with each leprechaun starting out with a million dollars worth of gold, that is, g_i = 1000000 for each i = 1,. in addition, the simulation also maintains, for each leprachaun,i, a place on the horizon, which is represented as a double-precision floating point number, x_i. in each iteration of the simulation, the simulation processes the leprachauns in order. processing a leprachaun i during its iteration begins by computing a new place on the horizon for i, which is determined by the assignment:
Answers: 3
You know the right answer?
Aprogrammer wants to define a method called myfunc() that takes a float type as an argument and retu...
Questions
question
Mathematics, 04.07.2019 02:00
question
Mathematics, 04.07.2019 02:00
question
English, 04.07.2019 02:00
Questions on the website: 13722361