Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
O
OOPLab
Project
Project
Details
Activity
Releases
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
ali.asswad
OOPLab
Commits
93b2d34b
Commit
93b2d34b
authored
Oct 25, 2026
by
Ahmad Abd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary files
parent
a2915dde
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
79 deletions
+0
-79
StudentExam.cs
OOPLab/Exams/StudentExam.cs
+0
-28
StudentExamV1.cs
OOPLab/Exams/StudentExamV1.cs
+0
-13
OOPLab.csproj
OOPLab/OOPLab.csproj
+0
-10
Program.cs
OOPLab/Program.cs
+0
-28
No files found.
OOPLab/Exams/StudentExam.cs
deleted
100644 → 0
View file @
a2915dde
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
OOPLab.Exams
{
public
class
StudentExam
{
private
int
_score
;
public
void
SetScore
(
int
score
)
{
if
(
score
<
0
||
score
>
100
)
{
throw
new
ArgumentException
(
"Score must be between 0 and 100."
);
}
_score
=
score
;
}
public
int
GetScore
()
{
return
_score
;
}
}
}
OOPLab/Exams/StudentExamV1.cs
deleted
100644 → 0
View file @
a2915dde
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
OOPLab.Exams
{
public
class
StudentExamV1
{
public
int
Grade
;
}
}
OOPLab/OOPLab.csproj
deleted
100644 → 0
View file @
a2915dde
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
OOPLab/Program.cs
deleted
100644 → 0
View file @
a2915dde
using
OOPLab
;
using
OOPLab.Exams
;
using
System
;
Console
.
WriteLine
(
"ENCAPSULATION — Student portal"
);
// Before: any caller can assign an invalid value.
StudentExamV1
studentV1
=
new
StudentExamV1
();
studentV1
.
Grade
=
50
;
Console
.
WriteLine
(
$"Initial Grade:
{
studentV1
.
Grade
}
"
);
studentV1
.
Grade
=
999
;
Console
.
WriteLine
(
$"Invalid Grade is accepted:
{
studentV1
.
Grade
}
"
);
// After: validated access through public methods.
StudentExam
student
=
new
StudentExam
();
student
.
SetScore
(
90
);
Console
.
WriteLine
(
$"Validated score:
{
student
.
GetScore
()}
"
);
try
{
student
.
SetScore
(
999
);
}
catch
(
ArgumentException
ex
)
{
Console
.
WriteLine
(
$"Invalid score rejected:
{
ex
.
Message
}
"
);
}
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