Last active
November 7, 2015 23:03
-
-
Save WilliamGarrow/0d85a13c5a21f222e83b to your computer and use it in GitHub Desktop.
DEV204x Programming with C# - Module One Assignment
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
/// Module One Assignment | |
using System; | |
namespace studentInformation | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Create variables | |
string firstName; | |
string lastName; | |
DateTime birthdate; | |
string addressLine1; | |
string addressLine2; | |
string city; | |
string stateProvidence; | |
string zipPostal; | |
string country; | |
bool isStudent; // True/False variable that will establish Student/Teacher relationship | |
// Use assignment statements to assign values | |
firstName = "Lorem"; | |
lastName = "Ipsum"; | |
birthdate = new DateTime(1985, 08, 16); | |
addressLine1 = "123 Main St"; | |
addressLine2 = null; | |
city = "Orlando"; | |
stateProvidence = "Florida"; | |
zipPostal = "32801"; | |
country = "United States"; | |
isStudent = true; | |
string isThisAStudent; // This will add a Yes/No value based on boolean logic | |
if (isStudent) | |
{ | |
isThisAStudent = "Yes"; | |
} | |
else | |
{ | |
isThisAStudent = "No"; | |
} | |
// Use the Console.WriteLine() method to output the values to the console window | |
Console.WriteLine("First Name: " + firstName); | |
Console.WriteLine("First Name: " + lastName); | |
Console.WriteLine("Birthdate: " + birthdate); | |
Console.WriteLine("Address 1: " + addressLine1); | |
Console.WriteLine("Address 2: " + addressLine2); | |
Console.WriteLine("City: " + city); | |
Console.WriteLine("State/Providence: " + stateProvidence); | |
Console.WriteLine("Zip/Postal: " + zipPostal); | |
Console.WriteLine("Country: " + country); | |
Console.WriteLine("Is this a student?: " + isThisAStudent); | |
} | |
} | |
} | |
/// Module One Assignment | |
/// 1. Create a C# Console application. | |
/// 2. Within the Main() method in this application, create variables of the correct data | |
/// type for the information related to a 'student only'.The other information will be | |
/// used in later modules when you create class files for the other objects listed: | |
/// 3. Once you have the variables created, use assignment statements to assign values | |
/// to one set of student variables and use the Console.WriteLine() method to output | |
/// the values to the console window. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment