Skip to content

Commit

Permalink
More Q
Browse files Browse the repository at this point in the history
  • Loading branch information
theWhiteFox committed Jun 28, 2015
1 parent 7760bb3 commit 07dd303
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 11 deletions.
15 changes: 14 additions & 1 deletion Lesson5/OOP/CsharpQuestions.txt
Expand Up @@ -24,4 +24,17 @@

13. Name some usages of the "this" keyword in C#?

14. On this sheet, what line number is the word set?
14. On this sheet, what line number is the word set?

15. Write a string game, with the following items "Arya", "Tyrion", "Yara", "Daenerys", "Ramsay", "Joffrey"
Write code to loop through the array. Create a pop-up messsage box to display each one of the names /items.

16.

17. What is a variable (var) give a real world example of a variable?

18. Create a combo with the following list of names "Arya", "Tyrion", "Yara", "Daenerys" write the code that displays a pop-up with either "You picked Tyrion!" else "I'm not sure who you picked."

19.

20.
28 changes: 19 additions & 9 deletions Lesson5/OOP/Form1.cs
Expand Up @@ -22,20 +22,30 @@ public Form1()
private void button2_Click(object sender, EventArgs e)
{


string[] game = { "Arya", "Tyrion", "Yara", "Daenerys", "Ramsay", "Joffrey" };

// Vehicle myCar = new Vehicle(); // new keyword, break point /debug here
myCar.Make = "DeLorean";
myCar.Model = "Time Machine";
myCar.ElapsedMilage = 9999969;
//for (int i = 0; i < game.Length; i++)
//{
// MessageBox.Show(game[i].ToString());
//}

if(myCar.Make == "DeLorean")
foreach (var person in game)
{
string myModel;
myModel = myCar.Model;
MessageBox.Show(person);
}

MessageBox.Show(myModel);
// Vehicle myCar = new Vehicle(); // new keyword, break point /debug here
//myCar.Make = "DeLorean";
//myCar.Model = "Time Machine";
//myCar.ElapsedMilage = 9999969;

//if(myCar.Make == "DeLorean")
//{
// string myModel;
// myModel = myCar.Model;
//}

//MessageBox.Show(myModel);

//string result;
//result = myCar.Drive(30);
Expand Down
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -19,4 +19,8 @@ Two nested for loops<br>
For with if<br>
For with switch<br>
###Lesson 5
OOP
OOP<br>
-read from file
-try catch
-QA
-IO

0 comments on commit 07dd303

Please sign in to comment.