Coding - practical 1 Flashcards
What should comments be used for?
To explain what’s going on and to make the code easier to understand and read.
What should you use // for?
Use // for writing single line comments.
What should you use /**/ for?
Use /* */ for writing comments across multiple lines
What are quotation marks (‘’ ‘’) used for?
Quotation marks (“ “) are used to include files that we write ourselves.
What are triangle brackets (< >) used for?
Triangle brackets (< >) are used to include C++ library files.
What is the run function?
The run function is where your code gets executed.
What do you use when you want to print text?
The std::cout stream
What are «_space;used for in the std::cout stream?
The two triangles arranged like this are used to insert data, i.e. we are inserting the text we want to print to the STandarD C++ OUTtput.
Why can we write std::cout?
We can write std::cout because the header file was included, which is where std::cout is declared.
What does the ; do?
Terminates a C++ statement
What does aserveOscillator() do?
aserveOscillator() switches on an oscillator with the settings that are specified as its four
arguments.
What are the 4 arguments inside aserveOscillator(a,b,c,d);?
a = oscillator number (0 – 23) b = oscillator frequency (0.0 - 20000.0) c = oscillator amplitude (0.0 - 1.0) d = oscillator wave form (0 – 5)
What is the oscillator function call followed by?
A call to aserveSleep(), which causes the program execution to pause for the time specified in milliseconds (i.e. aserveSleep(1000); pauses the program for 1 second).