Programming Fundamentals at Radboud University | Flashcards & Summaries

Suggested languages for you:

It looks like you are in the US?
We have a website for your region.

# Lernmaterialien für Programming fundamentals an der Radboud University

Greife auf kostenlose Karteikarten, Zusammenfassungen, Übungsaufgaben und Altklausuren für deinen Programming fundamentals Kurs an der Radboud University zu.

TESTE DEIN WISSEN

What does the WriteLine method do?

Lösung anzeigen
TESTE DEIN WISSEN

This method prints out (output) the information (variables, integers, doubles en string and much more) on the screen and does this always on a new line. The Console.Write method prints out information but does this always on the same line.

Lösung ausblenden
TESTE DEIN WISSEN

How many bits is a byte?

Lösung anzeigen
TESTE DEIN WISSEN

A byte is 8 bits.

Lösung ausblenden
TESTE DEIN WISSEN

What is a class?

Lösung anzeigen
TESTE DEIN WISSEN

It is a group that contains data and methods. They are contained within braces tha belong to the namespace. It is like a classification system.

Lösung ausblenden
TESTE DEIN WISSEN

How would you create the constructor with arguments?

Lösung anzeigen
TESTE DEIN WISSEN

class Cost

{

private double amount;

private double price;

public Cost(double a) // This is the constuctor

{

amount = a;

price = .35;

}

public double Calc() // This is a method to include a return value of a calculation

{

return amount * price;

}

}

// Now you can call the constuctor with an object.

Lösung ausblenden
TESTE DEIN WISSEN

Give an example of how to code a namespace.

Lösung anzeigen
TESTE DEIN WISSEN

using System;

namespace Csharp_namespace

{

class MyClass

{

public MyClass()

{

Console.WriteLine("My Class");

}

}

}

class MyClient

{

public static void Main()

{

//Using the fully qualified name to     access the namespace member.

Csharp_namespace.MyClass mc = new

Csharp_namespace.MyClass();

}

}

Lösung ausblenden
TESTE DEIN WISSEN

Give an example of using 2 or more different namespaces with the same classes.

Lösung anzeigen
TESTE DEIN WISSEN

using System;

// Nested Namespace

namespace MyNamespace

{

namespace Nested

{

public class SampleClass

{

public static void myMethod()

{

Console.WriteLine("Nested Namespace Example");

}

}

}

}

namespace MyProgram

{

public class MyClass

{

public static void Main()

{

MyNamespace.Nested.SampleClass.myMethod();

}

}

}

Lösung ausblenden
TESTE DEIN WISSEN

What are some things you have to remember about a constructor?

Lösung anzeigen
TESTE DEIN WISSEN

1. The constructor name must match the class name, and it cannot have a return type (like void or int).

2. The constructor is called when the object is created.

3. All classes have constructors by default: if you do not create a class constructor yourself, C# creates one for you. However, then you are not able to set initial values for fields.

Lösung ausblenden
TESTE DEIN WISSEN

How can you create a method?

Lösung anzeigen
TESTE DEIN WISSEN

1. within the class code block create '(you could also add public if you want to use it outside the class) "static void myMethod() {}"

2. within the curly brackets of myMethod() add the code you'd want.

3. you can add parameters in between the parenthesis of myMethod(), for example;

static void myMethod(string fname)

{

Console.WriteLine(fname + "you are it!");

}

4. You can call the method in the static void Main(string[] args){} method.

Lösung ausblenden
TESTE DEIN WISSEN

What does args in the main method stand for?

Lösung anzeigen
TESTE DEIN WISSEN

It is a parameter in the main method that accesses a string array that is called args, this is in array that is populated with several command-line arguments from the operating system. This makes configurating programs less complex.

Lösung ausblenden
TESTE DEIN WISSEN

Lösung anzeigen
TESTE DEIN WISSEN

// constructor when the types of arguments

// are different

using System;

int x, y;

double f;

string s;

// 1st constructor

{

x = a;

f = b;

}

// 2nd constructor

{

y = a;

s = b;

}

Lösung ausblenden
TESTE DEIN WISSEN

What is important for the writeline method to work?

Lösung anzeigen
TESTE DEIN WISSEN

