Flashcards
FOP Exam
Flashcards do conjunto (23)
- 1When creating a function, if its not returning anything to another function, what is needed?void
- 2How is a item passed as a source?Pass it by reference
- 3When the system is counting (e.g. countGivenITemOnGrid) what procedure call will it be?int
- 4If a array has a row and column, how many for loops will be needed?two, but one for loop must be within the other for loop (nested)
- 5If there is a int procedure, what do you need at the end?return (you return the declared integer within the code)
- 6In a case code, what is needed after the case?break;
- 7For a array, where should the array start?0
(e.g. name[0];) - 8How do you check for a empty letter?name =="";
(NOT name = "";) - 9Whats the difference between && and ||&& = and
|| = or - 10Can a return be in any loops or conditions?No
It can only be in the procedure - 11Whats missing? for(pos = 0; pos < size; ++pos)for(int pos = 0; pos < size; ++pos)
- 12if a variable is made a constant (const) what else is needed?const int i = 1;
- 13What's the disadvantage with array?inserting and deleting a value can cause data loss
- 14Whats the best way to store a data from a array?Saving it to a Text file
- 15What is the advantage using a parameter?Its more secure and only functions that need it will be passed directly
- 16For any function that has a input...You must set a precondition to reduce the possibility of errors
- 17What happens to assert when its in release?It comments it out!
- 18Write a C++ function enterPlayerName() that takes a parameter which allows text to be entered and submitted.void enterPlayerName(string& name){
cout << "Enter Player name: ";
cin >> name; } - 19What is the difference between dx and dy?dx moves the object left and right
dy moves the object up and down - 20To make the object disappear off the grid, what does the coordinates need to be?0
This needs to be for both x and y axis (NOT dx and dy) - 21Whats the problem with this C++ code: Bool found = false;Code should look like this:
bool found (false); - 22What are parameters?Parameters are individual data types that store information depending on what is assigned to them (e.g. bool option) - option would be a parameter.
- 23Whats Missing? int main { //condition goes in here }No parameters in the main function
int main()
Informações
- Descrição
- FlashCards sobre FOP Exam, criado por b3014292 em 15-05-2014.
- Criado por
- b3014292
- Visualizações
- 181
- Avaliação