-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFillInFunctions.java
More file actions
118 lines (91 loc) · 2.17 KB
/
Copy pathFillInFunctions.java
File metadata and controls
118 lines (91 loc) · 2.17 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import java.util.*;
public class FillInFunctions
{
public static void main( String[] args )
{
// Fill in the function calls where appropriate.
System.out.println("Watch as we demonstrate functions.");
System.out.println();
System.out.println("I'm going to get a random character from A-Z");
char c = '!';
Random c = new Random();
c = c.nextInt(Z);
System.out.println("The character is: " + c );
System.out.println();
System.out.println("Now let's count from -10 to 10");
int begin, end;
begin = -10;
end = 10;
for ) begin <= end; begin++ )
{ System.out.println(begin);
}
System.out.println("How was that?");
System.out.println();
System.out.println("Now we take the absolute value of a number.");
int x, y = 99;
x = -10;
// abso();
System.out.println("|" + x + "| = " + y );
System.out.println();
System.out.println("That's all. This program has been brought to you by:");
// credits();
}
/*
public static ???? credits( ???? )
// No parameters.
{
// displays some boilerplate text saying who wrote this program, etc.
System.out.println();
System.out.println("programmed by Graham Mitchell");
System.out.println("modified by [your name here]");
System.out.print("This code is distributed under the terms of the standard ");
System.out.println("BSD license. Do with it as you wish.");
return ??;
}
*/
/*
public static ???? randchar( ???? )
// No parameters.
{
// chooses a random character in the range "A" to "Z"
int numval;
char charval;
// pick a random number from 0 to 25
numval = (int)(Math.random()*26);
// now add that offset to the value of the letter 'A'
charval = (char) ('A' + numval);
return ??;
}
*/
/*
public static ???? counter( ???? )
// Parameters are:
// int start;
// int stop;
{
// counts from start to stop by ones
int ctr;
ctr = start;
while ( ctr <= stop )
{
System.out.print(ctr + " ");
ctr = ctr+1;
}
return ??;
}
*/
/*
public static ???? abso( ???? )
// Parameters are:
// int value;
{
// finds the absolute value of the parameter
int absval;
if ( value < 0 )
absval = -value;
else
absval = value;
return ??;
}
*/
}