Flashcards
programming fundalmentals
Cards in this deck (25)
- 1Define the following terms: a)interpreter b)compiler*interpreter: this is a program that executes instructions written in high level languages
*compiler :this is program that translates source code into object code - 2list data types that are used in c/c++ programmingint
float
double
char
string
void - 3structure sections of c programdocumentation sections
link section
definition section
global declaration section
main()function section
subprogram function - 4what is dynamic memory allocationallocation is done during program execution
- 5syntax of nested ifif(condition){
if(condition) { statements; }else{ statement; }} else{statement; } - 6syntax if statementif(condition{ true statement;} else{ false statement;}
- 7what is decision making statementsthese are statements that enable program to check certain condition in program execution
- 83 types of condition statementsif statement
if else statement
nested if statement
branching statement - 9syntax of switch caseswitch(expression){
case constant1:
group of statement1;break;
case constant 2:
group statement2;break;
default:
default group of statement;} - 10what is a functionthis is a self-contained block of statements that perform logical task
- 11concepts of object oriented programmingobjects
class
data encapsulation
inheritance
polymorphism
constructor
delegation
message instance - 12editors to be used to implement small program languagessublime text
notepad++
blue fish
brackets
script - 13compare debug from bugsdebug is a processs of removing errors in written program
while
bugs are errors - 14types of errorscompile(syntax):when you break rules of comp programing language
run time: when trying to do impossible arithmetic operations e.g find square root of -8
logic error: program runs but produces wrong result - 15explain javascriptthis is object-based-client-side scripting language used to create dynamic webpages
- 16show how to create object oriented programming languageclass_Name_objectName();
- 17what is recursionthis is the technique of making a function call itself. it breaks complicated problems into simpler ones easy to solve
- 18(pure)functionsthey are functions that have the following x-tics: function return values are identical for identical arguments and application has no side effects
- 19variable syntaxdatatype var1,var2,varn
where var is name of variables
e.g: int num1;
float num1,num2; - 20rules for naming variable-must start with a letter
-max length of 31 characters
-upper and lower case variables are different(case sensitive)
-should not be a keyword
-white space is not allowed - 21variable declaration methods-local declaration: declare variable inside the main block and its variable within the block ex: int a,b/*global declaration*/ main(){intc;/*local declaration*/
-global declaration: declare variable outside the main block and its value through out the program - 22steps for enqueue operation-check if queue is full
-if queue is full produce overflow error and exit
-if queue is not full, increment rear pointer to point to the next empty space
-add data element to the queue location where the rear is pointing
-return success - 23steps for dequeue operation-check if queue is empty
-if queue is empty, produce underflow error and exit
-if queue not empty, access the data where front is pointing
-increment front pointer to point to the next available data
-return success - 24constructorthis is a special function that is called whenever a new object of this class is created.
it must have same name as class and cannot have return type; - 25destructorsinteger(){}
does not take any arguments not does it return any value
Information
- Description
- level12 programming fundalmentals Flashcards on programming fundalmentals, created by Liata Sifa ornella on 01/04/2023.
- Created by
- Liata Sifa ornella
- Views
- 1
- Rating