[go: up one dir, main page]

0% found this document useful (0 votes)
29 views35 pages

Chapter 2 Flash Cards - Part 2

Uploaded by

aashmurugappan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views35 pages

Chapter 2 Flash Cards - Part 2

Uploaded by

aashmurugappan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

How to use these flash cards

• Creating your own flash cards is a great way to revise


• On one page there are pre-created questions
• On the second page write out how you would answer that question, you
can include images and coloured text to help
How do you Output Data to
a Computer Display
Output
Output
How do you Input Data to a
Compute
Input
Input

Keyboard
How do you Show the
Length of a String
Length of a String
Length of a String

int length = text. Count();


How do you Show the Position
of a Character in a String
Position of a Character
Position of a Character

IndexOf() method
How do you Concatenate a
String to another String
Concatenation
Concatenation

You concatenate strings by using the + operator. For string literals and
string constants, concatenation occurs at compile time; no run-time
concatenation occurs. For string variables, concatenation occurs only at
run time.
How do you Loop through a
String
Loop through a String
Loop through a String

For (int i =0; i< 10;i++)


How do you Convert
between Ascii and Char
Convert between Ascii and Char
Convert between Ascii and Char
Method 1: Using the Convert.

ToChar method is a straightforward way to convert ASCII values to characters in


C#. It takes an integer representing the ASCII value as an argument and returns
the corresponding character.
How do you create a
Random Number
Random Number Generation
Random Number Generation

Random random = new Random();


int randomNumber = random. Next();
What is A Subroutine
Subroutines
Subroutines

Subroutines are small programs inside the main program


performing a well-defined self-contained task.
What is A Function
Functions
Functions

In C#, a function is a way of packaging code that does something and then
returns the value
What is A Subroutine or
Function Argument
Arguments
Arguments
Functions and subroutines operate similarly but have one key difference. A function is
used when a value is returned to the calling routine, while a subroutine is used when
a desired task is needed, but no value is returned.
What is A Subroutine or
Function Parameter
Parameters
Parameters
Parameters are the input for a function that are necessary for it to execute and produce a
result. Parameters are variables defined by name and type. They are specified in the function's
declaration.
What is a Function Return
Value
Return Values
Return Values

When your function returns the value.


What does Variable Scope
mean?
Variable Scope
Variable Scope

A variable scope refers to the availability of variables in certain parts of the


code.
Explain the Concept of
Subroutine Interfaces
Subroutine Interfaces
Subroutine Interfaces
An interface in C# is a contract that defines a set of methods, properties, events, and
indexers that a class or struct must implement.
Explain the Concept of
Modularised Programming
Modularised Programming
Modularised Programming
Modular programming is a general programming concept where developers separate
program functions into independent pieces. These pieces then act like building blocks,
with each block containing all the necessary parts to execute one aspect of functionality.
Explain Advantages of
Subroutines and the Structured
Approach
Structured Approach
Structured Approach
Subroutines are usually small in size, which means they are much easier to write, test and
debug. They are also easy for someone else to understand. As they are written outside of
the main program, subroutines can be saved separately as modules and used again in
other programs.

You might also like