1. What is the value of "d" after this line of code has been executed? double d = Math.round ( 2.5 + Math.random() );





Ask Your Doubts Here

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

  • By: guest on 02 Jun 2017 01.26 am
    The Math.random() method returns a number greater than or equal to 0 and less than 1 . Since we can then be sure that the sum of that number and 2.5 will be greater than or equal to 2.5 and less than 3.5, we can be sure that Math.round() will round that number to 3. So Option B is the answer.
Show Similar Question And Answers
QA->At his usual rowing rate, Rahul can travel 12 miles downstream in a certain river in 6 hrs less than it takes him to travel the same distance upstream. But if he could double his usual rowing rate for this 24 mile round trip, the downstream 12 miles would then take only one hour less than the upstream 12 miles. What is the speed of the current in miles per hour?....
QA->At his usual rowing rate, Ram can travel 12 miles downstream in a certain river in 6 hrs less than it takes him to travel the same distance upstream. But if he could double his usual rowing rate for this 24 mile round trip, the downstream 12 miles would then take only one hour less than the upstream 12 miles. What is the speed of the current in miles per hour?....
QA->When Italy surrendered after the Second World War in 1945 Mussolini was captured and executed at?....
QA->What is the temperature at which the speed of sound in air becomes double its value of °C?....
QA->The only state in India where uniform civil code has been implemented?....
MCQ->What will be the output of the following program? #include<iostream.h> double BixFunction(double, double, double = 0, double = 0, double = 0); int main() { double d = 2.3; cout<< BixFunction(d, 7) << " "; cout<< BixFunction(d, 7, 6) << endl; return 0; } double BixFunction(double x, double p, double q, double r, double s) { return p +(q +(r + s x) x) x; }....
MCQ->What is the value of "d" after this line of code has been executed? double d = Math.round ( 2.5 + Math.random() );

....
MCQ->Which of the following are valid calls to Math.max? Math.max(1,4) Math.max(2.3, 5) Math.max(1, 3, 5, 7) Math.max(-1.5, -2.8f)....
MCQ->Which of the following are NOT true about .NET Framework? It provides a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely. It provides a code-execution environment that minimizes software deployment and versioning conflicts. It provides a code-execution environment that promotes safe execution of code, including code created by an unknown or semi-trusted third party. It provides different programming models for Windows-based applications and Web-based applications. It provides an event driven programming model for building Windows Device Drivers.....
MCQ->interface DoMath { double getArea(int rad); } interface MathPlus { double getVol(int b, int h); } / Missing Statements ? / which two code fragments inserted at end of the program, will allow to compile? class AllMath extends DoMath { double getArea(int r); } interface AllMath implements MathPlus { double getVol(int x, int y); } interface AllMath extends DoMath { float getAvg(int h, int l); } class AllMath implements MathPlus { double getArea(int rad); } abstract class AllMath implements DoMath, MathPlus { public double getArea(int rad) { return rad rad 3.14; } }....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution