Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ex1 programing 2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
elijah vasquez
ex1 programing 2
Commits
4d7c5ee8
Commit
4d7c5ee8
authored
Feb 14, 2022
by
elijah vasquez
🦍
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ver 3
parent
2301fc44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
App.java
src/App.java
+23
-6
No files found.
src/App.java
View file @
4d7c5ee8
...
...
@@ -3,11 +3,11 @@ public class App {
14/02/2022 Valentine's Day
Elijah Vasquez */
public
static
void
main
(
String
[]
args
)
throws
Exception
{
System
.
out
.
println
(
"Hello, World!"
);
// Ex 1
System
.
out
.
println
(
"Hello, World!"
);
// Exercise 2 - Variables
int
daysPerWeek
=
7
;
// Ex 2.1
int
numberOfWeeks
=
6
;
// Ex 2.2
int
totalDays
=
(
daysPerWeek
*
numberOfWeeks
);
// Ex 2.3
System
.
out
.
println
(
totalDays
);
...
...
@@ -19,18 +19,35 @@ public class App {
double
approxPI
=
3.14
;
// Ex 2.5
System
.
out
.
println
(
approxPI
*
2
*
3
);
// Ex 2.6
String
greetingString
=
"Hello"
;
// Ex 2.7
String
introductionString
=
"My name is Inigo Montoya"
;
// Ex 2.8
String
reminderString
=
"You killed my father"
;
// Ex 2.9
String
threatString
=
"Prepare to die!"
;
// Ex 2.10
System
.
out
.
println
(
greetingString
+
", "
+
introductionString
+
", "
+
reminderString
+
", "
+
threatString
);
reminderString
+
", "
+
threatString
);
int
fingersOnRightHand
=
6
;
// Exercise 4 - Branching - if then else
int
fingersOnRightHand
=
5
;
if
(
fingersOnRightHand
==
6
)
{
System
.
out
.
println
(
fingersOnRightHand
);
}
else
{
System
.
out
.
println
(
"I am searching for the man who killed my father."
);
}
// Exercise 5 - Branching - switch
int
month
=
1
;
// Exercise 6 - Looping - for loop
// Exercise 7 - Looping - while(), do{} while()
// Exercise 8 - Methods
// Exercise 9 - isItALeapYear()
// Exercise 10 - daysBetween()
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment