cs revision coding

studied byStudied by 5 people
0.0(0)
Get a hint
Hint

random numbers

1 / 13

flashcard set

Earn XP

Description and Tags

14 Terms

1

random numbers

random rnd = new random

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

New cards
2

for loops

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

{

}

New cards
3

boolean operators

and &&

or ||

not !

New cards
4

arrays

string[] countries = new string[3]

countries[0] = “a”

countries[1] = “b”

countries[2] = “c”

New cards
5

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]);

New cards
6

string manipulation-length of string

string mystring = “hello world“;

int lenofstring;

lenofstring = mystring.length;

New cards
7

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”

New cards
8

string manipulation-searching for character in a string

string email = “test@gmail.com”;

string searchcharacter = “@”;

int position

position = email.IndexOf(searchcharacter);

console.writeline(position);

New cards
9

string manipulation- substring

string str;

string retstring;

str = “this is a substring test”;

retstring = str.substring(10,9);

consolee.writeline(retstring);

New cards
10

string conversion

string string1 = “2343”;

int string1convert = int.parse(string1)

console.writeline(“string1convert”)

New cards
11

string as an array of chars

string mystring = “hello world”;

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

{

console.writeline(mystring[i[);

}

New cards
12
New cards
13
New cards
14
New cards

Explore top notes

note Note
studied byStudied by 18 people
... ago
4.0(1)
note Note
studied byStudied by 12 people
... ago
5.0(1)
note Note
studied byStudied by 34 people
... ago
5.0(1)
note Note
studied byStudied by 13 people
... ago
5.0(2)
note Note
studied byStudied by 1 person
... ago
5.0(1)
note Note
studied byStudied by 57 people
... ago
5.0(1)
note Note
studied byStudied by 22 people
... ago
5.0(1)
note Note
studied byStudied by 1975 people
... ago
4.7(11)

Explore top flashcards

flashcards Flashcard (93)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (115)
studied byStudied by 13 people
... ago
5.0(2)
flashcards Flashcard (22)
studied byStudied by 17 people
... ago
5.0(3)
flashcards Flashcard (75)
studied byStudied by 2 people
... ago
5.0(1)
flashcards Flashcard (29)
studied byStudied by 27 people
... ago
5.0(2)
flashcards Flashcard (40)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (20)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (134)
studied byStudied by 2615 people
... ago
4.0(26)
robot