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
88df324f
Commit
88df324f
authored
5 years ago
by
9831045
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added extra function testing
parent
8a836280
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
89 additions
and
15 deletions
+89
-15
vcs.xml
.idea/vcs.xml
+6
-0
workspace.xml
.idea/workspace.xml
+32
-9
Lab.class
out/production/Run/Lab.class
+0
-0
Run.class
out/production/Run/Run.class
+0
-0
Lab.java
src/Lab.java
+18
-4
Run.java
src/Run.java
+32
-1
Student.java
src/Student.java
+1
-1
No files found.
.idea/vcs.xml
0 → 100644
View file @
88df324f
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$"
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
.idea/workspace.xml
View file @
88df324f
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"721d25be-807f-4a41-a78a-d223bc93b2f4"
name=
"Default Changelist"
comment=
""
/>
<list
default=
"true"
id=
"721d25be-807f-4a41-a78a-d223bc93b2f4"
name=
"Default Changelist"
comment=
""
>
<change
afterPath=
"$PROJECT_DIR$/.idea/vcs.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
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"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
<option
name=
"LAST_RESOLUTION"
value=
"IGNORE"
/>
</component>
<component
name=
"FileTemplateManagerImpl"
>
<option
name=
"RECENT_TEMPLATES"
>
<list>
<option
value=
"Class"
/>
</list>
</option>
</component>
<component
name=
"Git.Settings"
>
<option
name=
"RECENT_GIT_ROOT_PATH"
value=
"$PROJECT_DIR$"
/>
</component>
<component
name=
"ProjectId"
id=
"1YkgsSC8Xg5K755bG14UR2JIGI5"
/>
<component
name=
"ProjectLevelVcsManager"
settingsEditedManually=
"true"
/>
<component
name=
"ProjectViewState"
>
<option
name=
"hideEmptyMiddlePackages"
value=
"true"
/>
<option
name=
"showExcludedFiles"
value=
"true"
/>
...
...
@@ -15,9 +32,11 @@
</component>
<component
name=
"PropertiesComponent"
>
<property
name=
"RunOnceActivity.ShowReadmeOnStart"
value=
"true"
/>
<property
name=
"SHARE_PROJECT_CONFIGURATION_FILES"
value=
"true"
/>
<property
name=
"project.structure.last.edited"
value=
"Modules"
/>
<property
name=
"project.structure.proportion"
value=
"0.0"
/>
<property
name=
"project.structure.side.proportion"
value=
"0.0"
/>
<property
name=
"settings.editor.selected.configurable"
value=
"preferences.lookFeel"
/>
</component>
<component
name=
"RunManager"
>
<configuration
name=
"Run"
type=
"Application"
factoryName=
"Application"
temporary=
"true"
nameIsGenerated=
"true"
>
...
...
@@ -51,21 +70,25 @@
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
</state>
<state
x=
"275"
y=
"21"
key=
"#Project_Structure/0.0.1366.728@0.0.1366.728"
timestamp=
"1583492226195"
/>
<state
width=
"1366"
height=
"181"
key=
"GridCell.Tab.0.bottom"
timestamp=
"1583492438374"
>
<state
width=
"1366"
height=
"180"
key=
"GridCell.Tab.0.bottom"
timestamp=
"1583495551043"
>
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
</state>
<state
width=
"1366"
height=
"180"
key=
"GridCell.Tab.0.bottom/0.0.1366.728@0.0.1366.728"
timestamp=
"1583495551043"
/>
<state
width=
"1366"
height=
"180"
key=
"GridCell.Tab.0.center"
timestamp=
"1583495551042"
>
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
</state>
<state
width=
"1366"
height=
"18
1"
key=
"GridCell.Tab.0.bottom/0.0.1366.728@0.0.1366.728"
timestamp=
"1583492438374
"
/>
<state
width=
"1366"
height=
"18
1"
key=
"GridCell.Tab.0.center"
timestamp=
"1583492438374
"
>
<state
width=
"1366"
height=
"18
0"
key=
"GridCell.Tab.0.center/0.0.1366.728@0.0.1366.728"
timestamp=
"1583495551042
"
/>
<state
width=
"1366"
height=
"18
0"
key=
"GridCell.Tab.0.left"
timestamp=
"1583495551042
"
>
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
</state>
<state
width=
"1366"
height=
"18
1"
key=
"GridCell.Tab.0.center/0.0.1366.728@0.0.1366.728"
timestamp=
"1583492438374
"
/>
<state
width=
"1366"
height=
"18
1"
key=
"GridCell.Tab.0.left"
timestamp=
"1583492438374
"
>
<state
width=
"1366"
height=
"18
0"
key=
"GridCell.Tab.0.left/0.0.1366.728@0.0.1366.728"
timestamp=
"1583495551042
"
/>
<state
width=
"1366"
height=
"18
0"
key=
"GridCell.Tab.0.right"
timestamp=
"1583495551042
"
>
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
</state>
<state
width=
"1366"
height=
"18
1"
key=
"GridCell.Tab.0.left/0.0.1366.728@0.0.1366.728"
timestamp=
"1583492438374
"
/>
<state
width=
"1366"
height=
"181"
key=
"GridCell.Tab.0.right"
timestamp=
"1583492438374
"
>
<state
width=
"1366"
height=
"18
0"
key=
"GridCell.Tab.0.right/0.0.1366.728@0.0.1366.728"
timestamp=
"1583495551042
"
/>
<state
x=
"184"
y=
"0"
key=
"SettingsEditor"
timestamp=
"1583493438190
"
>
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
</state>
<state
width=
"1366"
height=
"181"
key=
"GridCell.Tab.0.right/0.0.1366.728@0.0.1366.728"
timestamp=
"1583492438374
"
/>
<state
x=
"184"
y=
"0"
key=
"SettingsEditor/0.0.1366.728@0.0.1366.728"
timestamp=
"1583493438190
"
/>
</component>
</project>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
out/production/Run/Lab.class
View file @
88df324f
No preview for this file type
This diff is collapsed.
Click to expand it.
out/production/Run/Run.class
View file @
88df324f
No preview for this file type
This diff is collapsed.
Click to expand it.
src/Lab.java
View file @
88df324f
...
...
@@ -9,11 +9,12 @@ public class Lab {
* constructor
*
* @param cap is the lab capacity
* @param d is the date
* @param d
ay
is the date
*/
public
Lab
(
int
cap
,
String
d
)
{
public
Lab
(
int
cap
,
String
day
)
{
students
=
new
Student
[
100
];
capacity
=
cap
;
day
=
d
;
this
.
day
=
day
;
currentSize
=
0
;
}
...
...
@@ -63,7 +64,11 @@ public class Lab {
* @param students is the new students list
*/
public
void
setStudents
(
Student
[]
students
)
{
this
.
students
=
students
;
int
j
=
0
;
for
(
Studenti
:
students
){
this
.
students
[
j
]
=
i
;
j
++;
}
}
...
...
@@ -116,6 +121,15 @@ public class Lab {
*/
public
void
setCapacity
(
int
capacity
)
{
this
.
capacity
=
capacity
;
Student
[]
students1
=
new
Student
[
capacity
];
for
(
int
i
=
0
;
i
<
students
.
length
&&
i
<
capacity
;
i
++){
students1
[
i
]
=
students
[
i
];
}
students
=
new
Student
[
capacity
];
for
(
int
i
=
0
;
i
<
capacity
;
i
++
){
students
[
i
]
=
students1
[
i
];
}
}
}
This diff is collapsed.
Click to expand it.
src/Run.java
View file @
88df324f
...
...
@@ -5,7 +5,13 @@ public class Run {
Student
std1
=
new
Student
(
"Ehsan"
,
"Edalat"
,
"9031066"
);
Student
std2
=
new
Student
(
"Seyed"
,
"Ahmadpanah"
,
"9031806"
);
Student
std3
=
new
Student
(
"Ahmad"
,
"Asadi"
,
"9031054"
);
//creating a students array
Student
[]
students
=
new
Student
[
3
];
//initializing the students in the array
students
[
0
]
=
std1
;
students
[
1
]
=
std2
;
students
[
2
]
=
std3
;
//running the simple functions in the AP manual
std1
.
print
();
std1
.
setGrade
(
15
);
std1
.
print
();
...
...
@@ -17,6 +23,31 @@ public class Run {
std3
.
print
();
std3
.
setFirstName
(
"HamidReza"
);
std3
.
print
();
//running extra functions
//setting the day
String
day
=
new
String
(
"98/1/23"
);
//setting the capacity
int
cap
=
3
;
//initializing Lab constructor
Lab
lab
=
new
Lab
(
cap
,
day
);
//setting the students
lab
.
setStudents
(
students
);
//using labs print method
lab
.
print
();
//now lets set a new day
String
newDay
=
new
String
(
"98/2/2"
);
lab
.
setDay
(
newDay
);
System
.
out
.
println
(
"this is the new lab day -> "
+
lab
.
getDay
());
//now to show that no one can attend the lab when its full
Student
std4
=
new
Student
(
"new students first name"
,
"new students last name "
,
"9031059"
);
lab
.
enrollment
(
std4
);
//now lets increase the classes capacity
lab
.
setCapacity
(
4
);
//the new lab student can be enrolled
lab
.
enrollment
(
std4
);
//printing the labs new list
lab
.
print
();
}
...
...
This diff is collapsed.
Click to expand it.
src/Student.java
View file @
88df324f
...
...
@@ -24,7 +24,7 @@ public class Student {
}
/**
* @param f
irstName set first name
of a student
* @param f
Name set firstname
of a student
*/
public
void
setFirstName
(
String
fName
){
firstName
=
fName
;
...
...
This diff is collapsed.
Click to expand it.
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