Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
group2-9831045-APmanual-2
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
9831045
group2-9831045-APmanual-2
Commits
28b46bfc
Commit
28b46bfc
authored
Mar 06, 2020
by
9831045
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added extra comments
parent
e183b48f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
9 deletions
+40
-9
workspace.xml
.idea/workspace.xml
+4
-3
Lab.java
src/Lab.java
+6
-2
Run.java
src/Run.java
+3
-1
Student.java
src/Student.java
+27
-3
No files found.
.idea/workspace.xml
View file @
28b46bfc
...
...
@@ -2,9 +2,6 @@
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"721d25be-807f-4a41-a78a-d223bc93b2f4"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Run/Lab.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Run/Lab.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Run/Run.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Run/Run.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/Lab.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/Lab.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/Run.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/Run.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/Student.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/Student.java"
afterDir=
"false"
/>
...
...
@@ -91,5 +88,9 @@
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
</state>
<state
x=
"184"
y=
"0"
key=
"SettingsEditor/0.0.1366.728@0.0.1366.728"
timestamp=
"1583493438190"
/>
<state
x=
"346"
y=
"49"
width=
"672"
height=
"678"
key=
"search.everywhere.popup"
timestamp=
"1583505236397"
>
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
</state>
<state
x=
"346"
y=
"49"
width=
"672"
height=
"678"
key=
"search.everywhere.popup/0.0.1366.728@0.0.1366.728"
timestamp=
"1583505236397"
/>
</component>
</project>
\ No newline at end of file
src/Lab.java
View file @
28b46bfc
...
...
@@ -21,6 +21,7 @@ public class Lab {
/**
* checks if the student can enroll to the class
* according to the current size and the capacity
*/
public
void
enrollment
(
Student
std
)
{
if
(
currentSize
<
capacity
)
{
...
...
@@ -33,7 +34,9 @@ public class Lab {
}
/**
* prints
* prints the students and
* also the average which is
* calculated
*/
public
void
print
()
{
/*
...
...
@@ -87,7 +90,8 @@ public class Lab {
}
/**
* calculates the students average
* this method is used to
* calculate the students average
*/
public
void
calculateAvg
()
{
int
sum
=
0
;
...
...
src/Run.java
View file @
28b46bfc
...
...
@@ -33,8 +33,10 @@ public class Run {
std1
.
setGrade
(
20
);
std2
.
setGrade
(
19
);
//setting an invalid ID which result in an error because it has 8 digits
std3
.
setId
(
"98328392"
);
//setting the new ID
//setting the new
valid
ID
std3
.
setId
(
"9034212"
);
//initializing the students in the array
...
...
src/Student.java
View file @
28b46bfc
...
...
@@ -48,19 +48,43 @@ public class Student {
else
System
.
out
.
println
(
"error grade"
);
}
/**
* a normal getter for grade
* @return grade which is the students grade
*/
public
int
getGrade
(){
return
grade
;
}
public
void
setId
(
String
fId
){
if
(
fId
.
length
()
==
7
)
{
id
=
fId
;
/**
* this method will reset the students ID
* according to its digit counts if the input
* has more or less than 7 digits the method
* will print an error
* @param id is the new student ID
*/
public
void
setId
(
String
id
){
if
(
id
.
length
()
==
7
)
{
this
.
id
=
id
;
}
else
System
.
out
.
println
(
"error"
);
}
/**
* a normal getter which returns the ID
* @return id which is the students ID
*/
public
String
getId
(){
return
id
;
}
/**
* getLastName method is used to return the students last name
* @return lastName which is the students last name
* and is used in the Lab class
*/
public
String
getLastName
(){
return
lastName
;
}
...
...
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