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
4aaca3fb
Commit
4aaca3fb
authored
Mar 13, 2021
by
MostafaRahmati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
last question is not solved yet
parent
fda8ae2b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
1 deletion
+52
-1
College.java
src/College.java
+46
-0
Run.java
src/Run.java
+6
-1
No files found.
src/College.java
0 → 100644
View file @
4aaca3fb
/**
* The Lab class represents a College class with all of labClasses and
* referred information
*
* @author SpNova
* @version 0.0
*/
public
class
College
{
// represents college name
private
String
name
;
// represents count of lab classes in the faculty
private
int
labCount
;
// represents the list of each faculty labs
private
Lab
[]
facultyLabs
;
/**
* @param name set name field of college
* @param labCount set lab count of the college
*/
public
College
(
String
name
,
int
labCount
){
this
.
name
=
name
;
this
.
labCount
=
labCount
;
}
/**
* initializes college class for test and debug purposes
*/
public
void
initialize
(){
facultyLabs
=
new
Lab
[
labCount
];
Student
sampleStudent
=
new
Student
(
"Foo"
,
"Bar"
,
"99xxxxxx"
);
for
(
int
i
=
0
;
i
<
facultyLabs
.
length
;
i
++)
{
facultyLabs
[
i
].
enrollStudent
(
sampleStudent
);
}
}
/**
* pass lab number you want to print its details
* @param i set lab number
*/
public
void
print
(
int
i
){
if
(
i
>
facultyLabs
.
length
)
System
.
out
.
println
(
"Faculty Has Not That Lab Class"
);
else
facultyLabs
[
i
-
1
].
print
();
}
}
src/Run.java
View file @
4aaca3fb
...
@@ -28,6 +28,11 @@ public class Run {
...
@@ -28,6 +28,11 @@ public class Run {
//DEBUGGING Question
//DEBUGGING Question
System
.
out
.
println
(
"-------------------------------------------------------\n"
);
System
.
out
.
println
(
"-------------------------------------------------------\n"
);
System
.
out
.
println
(
"The Problem Is That Lab Average Is Not Calculated And Called Before Printing"
);
System
.
out
.
println
(
"The Problem Is That Lab Average Is Not Calculated And Called Before Printing"
);
//College Class
College
c1
=
new
College
(
"Computer Engineering"
,
2
);
c1
.
initialize
();
c1
.
print
(
1
);
c1
.
print
(
2
);
c1
.
print
(
3
);
}
}
}
}
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