-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8fe7e99
commit 3395c2e
Showing
306 changed files
with
186,223 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+7.43 KB
Assignment02/.vs/Assignment02/FileContentIndex/2f2139da-1566-4c20-8cab-9465fea0f123.vsidx
Binary file not shown.
Binary file added
BIN
+5.4 KB
Assignment02/.vs/Assignment02/FileContentIndex/c96d0d58-f08e-4eb2-9a6a-b70733f79274.vsidx
Binary file not shown.
Binary file added
BIN
+7.02 KB
Assignment02/.vs/Assignment02/FileContentIndex/efe1bace-f60e-4ed6-91d8-cb40bf52b728.vsidx
Binary file not shown.
Binary file added
BIN
+6.87 KB
Assignment02/.vs/Assignment02/FileContentIndex/fd91d323-4103-417b-8eda-07fab7fa049e.vsidx
Binary file not shown.
Binary file not shown.
54 changes: 54 additions & 0 deletions
54
Assignment02/.vs/Assignment02/v17/DocumentLayout.backup.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"Version": 1, | ||
"WorkspaceRootPath": "D:\\CDAC\\Personal_GITData\\MsDotNet\\Assignment02\\", | ||
"Documents": [ | ||
{ | ||
"AbsoluteMoniker": "D:0:0:{CA88E252-9A60-4D51-A177-8AF96B38A5BF}|Assignment02.csproj|d:\\cdac\\personal_gitdata\\msdotnet\\assignment02\\a2q2.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", | ||
"RelativeMoniker": "D:0:0:{CA88E252-9A60-4D51-A177-8AF96B38A5BF}|Assignment02.csproj|solutionrelative:a2q2.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" | ||
}, | ||
{ | ||
"AbsoluteMoniker": "D:0:0:{CA88E252-9A60-4D51-A177-8AF96B38A5BF}|Assignment02.csproj|d:\\cdac\\personal_gitdata\\msdotnet\\assignment02\\a2q1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", | ||
"RelativeMoniker": "D:0:0:{CA88E252-9A60-4D51-A177-8AF96B38A5BF}|Assignment02.csproj|solutionrelative:a2q1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" | ||
} | ||
], | ||
"DocumentGroupContainers": [ | ||
{ | ||
"Orientation": 0, | ||
"VerticalTabListWidth": 256, | ||
"DocumentGroups": [ | ||
{ | ||
"DockedWidth": 200, | ||
"SelectedChildIndex": 0, | ||
"Children": [ | ||
{ | ||
"$type": "Document", | ||
"DocumentIndex": 0, | ||
"Title": "A2Q2.cs", | ||
"DocumentMoniker": "D:\\CDAC\\Personal_GITData\\MsDotNet\\Assignment02\\A2Q2.cs", | ||
"RelativeDocumentMoniker": "A2Q2.cs", | ||
"ToolTip": "D:\\CDAC\\Personal_GITData\\MsDotNet\\Assignment02\\A2Q2.cs", | ||
"RelativeToolTip": "A2Q2.cs", | ||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAA==", | ||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | ||
"WhenOpened": "2024-12-27T12:12:26.816Z", | ||
"EditorCaption": "" | ||
}, | ||
{ | ||
"$type": "Document", | ||
"DocumentIndex": 1, | ||
"Title": "A2Q1.cs", | ||
"DocumentMoniker": "D:\\CDAC\\Personal_GITData\\MsDotNet\\Assignment02\\A2Q1.cs", | ||
"RelativeDocumentMoniker": "A2Q1.cs", | ||
"ToolTip": "D:\\CDAC\\Personal_GITData\\MsDotNet\\Assignment02\\A2Q1.cs", | ||
"RelativeToolTip": "A2Q1.cs", | ||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", | ||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | ||
"WhenOpened": "2024-12-27T12:12:24.638Z", | ||
"EditorCaption": "" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"Version": 1, | ||
"WorkspaceRootPath": "D:\\CDAC\\Personal_GITData\\MsDotNet\\Assignment02\\", | ||
"Documents": [ | ||
{ | ||
"AbsoluteMoniker": "D:0:0:{CA88E252-9A60-4D51-A177-8AF96B38A5BF}|Assignment02.csproj|d:\\cdac\\personal_gitdata\\msdotnet\\assignment02\\a2q2.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", | ||
"RelativeMoniker": "D:0:0:{CA88E252-9A60-4D51-A177-8AF96B38A5BF}|Assignment02.csproj|solutionrelative:a2q2.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" | ||
}, | ||
{ | ||
"AbsoluteMoniker": "D:0:0:{CA88E252-9A60-4D51-A177-8AF96B38A5BF}|Assignment02.csproj|d:\\cdac\\personal_gitdata\\msdotnet\\assignment02\\a2q1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", | ||
"RelativeMoniker": "D:0:0:{CA88E252-9A60-4D51-A177-8AF96B38A5BF}|Assignment02.csproj|solutionrelative:a2q1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" | ||
} | ||
], | ||
"DocumentGroupContainers": [ | ||
{ | ||
"Orientation": 0, | ||
"VerticalTabListWidth": 256, | ||
"DocumentGroups": [ | ||
{ | ||
"DockedWidth": 200, | ||
"SelectedChildIndex": 0, | ||
"Children": [ | ||
{ | ||
"$type": "Document", | ||
"DocumentIndex": 0, | ||
"Title": "A2Q2.cs", | ||
"DocumentMoniker": "D:\\CDAC\\Personal_GITData\\MsDotNet\\Assignment02\\A2Q2.cs", | ||
"RelativeDocumentMoniker": "A2Q2.cs", | ||
"ToolTip": "D:\\CDAC\\Personal_GITData\\MsDotNet\\Assignment02\\A2Q2.cs", | ||
"RelativeToolTip": "A2Q2.cs", | ||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAA==", | ||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | ||
"WhenOpened": "2024-12-27T12:12:26.816Z", | ||
"EditorCaption": "" | ||
}, | ||
{ | ||
"$type": "Document", | ||
"DocumentIndex": 1, | ||
"Title": "A2Q1.cs", | ||
"DocumentMoniker": "D:\\CDAC\\Personal_GITData\\MsDotNet\\Assignment02\\A2Q1.cs", | ||
"RelativeDocumentMoniker": "A2Q1.cs", | ||
"ToolTip": "D:\\CDAC\\Personal_GITData\\MsDotNet\\Assignment02\\A2Q1.cs", | ||
"RelativeToolTip": "A2Q1.cs", | ||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", | ||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | ||
"WhenOpened": "2024-12-27T12:12:24.638Z", | ||
"EditorCaption": "" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"ExpandedNodes": [ | ||
"" | ||
], | ||
"SelectedNode": "\\Assignment02.sln", | ||
"PreviewInSolutionExplorer": false | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.InteropServices; | ||
using System.Runtime.Remoting.Messaging; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Microsoft.Build.Logging.StructuredLogger; | ||
|
||
namespace Assignment02 | ||
{ | ||
public struct Student | ||
{ | ||
|
||
private string name; | ||
private bool gender; | ||
private int age; | ||
private int std; | ||
private char div; | ||
private double marks; | ||
|
||
public Student(bool gender, string name, int age, int std, char div, double marks) | ||
{ | ||
this.gender = gender; | ||
this.name = name; | ||
this.std = std; | ||
this.age = age; | ||
this.div = div; | ||
this.marks = marks; | ||
|
||
} | ||
|
||
public string GetName() => name; | ||
public string SetName(string value) => name = value; | ||
|
||
|
||
|
||
public bool GetGender() => gender; | ||
public bool SetGender(bool value) => gender = value; | ||
|
||
public int GetAge() => age; | ||
public void SetAge(int value) => age = value; | ||
|
||
public int GetStd() => std; | ||
public void SetStd(int value) => std = value; | ||
|
||
public char GetDiv() => div; | ||
public void SetDiv(char value) => div = value; | ||
|
||
public double GetMarks() => marks; | ||
public void SetMarks(double value) => marks = value; | ||
|
||
public void AcceptDetails() { | ||
|
||
Console.WriteLine("Enter the name: "); | ||
SetName(Console.ReadLine() ) ; | ||
|
||
Console.WriteLine("Enter the age: "); | ||
SetAge(int.Parse(Console.ReadLine())); | ||
|
||
Console.WriteLine("Enter the gender (true for Male, false for Female): "); | ||
SetGender(bool.Parse(Console.ReadLine())); | ||
|
||
Console.WriteLine("Enter the Std: "); | ||
SetStd(int.Parse(Console.ReadLine())); | ||
|
||
Console.WriteLine("Enter the Division: "); | ||
SetDiv(Char.Parse(Console.ReadLine())); | ||
|
||
Console.WriteLine("Enter the Marks: "); | ||
SetMarks(int.Parse(Console.ReadLine())); | ||
|
||
|
||
} | ||
|
||
public void PrintDetails() | ||
{ | ||
Console.WriteLine("\nStudent Details:"); | ||
Console.WriteLine("Name: " + name); | ||
Console.WriteLine("Gender: " + (gender ? "Male" : "Female")); | ||
Console.WriteLine("Age: " + age); | ||
Console.WriteLine("Standard: " + std); | ||
Console.WriteLine("Division: " + div); | ||
Console.WriteLine("Marks: " + marks); | ||
} | ||
} | ||
|
||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
// Using the default constructor | ||
Student student1 = new Student(); | ||
Console.WriteLine("Enter details for student 1:"); | ||
student1.AcceptDetails(); | ||
student1.PrintDetails(); | ||
|
||
// Using the parameterized constructor | ||
Student student2 = new Student(true, "XXX", 18, 12, 'A', 55 ); | ||
Console.WriteLine("\nDetails for student 2 (using parameterized constructor):"); | ||
student2.PrintDetails(); | ||
} | ||
} | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Assignment02Q2 | ||
{ | ||
|
||
|
||
public struct Student | ||
{ | ||
|
||
private string name; | ||
private bool gender; | ||
private int age; | ||
private int std; | ||
private char div; | ||
private double marks; | ||
|
||
public Student(bool gender, string name, int age, int std, char div, double marks) | ||
{ | ||
this.gender = gender; | ||
this.name = name; | ||
this.std = std; | ||
this.age = age; | ||
this.div = div; | ||
this.marks = marks; | ||
|
||
} | ||
|
||
public string GetName() => name; | ||
public string SetName(string value) => name = value; | ||
|
||
|
||
|
||
public bool GetGender() => gender; | ||
public bool SetGender(bool value) => gender = value; | ||
|
||
public int GetAge() => age; | ||
public void SetAge(int value) => age = value; | ||
|
||
public int GetStd() => std; | ||
public void SetStd(int value) => std = value; | ||
|
||
public char GetDiv() => div; | ||
public void SetDiv(char value) => div = value; | ||
|
||
public double GetMarks() => marks; | ||
public void SetMarks(double value) => marks = value; | ||
|
||
public void AcceptDetails() | ||
{ | ||
|
||
Console.WriteLine("Enter the name: "); | ||
SetName(Console.ReadLine()); | ||
|
||
Console.WriteLine("Enter the age: "); | ||
SetAge(int.Parse(Console.ReadLine())); | ||
|
||
Console.WriteLine("Enter the gender (true for Male, false for Female): "); | ||
SetGender(bool.Parse(Console.ReadLine())); | ||
|
||
Console.WriteLine("Enter the Std: "); | ||
SetStd(int.Parse(Console.ReadLine())); | ||
|
||
Console.WriteLine("Enter the Division: "); | ||
SetDiv(Char.Parse(Console.ReadLine())); | ||
|
||
Console.WriteLine("Enter the Marks: "); | ||
SetMarks(int.Parse(Console.ReadLine())); | ||
|
||
|
||
} | ||
|
||
public void PrintDetails() | ||
{ | ||
Console.WriteLine("\nStudent Details:"); | ||
Console.WriteLine("Name: " + name); | ||
Console.WriteLine("Gender: " + (gender ? "Male" : "Female")); | ||
Console.WriteLine("Age: " + age); | ||
Console.WriteLine("Standard: " + std); | ||
Console.WriteLine("Division: " + div); | ||
Console.WriteLine("Marks: " + marks); | ||
} | ||
} | ||
|
||
class Program | ||
{ | ||
|
||
static void CreateArray(ref Student[] students) | ||
{ | ||
Console.WriteLine("Enter the Number of Students: "); | ||
int size = (int.Parse(Console.ReadLine())); | ||
|
||
students = new Student[size]; | ||
|
||
Console.WriteLine("Array of size " + size + " created"); | ||
|
||
} | ||
|
||
static void AcceptInfo(Student[] students) | ||
{ | ||
|
||
Console.WriteLine("Enter Student Details: "); | ||
for (int i = 0; i < students.Length; i++) | ||
{ | ||
Console.WriteLine($"\nStudent {i + 1}:"); | ||
students[i].AcceptDetails(); | ||
} | ||
|
||
} | ||
|
||
static void PrintInfo(Student[] students) | ||
{ | ||
Console.WriteLine("\nStudent details:"); | ||
for (int i = 0; i < students.Length; i++) | ||
{ | ||
Console.WriteLine($"\nStudent {i + 1}:"); | ||
students[i].PrintDetails(); | ||
} | ||
} | ||
static void ReverseArray(Student[] students, ref Student[] reversedArray) | ||
{ | ||
int size = students.Length; | ||
reversedArray = new Student[size]; | ||
|
||
for (int i = 0; i < size; i++) | ||
{ | ||
reversedArray[i] = students[size - 1 - i]; | ||
} | ||
|
||
Console.WriteLine("\nArray has been reversed."); | ||
} | ||
|
||
static void Main(string[] args) | ||
{ | ||
Student[] students = null; | ||
Student[] reversedArray = null; | ||
|
||
CreateArray(ref students); | ||
AcceptInfo(students); | ||
PrintInfo(students); | ||
|
||
ReverseArray(students, ref reversedArray); | ||
Console.WriteLine("\nReversed student details:"); | ||
PrintInfo(reversedArray); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> | ||
</startup> | ||
</configuration> |
Oops, something went wrong.