Answer to Question #324574 in Java | JSP | JSF for Michael Parenas

Question #324574

Create a short program that will generate a random number from 0 to 100 while using Math.random and Math.round command.


Submit your answers by attaching a screenshot of your program's source code and 3 screenshot of it's output.



1
Expert's answer
2022-04-06T10:14:52-0400


public class App {


	public static void main(String[] args) {
		int number = Math.round((int) (Math.random() * 100));
		System.out.println(number);
	}


}











Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS