Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit69ed9e5

Browse files
author
roesnera
committed
Create file structure and four classes in practice package
0 parents  commit69ed9e5

File tree

12 files changed

+755
-0
lines changed

12 files changed

+755
-0
lines changed

‎.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎.idea/dbnavigator.xml

Lines changed: 462 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎.idea/uiDesigner.xml

Lines changed: 124 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎JavaIntro1Debrief.iml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<moduletype="JAVA_MODULE"version="4">
3+
<componentname="NewModuleRootManager"inherit-compiler-output="true">
4+
<exclude-output />
5+
<contenturl="file://$MODULE_DIR$">
6+
<sourceFolderurl="file://$MODULE_DIR$/src"isTestSource="false" />
7+
</content>
8+
<orderEntrytype="inheritedJdk" />
9+
<orderEntrytype="sourceFolder"forTests="false" />
10+
</component>
11+
</module>
Binary file not shown.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
packagecom.example.practice;
2+
3+
publicclassCompoundAssignment {
4+
publicstaticvoidmain(String[]args) {
5+
/*
6+
COMPOUND ASSIGNMENT
7+
in this section, we will work with our compound assignment operators
8+
(+=, -=, *=, /=, %=)
9+
10+
declare an integer variable with the value of 1
11+
then, using compound assignment and the System.out.println() operation to check your results,
12+
complete the following steps in order:
13+
1. add 3 to your variable
14+
2. multiply your variable by 4
15+
3. subtract 8 from your variable
16+
4. divide your variable by 2
17+
5. modulus your variable by 3
18+
19+
the final result should be a variable that holds the original value of 1
20+
*/
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
33+
}
34+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
packagecom.example.practice;
2+
3+
publicclassIncAndDec {
4+
publicstaticvoidmain(String[]args) {
5+
/*
6+
INCREMENTING AND DECREMENTING
7+
in this section, we will apply the increment and decrement operators
8+
9+
1. Create an integer variable that stores the value 10
10+
11+
2. using System.out.println(), output "Initial value: " followed by the value of this variable
12+
13+
3. then use the increment operator on this variable
14+
followed by another System.out.println() call with the output "Value after incrementation: "
15+
followed by the value of the variable
16+
17+
4. Then repeat step 3 with the decrement operator
18+
(make sure to adjust the string output appropriately)
19+
20+
21+
*/
22+
23+
24+
25+
26+
27+
28+
29+
30+
}
31+
}

‎src/com/example/practice/MathOps.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
packagecom.example.practice;
2+
3+
publicclassMathOps {
4+
publicstaticvoidmain(String[]args) {
5+
/*
6+
MATH OPERATIONS
7+
in this section, we will use basic math operations on number variables
8+
9+
1. Create two variables of the same data type
10+
you may select any of the following data types:
11+
(int, float, double)
12+
13+
2. then, using System.out.println(),
14+
print out the values resulting from performing each of the five basic math operations on them
15+
(+, -, *, /, %)
16+
*/
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
28+
29+
}
30+
}

‎src/com/example/practice/Sout.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
packagecom.example.practice;
2+
3+
4+
/*
5+
SHORTCUTS:
6+
main - public static void main(String[] args) {}
7+
sout - System.out.println()
8+
(windows) ctrl + j - shows a list of keyboard shortcuts
9+
(mac) cmd + j - shows a list of keyboard shortcuts
10+
*/
11+
12+
publicclassSout {
13+
publicstaticvoidmain(String[]args) {
14+
System.out.println("Hello, world!");
15+
// declare and define a variable of each of the 8 primitive data types in Java
16+
// (byte, short, int, long, float, double, boolean, char)
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
// use System.out.println() to display the values of each variable to the system
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
}
40+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp