Section 1

Preview this deck

create an array myArray with a "a", 1, and 2.3

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

1

All-time users

1

Favorites

0

Last updated

1 year ago

Date created

Mar 14, 2020

Cards (42)

Section 1

(42 cards)

create an array myArray with a "a", 1, and 2.3

Front

object[] myArray = {"a", 1, 2.3}

Back

What are the three main TimeSpan methods

Front

Add, Subtract, ToString

Back

What are the five main number data types?

Front

int, long, decimal, double, float

Back

string a = " trim me. "; // Trim that string. Console.WriteLine( _____ );

Front

a.Trim()

Back

string a = "make me uppercase"; // Make that string uppercase. Console.WriteLine( _____ );

Front

a.ToUpper()

Back

// Format as currency Console.WriteLine("Currency : ____", 23.344);

Front

{0:c}

Back

What is the type of the main function's args?

Front

string[]

Back

str a = "100" // turn a into a byte

Front

Byte.Parse(a);

Back

string a = "i am a sentence with a w, yes"; // Is there a "w" in string a? Console.WriteLine( _____ );

Front

a.Contains("w")

Back

// represent Feb 24, 1983 as a date myBday

Front

DateTime myBday = new DateTime(1983, 2, 24);

Back

string a = "word"; // Pad this string with *s (left, 10 characters total) Console.WriteLine( _____ );

Front

a.PadLeft(10, '*')

Back

StringBuilder sb = new StringBuilder("12xxx678"); // Remove the xxx

Front

sb.Remove(2, 3);

Back

string a = "something"; string b = "SOMETHING"; // Compares things strings, case insensitive Console.WriteLine( _____ );

Front

String.Equals(a, b, StringComparison.OrdinalIgnoreCase)

Back

string a = "find the b in here"; // Where is the "b" in string a? Console.WriteLine( _____ );

Front

a.IndexOf("b")

Back

int[] numbers = {1, 4, 2, 9} // change the value 4 to 40 Console.WriteLine( ___ )

Front

numbers.SetValue(1, 40)

Back

What character precedes the quotation marks to allow for string literals (use of special characters without escape characters)?

Front

@

Back

// Pad with zeroes (length 4) Console.WriteLine("Pad with 0s : ____", 23);

Front

{0:d4}

Back

What are the five main DateTime methods?

Front

DayOfWeek, AddDays, AddMonths, AddYears, Date

Back

The ________ class provides functions for input/output/error streams

Front

Console

Back

What are the seven other simple number data types?

Front

byte, char, sbyte, short, ushort, uint, ulong

Back

// Represent 12:30pm as a time lunchTime

Front

TimeSpan lunchTime = new TimeSpan(12, 30, 0);

Back

string a = "remove xxxxx the second word here"; // Remove the xxxxx Console.WriteLine( _____ );

Front

a.Remove(7, 6)

Back

How do you pass args in Visual Studio?

Front

Right-click Project Name [in Solution Explorer] > Properties > Debug > Enter parameters > Start

Back

// Add commas and decimals Console.WriteLine("Commas : _____ ", 23000000);

Front

{0:n4}

Back

What is the data type for a unicode character?

Front

char

Back

_______ function can be executed without needing to create an object

Front

Static function

Back

Function to write to the console?

Front

Console.WriteLine()

Back

string a = "i am a sentence"; // Insert the word "boring" after "i am a" Console.WriteLine( _____ );

Front

a.Insert(5, "boring ")

Back

StringBuilder sb = new StringBuilder("Random Text"); // Add text " is here" to StringBuilder

Front

sb2.AppendLine(" is here");

Back

string[] a = {"hello", "world"}; Console.WriteLine( ________ ); // desired output: // hello world

Front

string.Join(" ", a);

Back

What namespace is needed for StringBuilder?

Front

using System.Text;

Back

string[] args = {"a", "b", "c"} // iterate through with index for method

Front

for(int i = 0; i < args.Length; i++) {}

Back

private static bool GT10(int val) { return val > 10; } int[] numArray = { 1, 11, 22 }; // output first number greater than 10 Console.WriteLine("> 10 : {0}", ___ ));

Front

Array.Find(numArray, GT10)

Back

Create a string sb with StringBuilder

Front

StringBuilder sb = new StringBuilder("Random Text");

Back

int[] numbers = {1, 4, 2, 9} // sort this list Console.WriteLine( ___ )

Front

Array.Sort(numbers);

Back

What is the true/false data type?

Front

bool

Back

string name = ""; // Assign User Input into the variable name

Front

name = Console.ReadLine();

Back

create a string array with "bob", "sally" and "sue"

Front

string[] customers = { "Bob", "Sally", "Sue" };

Back

// Use the format method to inject the words "name" and "Prince" // Output: My name is Prince Console.WriteLine( _____ );

Front

String.Format("My {0} is {1}", "name", "Prince")

Back

string a = "the sky is green"; // Replace "sky" with "grass" Console.WriteLine( _____ );

Front

a.Replace("sky", "grass")

Back

string a = "i am a string but how long?"; // Write string length Console.WriteLine( _____ );

Front

a.Length

Back

// Limit to three decimal places Console.WriteLine("3 Decimals : _____", 23.12345);

Front

{0:f3}

Back