Fundamentals of Programming – Lecture 1

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/44

flashcard set

Earn XP

Description and Tags

A comprehensive set of question-and-answer flashcards that cover logistics, computing fundamentals, Unix basics, Python syntax, data types, control structures, and real-world scientific applications discussed in Lecture 1 of COMP1005/COMP5005 – Fundamentals of Programming.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

45 Terms

1
New cards

Which three assessment components make up the final grade in this unit?

Practical tests (20 %), assignment (40 %), and written exam (40 %).

2
New cards

What minimum score must you achieve on the assignment to pass the unit?

At least 15 % (it is a hurdle requirement).

3
New cards

How long is the final exam and when is it held?

2 hours during the official exam period.

4
New cards

Why is programming considered essential in modern science and engineering?

Because research tasks such as modelling, simulation, data analytics, and visualisation go beyond the capabilities of spreadsheets and require coding.

5
New cards

Name three key uses of computers in scientific work mentioned in the lecture.

Modelling and simulation, data analytics, and visualisation/communication.

6
New cards

Give one reason computer simulation is preferred over real experiments for some problems.

Some problems are too dangerous, too small, too big, or too expensive to test experimentally.

7
New cards

What multidisciplinary areas combine to form Data Science?

Computing, statistics, emerging internet technologies, and media studies.

8
New cards

What term describes the overwhelming growth of digital information highlighted in the ‘Internet Minute’ slide?

The data deluge.

9
New cards

Which real-world project uses more than 50 autonomous cameras to track meteors over 3 million km²?

The Desert Fireball Network.

10
New cards

What programming language is heavily used by the Desert Fireball Network team?

Python.

11
New cards

Define a computer in one sentence as given in the lecture.

A machine that accepts data, processes it, and produces output.

12
New cards

List the four main hardware components of a typical computer.

CPU, input/output devices, dynamic (main) memory, and secondary memory.

13
New cards

How many bits are in one byte?

8 bits.

14
New cards

Convert the decimal number 42 to binary.

42₁₀ = 101010₂.

15
New cards

What role does an operating system play?

It is system software that provides a layer between hardware and applications, making the hardware usable.

16
New cards

Name two mobile or desktop operating systems mentioned in the lecture.

Examples include Windows, macOS, Linux, iOS, Android, Chrome OS.

17
New cards

During which decade were high-level languages like Fortran and COBOL first introduced?

The late 1950s.

18
New cards

Give one advantage and one disadvantage of compiled languages such as C or C++.

Advantage: very fast execution; disadvantage: code is less readable and harder to learn.

19
New cards

List three scientific Python libraries included with Anaconda.

NumPy, SciPy, Matplotlib (others include Pandas and Jupyter).

20
New cards

State two reasons ‘Why Python?’ according to the lecture.

It is easy to learn and comes with a pre-bundled set of scientific modules; it is free and runs on all platforms.

21
New cards

Which major Python version (and sub-version) is used in the unit?

Python 3 (version 3.6.9).

22
New cards

How can you check which Python version is installed from the command line?

Run the command python3 and read the version banner, then type quit() to exit.

23
New cards

What symbol introduces a comment in Python code?

The # character.

24
New cards

Explain the purpose of the input() function in Python.

It prompts the user for input and returns the typed value as a string.

25
New cards

In Python, what is the difference between = and == ?

= is assignment; == is comparison for equality.

26
New cards

Give the Python operator for exponentiation and show an example.

** (e.g., 20 ** 2 evaluates to 400).

27
New cards

Name two values that evaluate to False in a Boolean context besides False itself.

0 (or 0.0), empty string "", empty list [], empty tuple (), empty dict {}, or None.

28
New cards

Write a simple while loop header that repeats until a variable finished becomes True.

while not finished: (followed by indented body).

29
New cards

How do you create a for loop that prints numbers 4 through 9?

for num in range(4, 10): print(num) # prints 4..9

30
New cards

Why are break and continue discouraged in this unit’s coding style?

Curtin Computing style enforces ‘one entry, one exit’ for readability and maintainability, so using break/continue will lose marks.

31
New cards

State the Unix philosophy in one of its three points.

Write programs that do one thing and do it well.

32
New cards

Which open-source operating system variant of Unix is used in the unit’s labs?

Linux.

33
New cards

Provide the general syntax pattern for most Unix commands.

command [option(s)] [filename(s)] (all case-sensitive).

34
New cards

What does the command ls –la do?

Lists the contents of the current directory in long format, including hidden files.

35
New cards

Describe the function of the pipe symbol | in Unix.

It connects the stdout of one command to the stdin of the next command.

36
New cards

Write a Unix command that redirects the output of history into a file called hist.txt.

history > hist.txt

37
New cards

Name two common Unix shells other than bash.

sh (Bourne shell), csh, tcsh, ksh (Korn shell).

38
New cards

What directory symbol represents the single top-level root in Unix file systems?

/ (forward slash).

39
New cards

Give the purpose of the pwd command.

Prints the current working directory.

40
New cards

Which Unix command shows the first ten lines of a file?

head filename (or head [filename]).

41
New cards

What command would you use to view a command’s manual page?

man command_name (e.g., man ls).

42
New cards

Explain the difference between > and >> in Unix redirection.

overwrites/creates a file with stdout; >> appends stdout to the end of an existing file.

43
New cards

Why might a loop become infinite, and how can you stop it from the keyboard?

If its termination condition is never reached; stop with Ctrl-C (or Ctrl-Z to suspend).

44
New cards

List four basic Python numeric, Boolean, or string types introduced in this lecture.

int, float, complex, bool, str.

45
New cards

What built-in Python function returns the data type of a variable?

type()