cs revision coding

0.0(0)
studied byStudied by 5 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/13

flashcard set

Earn XP

Description and Tags

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

14 Terms

1
New cards

random numbers

random rnd = new random

int num = rnd.next(1,10);

2
New cards

for loops

for (int i = 1 ; i<= 10 ; i++)

{

}

3
New cards

boolean operators

and &&

or ||

not !

4
New cards

arrays

string[] countries = new string[3]

countries[0] = “a”

countries[1] = “b”

countries[2] = “c”

5
New cards

2d arrays

string[,] stationtimes = new string[,] {

{“ 7.30“ ,“ 8.30“,“12.45 “,“ 16.20“}',

{“ 7.30“ ,“ 8.30“,“12.45 “,“ 16.20“}'};

console.writeline(stationtimes[1,2]);

6
New cards

string manipulation-length of string

string mystring = “hello world“;

int lenofstring;

lenofstring = mystring.length;

7
New cards

record/structures

private struct employee

{
public string first name

public string surname

public string phone extension
}

static void main(string[] args)

{

employee1.firstname =”will”

employee1.surname = “smith”

employee1.phoneextention = “1701”

8
New cards

string manipulation-searching for character in a string

string email = “test@gmail.com”;

string searchcharacter = “@”;

int position

position = email.IndexOf(searchcharacter);

console.writeline(position);

9
New cards

string manipulation- substring

string str;

string retstring;

str = “this is a substring test”;

retstring = str.substring(10,9);

consolee.writeline(retstring);

10
New cards

string conversion

string string1 = “2343”;

int string1convert = int.parse(string1)

console.writeline(“string1convert”)

11
New cards

string as an array of chars

string mystring = “hello world”;

for(int i = 0; i < mystring.length; i++)

{

console.writeline(mystring[i[);

}

12
New cards
13
New cards
14
New cards