100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

Introduction To Programming COS1511

Rating
-
Sold
-
Pages
5
Grade
A+
Uploaded on
16-10-2024
Written in
2024/2025

Introduction To Programming COS1511 IDE - ANSWERSIntegrated Development Environment cout - ANSWERSStands for console output; the standard output stream object in C++; used with the insertion operator to display information on the computer screen #include iostream - ANSWERSThe include directive needed to allow use of the various I/O operators such as cout and cin. using namespace std; - ANSWERSDeclares that the program will be accessing entities whose names are part of the namespace called std int main() - ANSWERSThe header for the main function of the program, int tells compiler function will be returning an integer (return 0;) Statement Terminator - ANSWERSThe semicolon (;) is used to indicate the end of a statement. Comments - ANSWERSUsing descriptive text to explain portions of code. Comments do not change the way a robot behaves, but are important for the programmer to remember what the code does. endl; - ANSWERSA stream manipulator used with cout that can be used to advance the cursor to the next line on the computer screen Syntax Rules - ANSWERSProgramming syntax rules must be followed for the compiler to understand you Good Programming Style - ANSWERSLeaving open lines, putting statements on seperate lines, using comments in code, indenting code etc. BODMAS - ANSWERSBrackets, Order, Division, Multiplication, Addition, Subtraction Data Type: Integer - ANSWERSInteger numerical ; No decimals/fractions (Even with division); Positive and Negative Numbers; Variable - ANSWERSWe declare a var with a name so we can refer to the value stored in the memory position in a program; Use meaningful names; Always declare or initialise before use. Variable and Function Name Rules - ANSWERSCannot start with a numeric character, but numbers and all letters can be used after that; Can start with or have an underscore _ ; Cannot used reserved names, eg. int, return. Case Sensitive. Can use CamelNotation.

Show more Read less
Institution
Introduction To Programming COS1511
Course
Introduction To Programming COS1511

Content preview

Introduction To Programming COS1511
IDE - ANSWERSIntegrated Development Environment

cout - ANSWERSStands for console output; the standard output stream object in C++;
used with the insertion operator to display information on the computer screen

#include <iostream> - ANSWERSThe include directive needed to allow use of the
various I/O operators such as cout and cin.

using namespace std; - ANSWERSDeclares that the program will be accessing entities
whose names are part of the namespace called std

int main() - ANSWERSThe header for the main function of the program, int tells
compiler function will be returning an integer (return 0;)

Statement Terminator - ANSWERSThe semicolon (;) is used to indicate the end of a
statement.

Comments - ANSWERSUsing descriptive text to explain portions of code. Comments
do not change the way a robot behaves, but are important for the programmer to
remember what the code does.

endl; - ANSWERSA stream manipulator used with cout that can be used to advance
the cursor to the next line on the computer screen

Syntax Rules - ANSWERSProgramming syntax rules must be followed for the compiler
to understand you

Good Programming Style - ANSWERSLeaving open lines, putting statements on
seperate lines, using comments in code, indenting code etc.

BODMAS - ANSWERSBrackets, Order, Division, Multiplication, Addition, Subtraction

Data Type: Integer - ANSWERSInteger numerical ; No decimals/fractions (Even with
division); Positive and Negative Numbers;

Variable - ANSWERSWe declare a var with a name so we can refer to the value stored
in the memory position in a program; Use meaningful names; Always declare or
initialise before use.

Variable and Function Name Rules - ANSWERSCannot start with a numeric character,
but numbers and all letters can be used after that; Can start with or have an underscore
_ ; Cannot used reserved names, eg. int, return. Case Sensitive. Can use
CamelNotation.

, Modulo (or "mod") - ANSWERSthe name of the mathematical operation. Modulo gives
the remainder from dividing two numbers. For example: 17 MOD 13 is 4.
X MOD 1 is always 0.

Assignment Operator - ANSWERSThe '=' character causes the compiler or interpreter
to evaluate to the expression on its right and store the result in the variable(s) on its left.
Variable = Expression;

Compound Assignment Operator - ANSWERSan operator that combines assignment
(setting value of the variable) with another operation, such as addition or subtraction.

Unary Increment and Decrement Operators - ANSWERSThese operators (++, --)
together with the variable they are operating on, return a value, which depends on if
operator is used in prefix or postfix form.

Prefix Form (++i or--i) - ANSWERSFirst increments/decrements the variable, then uses
the incremented value in the expression.

Postfix Form (i++ or i--) - ANSWERSFirst uses the current variable value in the
expression, and then increments/decrements the variable.

Variable Diagrams - ANSWERSCan be used to work out what complicated programs
do, help you find bugs in your program.

Data type: double - ANSWERSFundamental data type built into compiler used to define
numeric variables holding numbers with decimal points.

Data Type: Float - ANSWERSShortened term for Floating Point; Fundamental data
type built into compiler used to define numerical variables with floating decimal points.

cout.setf(ios::fixed) - ANSWERSSets numbers to non-scientific

cout.precision(2); - ANSWERSSets decimals to 2, default is 6

Implicit Conversion / Coercion - ANSWERSA conversion from one data type to another
that occurs automatically by the compiler, information can be lost (eg, conversion of
Float to Int)

Explicit Conversion / Type Casting - ANSWERSThe data type transformation caused
using a cast operator. We place value to be converted in parenthesis and procede it
withnthe type we wish to convert it to.

Scientific Notation - ANSWERSC++ outputs floating point in fixed or scientific notation,
which is a method of writing or displaying numbers in terms of a decimal number
between 1 and 10 multiplied by a power of 10. Prevented using cout:setf(ios::fixed)

Written for

Institution
Introduction To Programming COS1511
Course
Introduction To Programming COS1511

Document information

Uploaded on
October 16, 2024
Number of pages
5
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$10.49
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
muchiracalorine

Get to know the seller

Seller avatar
muchiracalorine waldern university
View profile
Follow You need to be logged in order to follow users or courses
Sold
2
Member since
2 year
Number of followers
1
Documents
137
Last sold
11 months ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions