-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram3.cs
More file actions
35 lines (32 loc) · 911 Bytes
/
Copy pathProgram3.cs
File metadata and controls
35 lines (32 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
namespace ConsoleApp3
{
/* exmaple 3
* pj92singh
* Prabhjit Singh
*
* using sutdent class again but with other data types
* testing null "?" and console execution
*/
public class Student
{
//either intalize or use nullable refernce types
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? Email { get; set; }
public string? GPA { get; set; }
}
class Program
{
static void Main(string[] args)
{
var student = new Student()
{
FirstName = "John"
//LastName = "Smith"
};
Console.WriteLine($"The sudent is called {student.FirstName} {student.LastName.ToUpper()}");
Console.ReadKey();
}
}
}