Welcome back to Software Development!
Class rules when working on projects
Class rules when working on projects You may not leave your seat without permission
Class rules when working on projects You may not leave your seat without permission You may not talk with another team
Class rules when working on projects You may not leave your seat without permission You may not talk with another team If you are finished or stuck:
Class rules when working on projects You may not leave your seat without permission You may not talk with another team If you are finished or stuck: Wait patiently for me
Class rules when working on projects You may not leave your seat without permission You may not talk with another team If you are finished or stuck: Wait patiently for me (or a designated helper)
Class rules when working on projects You may not leave your seat without permission You may not talk with another team If you are finished or stuck: Wait patiently for me (or a designated helper) to get to you
Class rules when working on projects You may not leave your seat without permission You may not talk with another team If you are finished or stuck: Wait patiently for me (or a designated helper) to get to you You may not surf the web
Class rules when working on projects You may not leave your seat without permission You may not talk with another team If you are finished or stuck: Wait patiently for me (or a designated helper) to get to you You may not surf the web unless
Class rules when working on projects You may not leave your seat without permission You may not talk with another team If you are finished or stuck: Wait patiently for me (or a designated helper) to get to you You may not surf the web unless it is MSDN to find help
The follow-on task…
Xlate Quit
Xlate Quit string menuDisplayMsg = “1)Xlate\n2)Quit”;
Xlate Quit string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length;
Xlate Quit string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length; // lenMsg is 15
Xlate Quit string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length; // lenMsg is 15 string subStr = menuDisplayMsg.Substring(0, 1);
string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length; // lenMsg is 15 string subStr = menuDisplayMsg.Substring(0, 1); starting index
string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length; // lenMsg is 15 string subStr = menuDisplayMsg.Substring(0, 1); starting index length
string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length; // lenMsg is 15 string subStr = menuDisplayMsg.Substring(0, 1); starting index length 1 ) X l a t e \ n 2 ) Q u i t 1 2 3 4 5 6 7 8 9 10 11 12 13 14
string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length; // lenMsg is 15 string subStr = menuDisplayMsg.Substring(0, 1); starting index length 1 ) X l a t e \ n 2 ) Q u i t 1 2 3 4 5 6 7 8 9 10 11 12 13 14
string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length; // lenMsg is 15 string subStr = menuDisplayMsg.Substring(0, 1); starting index length 1 ) X l a t e \ n 2 ) Q u i t 1 2 3 4 5 6 7 8 9 10 11 12 13 14
string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length; // lenMsg is 15 string subStr = menuDisplayMsg.Substring(0, 1); // subStr is “1” starting index length 1 ) X l a t e \ n 2 ) Q u i t 1 2 3 4 5 6 7 8 9 10 11 12 13 14
string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length; // lenMsg is 15 string subStr = menuDisplayMsg.Substring(1, 1); 1 ) X l a t e \ n 2 ) Q u i t 1 2 3 4 5 6 7 8 9 10 11 12 13 14
1 Xlate Quit string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length; // lenMsg is 15 string subStr = menuDisplayMsg.Substring(1, 1); // subStr is “)” 1 ) X l a t e \ n 2 ) Q u i t 1 2 3 4 5 6 7 8 9 10 11 12 13 14
string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length; // lenMsg is 15 string subStr = menuDisplayMsg.Substring(2, 1); 1 ) X l a t e \ n 2 ) Q u i t 1 2 3 4 5 6 7 8 9 10 11 12 13 14
2 Xlate Quit string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length; // lenMsg is 15 string subStr = menuDisplayMsg.Substring(2, 1); // subStr is “X” 1 ) X l a t e \ n 2 ) Q u i t 1 2 3 4 5 6 7 8 9 10 11 12 13 14
string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length; // lenMsg is 15 string subStr = menuDisplayMsg.Substring(3, 1); 1 ) X l a t e \ n 2 ) Q u i t 1 2 3 4 5 6 7 8 9 10 11 12 13 14
3 Xlate Quit string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length; // lenMsg is 15 string subStr = menuDisplayMsg.Substring(3, 1); // subStr is “X” 1 ) X l a t e \ n 2 ) Q u i t 1 2 3 4 5 6 7 8 9 10 11 12 13 14
string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length; // lenMsg is 15 string subStr = menuDisplayMsg.Substring(10, 1); 1 ) X l a t e \ n 2 ) Q u i t 1 2 3 4 5 6 7 8 9 10 11 12 13 14
10 Xlate Quit string menuDisplayMsg = “1)Xlate\n2)Quit”; int lenMsg = menuDisplayMsg.Length; // lenMsg is 15 string subStr = menuDisplayMsg.Substring(10, 1); // subStr is “)” 1 ) X l a t e \ n 2 ) Q u i t 1 2 3 4 5 6 7 8 9 10 11 12 13 14
for ( i = 0 ; i < menuDisplayMsg.Length ; i++ ) { subStr = menuDisplayMsg.Substring(i, 1); } 1 ) X l a t e \ n 2 ) Q u i t 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Follow-on Task Change the NumMenuOptions property to be read-only: Remove its set method Change the MenuDisplayMsg property: Calculate the number of menu options by counting the “)” characters in the display message string. Set the numMenuOptions field with that number.