Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Brunel - Computer Science - CS1702 Introductory Programming Lecture Notes (Exam Revision)

Rating
-
Sold
-
Pages
33
Uploaded on
06-01-2024
Written in
2018/2019

These are the lecture notes I created which I used to revise for the CS1702 Introductory Programming exam at Brunel University in which I received a First Class in.

Institution
Course

Content preview

Module: CS1702
Lecture Topic: Introduction to Programming & Problem Solving
Week: 1


In 1936 Alan Turing created two concepts called a “Turing Machine” and a “Universal Turing
Machine”. These were used to show that the “Decision Problem” was impossible to solve.

 In 1939 Alan Turing used his ideas to create a machine called “The Bombe” which helped
crack the German enigma code.
 In 1948 the first computer (called the Baby) and associated computer program were
developed at Manchester University based on Turing ideas.



Computer: a device for carrying out certain types of algorithms
Algorithm: set of steps for solving a problem
Computer Programming Language: a language for describing algorithms to computers
Computer Program: a description of a single algorithm and/or problem
Computer Software: is a collection of programs that carry out a similar task, e.g Windows.

+ Computers can perform many mundane tasks faster (e.g calculations)
+ Some tasks can only be done by computers (e.g high precision robotics)
- Computers can be useless for tasks such as rating films.

 Computers understand binary, sequences of zeros and ones.
 A computer language is a method of allowing us to describe to a computer what we want to
do. It is then translated by the computer into binary, so the computer can understand it.



Programming Concepts

Source Code: The computer files that contain a computer program
Snippet: A smell segment of source code
Blocks: Set of statements that perform a specific task
Variables: Symbols whose value can change during the execution of the program
Statements: A computer program is made up of many statements, it is the smallest building block of
a computer program
Reserved Words: Special computer programming instructions which cannot be used for variable,
class and method names.
Syntax: Computer equivalent of grammar, languages have rules governing how statements can be
used and written.
Compilation: The process of converting code to something the computer understands (machine
code – binary)

,Module: CS1702
Lecture Topic: Introduction to Programming & Problem Solving
Week: 2


The Waterfall Methodology:
Analysis>Design>Implementation>Testing>Maintenance
Analysis: What we need to do, specify the project
Design: How are we going to do the project
Implantation: Write the program code
Testing: Thoroughly test the project (unit, black/white box testing)
Maintenance: Recording user problems and fixing the problems.
Others include, rapid prototyping (series of prototypes either evolved or trashed), extreme
programming (done in pairs, very small steps developed, each step tested) , agile dev (feedback
through testing to evolve software, user centred development)



Object Oriented Programming

Example: Java is an OOP Language

This is the process of breaking down an application into smaller objects that provide specific
functionality Object Oriented Languages were developed to solve the problems involved in
developing software such as:
- Most development effort spent on maintenance
- Making changes to large programs is very difficult
- The larger the program the more faults (exponential)

OO design/OOP must be used for dev of very large software: ~>50,000 lines of code

An object is a programming construct that usually holds data and represents a key component of a
programming problem.
A class is a description of an object
An object is an instance of a class

Problem Solving

The process of finding solutions to difficult or complex issues
Computer based solutions are faster, more accurate, some problems can only be solved by a
computer.

George Pólya – Hungarian Mathematician

-Understand the problem: What are you trying to do, what more do you need to know, is there
data, tear the problem definition apart and examine the pieces.
-Make a plan: What similar problems have already been solved, can these be
used/adapted/approach the same? Flow charts, break it down into manageable parts, what
resources are available.
-Carry out the plan: Write the program, implantation. If it doesn’t work – change/review the plan.

,-Reflection, how could things be better: Testing, does it work, does it do what its meant to,
stakeholder satisfied? Can you reuse your program, has it been designed in a reusable manner?

, Module: CS1702
Lecture Topic: Variables
Week: 3
Variables are fundamental in programming language. A variable is a symbol that is used to store a
value. The value can change during the execution of a program.
You can store a value in it, take the value out of it, add a different value in it, update the value in it

string x = “Hello World!”;  Assignment and declared variable in the same line
system.out.println(x);

You can also combine a set of variables and assigning a value to each on one line as long as they’re
the same data type.

Declare a variable, they must have a name and a type. Two variables can’t share the same name.
Names must begin with an alphabetical character. You cannot name a variable after a reserved
word.

Reserved Words:
abstract, assert, boolean, break, byte, case, catch, char, class, const*, continue, default, double, do,
else, enum, extends, false, final, finally, float, for, goto*, if, implements, import, instanceof, int,
interface, long, native, new, null, package, private, protected, public, return, short, static, strictfp,
super, switch, synchronized, this, throw, throws, transient, true, try, void, volatile, while




Type Description Range

boolean Logical true/false (1 bit)

byte Whole number -128 to 127 (8 bits/1 byte)

char Single character 16 bit unicode (2 bytes)

4.94065645841246544E-324 to
double Double-precision floating point (large numbers) 1.79769313486231570E+308 (8 bytes) -ve/+ve

1.40129846432481707E-45 to
float Single precision floating point 3.40282346638528860E+38 (4 bytes) -ve/+ve

int +/- whole number -2,147,483,648 to 2,147,483,647 (4 bytes)

-9,223,372,036,854,775,808 to
long +/- whole number, larger than an integer +9,223,372,036,854,775,807 (8 bytes)

short Short integer, smaller than an integer -32,768 to 32,767 (2 bytes)

String Variable length list of characters (char) Variable length

Written for

Institution
Study
Unknown
Course

Document information

Uploaded on
January 6, 2024
Number of pages
33
Written in
2018/2019
Type
Class notes
Professor(s)
Dr stephen swift (ssw)
Contains
All classes

Subjects

$4.76
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
cslbrunel Brunel University
Follow You need to be logged in order to follow users or courses
Sold
64
Member since
4 year
Number of followers
34
Documents
29
Last sold
3 hours ago
Brunel Computer Science (1st Class Honours)

I achieved a First Class Honours degree in Computer Science from Brunel University - I will be uploading some of my work. Please do not purchase any documents looking for the solution to your assignments or deliverables. No refunds / exchanges.

5.0

2 reviews

5
2
4
0
3
0
2
0
1
0

Trending documents

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