Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- import java.util.Scanner;
- public class Main {
- static Random rand = new Random();
- static Scanner in = new Scanner(System.in);
- public static void main(String[] args) {
- tar1();
- }
- private static void tar2() {
- int iGrade;
- iGrade = rand.nextInt(101);
- if (iGrade < 55)
- {
- System.err.println("You failed the course!");
- }
- else if ()
- {
- }
- }
- private static void tar1() {
- int iNum1,iNum2,iNum3;
- iNum1 = rand.nextInt(5)+3;
- iNum2 = rand.nextInt(5)+3;
- iNum3 = rand.nextInt(5)+3;
- System.out.println("The first random number is: " + iNum1 + "\nThe second random number is: " + iNum2 + "\nThe third random number is: " + iNum3);
- System.out.println("The sum of all three numbers is: " + (iNum1+iNum2+iNum3));
- System.out.println("The multiplication of all three numbers is: " + (iNum1*iNum2*iNum3));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement