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
2301fc44
Commit
2301fc44
authored
Feb 14, 2022
by
elijah vasquez
🦍
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace App.java
parent
a93e9f62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
30 deletions
+33
-30
App.java
src/App.java
+33
-30
No files found.
src/App.java
View file @
2301fc44
public
class
App
{
/* Exercises for Week 2 Programming 2
14/02/2022 Valentine's Day
Elijah Vasquez */
public
static
void
main
(
String
[]
args
)
throws
Exception
{
System
.
out
.
println
(
"Hello, World!"
);
// Ex 1
int
daysPerWeek
=
7
;
// Ex 2.1
int
numberOfWeeks
=
6
;
// Ex 2.2
int
totalDays
=
(
daysPerWeek
*
numberOfWeeks
);
// Ex 2.3
System
.
out
.
println
(
totalDays
);
boolean
onHoliday
=
false
;
// Ex 2.4
if
(
onHoliday
==
false
)
{
System
.
out
.
println
(
"You are not on holiday."
);
/* Exercises for Week 2 Programming 2
14/02/2022 Valentine's Day
Elijah Vasquez */
public
static
void
main
(
String
[]
args
)
throws
Exception
{
System
.
out
.
println
(
"Hello, World!"
);
// Ex 1
int
daysPerWeek
=
7
;
// Ex 2.1
int
numberOfWeeks
=
6
;
// Ex 2.2
int
totalDays
=
(
daysPerWeek
*
numberOfWeeks
);
// Ex 2.3
System
.
out
.
println
(
totalDays
);
boolean
onHoliday
=
false
;
// Ex 2.4
if
(
onHoliday
==
false
)
{
System
.
out
.
println
(
"You are not on holiday."
);
}
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
);
int
fingersOnRightHand
=
6
;
if
(
fingersOnRightHand
==
6
)
{
System
.
out
.
println
(
fingersOnRightHand
);
}
}
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
);
int
fingersOnRightHand
=
5
;
}
}
\ 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