Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
9
9831017-Va-9831133-Jalase-2_-Grouh-Shanbe_Soal Safheye 6 Dastor Kar
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
9831017
9831017-Va-9831133-Jalase-2_-Grouh-Shanbe_Soal Safheye 6 Dastor Kar
Commits
71065744
Commit
71065744
authored
Mar 05, 2020
by
9831017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
edd6fd2c
Pipeline
#2107
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
Lab.java
Lab.java
+54
-0
No files found.
Lab.java
0 → 100644
View file @
71065744
public
class
Lab
{
private
Student
[]
students
;
private
int
avg
;
private
String
day
;
private
int
capacity
;
private
int
currentSize
;
public
Lab
(
int
cap
,
String
d
){
capacity
=
cap
;
day
=
d
;
currentSize
=
0
;
}
public
void
calculateavg
(){
int
x
;
int
sum
=
0
;
for
(
int
i
=
0
;
i
<
3
;
i
++){
x
=
students
[
i
].
getGrade
();
sum
=
sum
+
x
;
}
avg
=
sum
/
3
;
}
public
void
enrollStudent
(
Student
std
)
{
if
(
currentSize
<
capacity
)
{
students
[
currentSize
]
=
std
;
currentSize
++;
}
else
{
System
.
out
.
println
(
"Lab is full!!!"
);
}
}
public
void
print
()
{
System
.
out
.
println
(
"avg="
+
avg
+
"tedad"
+
currentSize
);
}
public
Student
[]
getStudents
()
{
return
students
;
}
public
void
setStudents
(
Student
[]
students
)
{
this
.
students
=
students
;
}
public
int
getAvg
()
{
return
avg
;
}
public
String
getDay
()
{
return
day
;
}
public
void
setDay
(
String
day
)
{
this
.
day
=
day
;
}
public
int
getCapacity
()
{
return
capacity
;
}
public
void
setCapacity
(
int
capacity
)
{
this
.
capacity
=
capacity
;
}
}
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