-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmgwright_Multiple.java
48 lines (40 loc) · 1.17 KB
/
mgwright_Multiple.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Name : Matthew Wright
// Class : 1400-005
// Program # : 4
// Due Date : February 8th @ 12am
//
// Honor Pledge : On my honor as a student of the University of Nebraska
// at Omaha, I have neither given nor received
// unauthorized help on this homework assignment.
//
// NAME: Matthew Wright
// NUID: 832
// EMAIL: mgwright@mail.unomaha.edu
// Partners: NONE
// This program accepts a number and tells the user if it is even or odd and also if it is a multiple of 13
import java.util.Scanner;
public class mgwright_Multiple
{
public static void main ( String args[] )
{
//Declare Variables
int num1 = 13;
int num2;
//Instantiate Scanner
Scanner input = new Scanner( System.in );
//Accept user input and assign to variable
System.out.print("Please enter a non-negative (>= 0) integer (whole) number: ");
num2 = input.nextInt();
//Output num2
System.out.print(num2);
//Test to see if input is a multiple of 13 and if it is even or odd
if((num2 % num1) != 0)
System.out.print(":NOT");
if((num2 % num1) == 0)
System.out.print(":MULTIPLE");
if((num2 % 2) == 0)
System.out.println(":EVEN");
if((num2 % 2) == 1)
System.out.println(":ODD");
}
}