Program that prompts the user to enter an integer for today’s day of the week (Sunday is 0, Monday is…
Program that generates two integers under 100 and prompts the user to enter the sum of these two integers.
1 2 |
/**<br /> *<br /> * @Author: Aghatise Osazuwa<br /> * Website: www.cscprogrammingtutorials.com<br /> */<br /><br />import java.util.Scanner;<br /><br />public class Ex03_04 {<br /> public static void main(String[] args) {<br /> int number1 = (int)(System.currentTimeMillis() % 100);<br /> int number2 = (int)(System.currentTimeMillis() / 7 % 100);<br /> Scanner input = new Scanner(System.in);<br /> System.out.print("What is " + number1 + " + " + number2 + "? ");<br /> int answer = input.nextInt();<br /> System.out.println(number1 + " + " + number2 + " = " + answer + " is " <br /> + (number1 + number2 == answer));<br /> } <br />}<br /> |
Sample runClick…
Android smartphones are very popular nowadays and they have so many various amazing functions. smartphone users are looking for smart…
Even though we may enjoy playing them ourselves, many parents worry about the impact of computer games on their child’s…
Facebook on Monday began testing a live audio streaming service that will let people essentially broadcast radio-style on the leading…