Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
labSessionTwo
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
9931069
labSessionTwo
Commits
b11720b9
Commit
b11720b9
authored
Mar 13, 2021
by
MostafaRahmati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
last question is not solved yet
parent
4aaca3fb
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
5 deletions
+15
-5
Lab.class
out/production/libSessionTwo/Lab.class
+0
-0
Run.class
out/production/libSessionTwo/Run.class
+0
-0
Student.class
out/production/libSessionTwo/Student.class
+0
-0
College.java
src/College.java
+11
-3
Lab.java
src/Lab.java
+4
-2
No files found.
out/production/libSessionTwo/Lab.class
View file @
b11720b9
No preview for this file type
out/production/libSessionTwo/Run.class
View file @
b11720b9
No preview for this file type
out/production/libSessionTwo/Student.class
View file @
b11720b9
No preview for this file type
src/College.java
View file @
b11720b9
...
...
@@ -29,6 +29,7 @@ public class College {
facultyLabs
=
new
Lab
[
labCount
];
Student
sampleStudent
=
new
Student
(
"Foo"
,
"Bar"
,
"99xxxxxx"
);
for
(
int
i
=
0
;
i
<
facultyLabs
.
length
;
i
++)
{
facultyLabs
[
i
]
=
new
Lab
(
5
,
"dAy oF cLaSs"
);
facultyLabs
[
i
].
enrollStudent
(
sampleStudent
);
}
}
...
...
@@ -39,8 +40,15 @@ public class College {
*/
public
void
print
(
int
i
){
if
(
i
>
facultyLabs
.
length
)
System
.
out
.
println
(
"Faculty Has Not That Lab Class"
);
else
System
.
out
.
println
(
"Faculty Has Not Lab Class No."
+
i
);
else
{
try
{
facultyLabs
[
i
-
1
].
print
();
}
catch
(
Exception
e
){
System
.
out
.
println
(
""
);
}
}
}
}
src/Lab.java
View file @
b11720b9
...
...
@@ -54,9 +54,11 @@ public class Lab {
*/
public
void
print
()
{
for
(
int
i
=
0
;
i
<
students
.
length
;
i
++)
{
if
(
students
[
i
]!=
null
){
System
.
out
.
println
(
"FirstName: "
+
students
[
i
].
getFirstName
()
+
"\tLastName: "
+
students
[
i
].
getLastName
()
+
"\t\tID:"
+
students
[
i
].
getId
()
+
"\t\tGrade:"
+
students
[
i
].
getGrade
());
}
}
calculateAvg
();
System
.
out
.
println
(
"AVERAGE GRADE: "
+
getAvg
());
}
...
...
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