1. You have to write the message within openening and closing parenthesis (). This is the containter for the information.

2. You have to write everything between double quotes, with the exception of variables and so on.

3. Every output of the writeline method is always in string datatype.

Lösung ausblenden
TESTE DEIN WISSEN

How many byte is a kilobyte?

Lösung anzeigen
TESTE DEIN WISSEN

A kilobyte is 2^10 bytes or also 1024 bytes.

Lösung ausblenden
• 23306 Karteikarten
• 290 Studierende
• 3 Lernmaterialien

## Beispielhafte Karteikarten für deinen Programming fundamentals Kurs an der Radboud University - von Kommilitonen auf StudySmarter erstellt!

Q:

What does the WriteLine method do?

A:

This method prints out (output) the information (variables, integers, doubles en string and much more) on the screen and does this always on a new line. The Console.Write method prints out information but does this always on the same line.

Q:

How many bits is a byte?

A:

A byte is 8 bits.

Q:

What is a class?

A:

It is a group that contains data and methods. They are contained within braces tha belong to the namespace. It is like a classification system.

Q:

How would you create the constructor with arguments?

A:

class Cost

{

private double amount;

private double price;

public Cost(double a) // This is the constuctor

{

amount = a;

price = .35;

}

public double Calc() // This is a method to include a return value of a calculation

{

return amount * price;

}

}

// Now you can call the constuctor with an object.

Q:

Give an example of how to code a namespace.

A:

using System;

namespace Csharp_namespace

{

class MyClass

{

public MyClass()

{

Console.WriteLine("My Class");

}

}

}

class MyClient

{

public static void Main()

{

//Using the fully qualified name to     access the namespace member.

Csharp_namespace.MyClass mc = new

Csharp_namespace.MyClass();

}

}

Q:

Give an example of using 2 or more different namespaces with the same classes.

A:

using System;

// Nested Namespace

namespace MyNamespace

{

namespace Nested

{

public class SampleClass

{

public static void myMethod()

{

Console.WriteLine("Nested Namespace Example");

}

}

}

}

namespace MyProgram

{

public class MyClass

{

public static void Main()

{

MyNamespace.Nested.SampleClass.myMethod();

}

}

}

Q:

What are some things you have to remember about a constructor?

A:

1. The constructor name must match the class name, and it cannot have a return type (like void or int).

2. The constructor is called when the object is created.

3. All classes have constructors by default: if you do not create a class constructor yourself, C# creates one for you. However, then you are not able to set initial values for fields.

Q:

How can you create a method?

A:

1. within the class code block create '(you could also add public if you want to use it outside the class) "static void myMethod() {}"

2. within the curly brackets of myMethod() add the code you'd want.

3. you can add parameters in between the parenthesis of myMethod(), for example;

static void myMethod(string fname)

{

Console.WriteLine(fname + "you are it!");

}

4. You can call the method in the static void Main(string[] args){} method.

Q:

What does args in the main method stand for?

A:

It is a parameter in the main method that accesses a string array that is called args, this is in array that is populated with several command-line arguments from the operating system. This makes configurating programs less complex.

Q:

A:

// constructor when the types of arguments

// are different

using System;

int x, y;

double f;

string s;

// 1st constructor

{

x = a;

f = b;

}

// 2nd constructor

{

y = a;

s = b;

}

Q:

What is important for the writeline method to work?

A:

1. You have to write the message within openening and closing parenthesis (). This is the containter for the information.

2. You have to write everything between double quotes, with the exception of variables and so on.

3. Every output of the writeline method is always in string datatype.

Q:

How many byte is a kilobyte?

A:

A kilobyte is 2^10 bytes or also 1024 bytes.

### Erstelle und finde Lernmaterialien auf StudySmarter.

Greife kostenlos auf tausende geteilte Karteikarten, Zusammenfassungen, Altklausuren und mehr zu.

## Das sind die beliebtesten Programming fundamentals Kurse im gesamten StudySmarter Universum

##### Fundamentals of computing

American University in Cairo

##### Fundamentals of Nursing

Saint Mary's University

##### Programming CH2

King Khaled University

##### Computer Fundamentals and Programming

University of Perpetual Help, System Dalta

##### Laws Fundamentals

Western Mindanao State University