forked from AllenDowney/ThinkJavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleMethods.java
More file actions
38 lines (34 loc) · 991 Bytes
/
SimpleMethods.java
File metadata and controls
38 lines (34 loc) · 991 Bytes
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
import java.sql.SQLOutput;
public class SimpleMethods
{//This is the main method to assign values for 4-A and 4-B
public static void main(String[] args)
{//These are the variables for 4-A
printCount(5);
int count = 9;
printCount(count);
int someNumber = 3;
printCount(someNumber);
//These are the variables for 4-B
int num1 = 2;
int num2 = 4;
printSum(num1 + num2);
//These is the variable for 4-C
boolean isStudent=true;
printBoolean(isStudent);
}
//This is the method for 4-A
public static void printCount(int count)
{
System.out.println("The count is: " + count);
}
//This is the method for 4-B
public static void printSum(int sum)
{
System.out.println("The sum is: " + sum);
}
//This is the method for 4-C
public static void printBoolean (boolean isStudent)
{
System.out.println("I am a student: " + isStudent);
}
}