In this module we'll provide the answers for the types challenges in the last module.
What's the Best Type Answers:
Bronze Challenge Answer (Example)
Copy namespace BasicTypesPractice
{
class Program
{
static void Main ( string [] args)
{
int lottoNumber;
int yearGraduatedHighSchool = 1994 ;
string fbPost;
string reTweet = "Yes, I'll retweet that." ;
bool isMarried;
bool isHappy = true ;
decimal studentLoanAmount;
decimal bankAccount = 100.0M ;
float amountOfSnow;
float temperature = 57.5f ;
double latitude;
double oneThird = 3.33333333d ;
fbPost = "The Patriots are terrible!" ;
Console .WriteLine(fbPost);
Console .WriteLine(temperature);
Console .WriteLine(oneThird);
}
}
}
Silver Challenge Answer (Example)
Copy namespace BasicTypesPractice
{
class Program
{
static void Main ( string [] args)
{
string fbPost;
string reTweet = "Yes, I'll retweet that." ;
fbPost = "The Patriots are terrible!" ;
Console .WriteLine(fbPost + " " + reTweet);
}
}
}
Gold Challenge Answer (Example)
Copy namespace BasicTypesPractice
{
class Program
{
static void Main ( string [] args)
{
int bYear = Int32 .Parse( "1976" );
Console .WriteLine( "I was born in {0}." , bYear);
}
}
}