Skip to content

Commit 589c4ff

Browse files
committed
Changes
1 parent 3bcda02 commit 589c4ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1387
-27
lines changed
Binary file not shown.
Binary file not shown.

.vs/APComputerScience-CreateTask-Assignment/v17/DocumentLayout.json

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
{
66
"AbsoluteMoniker": "D:0:0:{5AB77EFE-8F20-4A15-9B39-F22F9DA9D670}|APComputerScience-CreateTask-Assignment\\APComputerScience-CreateTask-Assignment.csproj|c:\\users\\thinc\\source\\repos\\apcomputerscience-createtask-assignment\\apcomputerscience-createtask-assignment\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
77
"RelativeMoniker": "D:0:0:{5AB77EFE-8F20-4A15-9B39-F22F9DA9D670}|APComputerScience-CreateTask-Assignment\\APComputerScience-CreateTask-Assignment.csproj|solutionrelative:apcomputerscience-createtask-assignment\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
8-
},
9-
{
10-
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Thinc\\AppData\\Local\\SourceServer\\309c8dfc5030d3cf23be8900b9dbafc30cc3a161a4f8a96003ad952921cae739\\src\\libraries\\System.Private.CoreLib\\src\\System\\Collections\\Generic\\List.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
118
}
129
],
1310
"DocumentGroupContainers": [
@@ -17,21 +14,8 @@
1714
"DocumentGroups": [
1815
{
1916
"DockedWidth": 200,
20-
"SelectedChildIndex": 1,
17+
"SelectedChildIndex": 0,
2118
"Children": [
22-
{
23-
"$type": "Document",
24-
"DocumentIndex": 1,
25-
"Title": "List.cs",
26-
"DocumentMoniker": "C:\\Users\\Thinc\\AppData\\Local\\SourceServer\\309c8dfc5030d3cf23be8900b9dbafc30cc3a161a4f8a96003ad952921cae739\\src\\libraries\\System.Private.CoreLib\\src\\System\\Collections\\Generic\\List.cs",
27-
"RelativeDocumentMoniker": "..\\..\\..\\AppData\\Local\\SourceServer\\309c8dfc5030d3cf23be8900b9dbafc30cc3a161a4f8a96003ad952921cae739\\src\\libraries\\System.Private.CoreLib\\src\\System\\Collections\\Generic\\List.cs",
28-
"ToolTip": "C:\\Users\\Thinc\\AppData\\Local\\SourceServer\\309c8dfc5030d3cf23be8900b9dbafc30cc3a161a4f8a96003ad952921cae739\\src\\libraries\\System.Private.CoreLib\\src\\System\\Collections\\Generic\\List.cs",
29-
"RelativeToolTip": "..\\..\\..\\AppData\\Local\\SourceServer\\309c8dfc5030d3cf23be8900b9dbafc30cc3a161a4f8a96003ad952921cae739\\src\\libraries\\System.Private.CoreLib\\src\\System\\Collections\\Generic\\List.cs",
30-
"ViewState": "AQIAAIIAAAAAAAAAAAAiwJUAAAAUAAAA",
31-
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
32-
"WhenOpened": "2024-04-11T17:59:24.771Z",
33-
"EditorCaption": ""
34-
},
3519
{
3620
"$type": "Document",
3721
"DocumentIndex": 0,
@@ -40,7 +24,7 @@
4024
"RelativeDocumentMoniker": "APComputerScience-CreateTask-Assignment\\Program.cs",
4125
"ToolTip": "C:\\Users\\Thinc\\source\\repos\\APComputerScience-CreateTask-Assignment\\APComputerScience-CreateTask-Assignment\\Program.cs",
4226
"RelativeToolTip": "APComputerScience-CreateTask-Assignment\\Program.cs",
43-
"ViewState": "AQIAAAAAAAAAAAAAAAAAABMAAAAoAAAA",
27+
"ViewState": "AQIAAD8AAAAAAAAAAAAAAAoAAAAmAAAA",
4428
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
4529
"WhenOpened": "2024-04-04T12:38:05.332Z",
4630
"EditorCaption": ""
Binary file not shown.
Binary file not shown.

APComputerScience-CreateTask-Assignment/Program.cs

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static void PageReader()
8080
Console.WriteLine("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
8181
Console.Write("What Navigation would you like to do from the above options?: ");
8282
string Option = Console.ReadLine();
83-
Functions(Option, ref currentPage, ref BookFinishedForNow);
83+
Functions(Option, ref currentPage, ref BookFinishedForNow, Pages.Count);
8484
Save(ref saveLines, ref Book, ref saveFilePath, ref currentPage);
8585
}
8686
else
@@ -102,15 +102,29 @@ public static void PageReader()
102102
}
103103
}
104104
}
105-
public static void Functions(string Option, ref int currentPage, ref bool BookFinishedForNow)
105+
public static void Functions(string Option, ref int currentPage, ref bool BookFinishedForNow, int totalPages)
106106
{
107107
if (Option == ">")
108108
{
109-
currentPage++;
109+
if (currentPage < totalPages - 1)
110+
{
111+
currentPage++;
112+
}
113+
else
114+
{
115+
Console.WriteLine("Error: You are already on the last page.");
116+
}
110117
}
111118
else if (Option == "<")
112119
{
113-
currentPage--;
120+
if (currentPage > 0)
121+
{
122+
currentPage--;
123+
}
124+
else
125+
{
126+
Console.WriteLine("Error: You are already on the first page.");
127+
}
114128
}
115129
else if (Option == "X")
116130
{
@@ -126,15 +140,32 @@ public static void Functions(string Option, ref int currentPage, ref bool BookFi
126140
Option = Console.ReadLine();
127141
if (Option == ">")
128142
{
129-
currentPage++;
143+
if (currentPage < totalPages - 1)
144+
{
145+
currentPage++;
146+
y++;
147+
}
148+
else
149+
{
150+
Console.WriteLine("Error: You are already on the last page.");
151+
}
130152
}
131153
else if (Option == "<")
132154
{
133-
currentPage--;
155+
if (currentPage > 0)
156+
{
157+
currentPage--;
158+
y++;
159+
}
160+
else
161+
{
162+
Console.WriteLine("Error: You are already on the first page.");
163+
}
134164
}
135165
else if (Option == "X")
136166
{
137167
BookFinishedForNow = true;
168+
y++;
138169
}
139170
}
140171
}

0 commit comments

Comments
 (0)