OFFERS! offer image Get Expert-crafted assignments
Save 51%

159102 Computer Science and Programming Assessment 2026 | Massey University

Looking for Plagiarism-Free Answers for Your US, UK, Singapore, New Zealand, and Ireland College/University Assignments?

Talk to an Expert
Published: 24 Mar, 2026
Category Assignment Subject Computer Science
University Massey University Module Title 159102 Computer Science and Programming

159.102 COMPUTER SCIENCE FUNDAMENTALS

1.

(a) Describe two different causes of delay while reading data from a hard drive. [2]

(b) Describe one way of minimising the delays in Question 1(a). [1]

(c) eBooks are typically about 200KBytes in size. If an eBook reader has 2GBytes of storage space, approximately how many books can be stored on the reader? [1]

(d) What does BIOS stand for? [1]

(e) List the sequence of steps that are performed by the BIOS when a computer is switched on. [2]

(f) What does USB stand for? [1]

(g) What characters are used for end-of-line in a Windows text file? [1]

(h) What does the C pre-processor do? [1]

(i) What does the C compiler do? [1]

(j) What does the C linker do? [1]

(k) What value does main return if it is successful? [1]

(l) Describe the difference between a static and a dynamic library. [2]

2.

(a) In a simplified empty file system, the file allocation table has 16 entries:

0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

The first two entries (each with a value of 0) are special and are where the FAT and the directory are stored. A normal entry with a value of 1 means that the corresponding sector on the disk is free. A normal entry with a value of 0 signifies the end of a chain of sectors. When allocating a new sector to a current unallocated free sector is always chosen. The directory, which contains the filenames and initial sectors, is always sorted alphabetically on the filename.

What do the FAT and directory contain for the following actions?

(i) Files f1 (5 sectors), then f2 (2 sectors) are added. [1]

(ii) File f1 is extended to 3 sectors. [1]

(iii) File f2 is extended to 5 sectors in total. [1]

(b) What is the decimal value of the binary number 1.001101 (where the ‘.’ is a binary point)? [1]

(c) What is the binary value of the decimal number 3.375 [1]

(d) Write, in hexadecimal, the 32-bit floating point representation of:
11.75 [1]

(e) Write, as a decimal, the value of the 32-bit floating point number that is represented by the hexadecimal number:
41230000
[1]

(f) Declare a C structure that can contain data describing an Electric car: its make (a string), its model (a string), its price in dollars, its number plate (a string), its colour (red, ‘blue’, etc.) and the maximum number of kilometres it can go on a full charge.
[4]

(g) Write a C function print_car_details that has an element of the above structure passed as an argument (via a pointer). The function prints the details of the Electric car in a suitable format.
[4]

(h) Assume that you already have a 10-element array a of the above structure. Write a piece of C code that uses a loop to find the Electric car that can go the most kilometres on a full charge.
Print the details of this car using your function in Question 2(g).
There will be a unique answer. [5]

3.

(a) In a project with many source files:

(i) What is usually placed in header files: declarations or definitions? [1]

(ii) Do you get a compile or link error if you define a function in more than one source file? [1]

(iii) How do you program your code to automate the project build? [1]

(b) A stack of up to 100 integers can be created using an array and an index k. Assume that the stored functions that are associated with stack.

(c) Allowing the user of the stack direct access to the index variable is not considered good programming practice, and can be overcome with functions are provided to do this:

Implement the two functions:
int empty() which returns 1 if the stack is empty and 0 otherwise
int full() which returns 1 if the stack is full and 0 otherwise

[2]

(d) A stack of integers, containing at least one integer, already exists. Using only the functions from your answers to Questions 3(b) and 3(c), write a piece of C code that removes all the numbers from the stack and replaces them with a single number, the average of all the original numbers.
The average can be found by dividing the sum of all the numbers on the stack by how many numbers were on the stack.
[3]

(e) What are the types of the following 4 variables?

(i) char * = 'T'; [1]

(ii) char *p = "a"; [1]

(iii) int a[80]; [1]

(iv) int q[5]; [1]

(f) Assuming you have the correct header files included and with the variables defined in Question 3(e), which of the following statements will generate a compile time error?

(i) a[0] = 'p';
[2]

(ii) *p = 'a';

(iii) q[0] = 8;

(iv) q[0] = (int )malloc(10sizeof(int));

4.

(a) The following lines of a valid C program are executed:

scanf(“%c %d”, &c, &i);

The user types in the following (where [Enter] is the Enter Key):
Apo Lo 111Enter

(i) What are the types of result, i, and c? [2]

(ii) What are the final values of result, i, and c? [2]

(iii) Why is there an a before the i in the call to scanf? [2]

(b) The permutations of a string, with no repeated letters, are all the different strings that can be formed by interchanging the letters of the string.

The permutations of "abc" are:
"cba", "cab", "bca", "bac" and "abc"

Printing all the permutations of the first n characters of a string s can be achieved by using a recursive function:

void print_permutations(char *s, int n);

The algorithm for the function is as follows:

if n is 1 then print the string s and return

otherwise start a loop where an integer j runs from 0 to less than n. Inside the loop:

swap the characters in positions j and (n-1) of the string s.
print all the permutations of the first (n-1) characters of the string s.
swap the characters in positions j and (n-1) of the string s.

Write the recursive function print_permutations. [6]

(c) Using your function in Question 4(b) write a main function that prints all the permutations of the string "cat" using the length of the string as the initial value for n. [2]

(d) What is the first permutation printed by the above program? [2]

Are You Looking Answer for 159102 Computer Science and Programming Assessment?

Pay & Get Assignment Now

Are you looking for assignment help in New Zealand for your 159102 Computer Science and Programming assessment at Massey University? We provide expert guidance to help you pass your assignments and exams with flying colors. Our team of professionals provides 100% plagiarism-free, AI-free, and high-quality assessment answers solutions tailored to your academic needs. We ensure timely delivery and help you understand complex concepts in a simple and easy-to-understand way. Improve your grades and secure your academic future with our reliable service. Contact us today and improve your academic performance!

Workingment Unique Features

Hire Assignment Helper Today!


Latest Free Samples for University Students

QUALIFI L5 BUS503 Business Development Assignment

Category: Assignment

Subject: Business Management

University: Qualifi

Module Title: BUS503- Business Development

View Free Samples

CII M92 – Insurance business and finance Coursework Assignment Answers

Category: CII Assignments

Subject: business

University: _______

Module Title: CII M92 – Insurance business and finance

View Free Samples

ECE5004 Professional Practicum 1: Early Childhood Education and Care Practicum Report Sample

Category: Assignment

Subject: Healthcare

University: New Zealand School of Education

Module Title: ECE5004 Professional Practicum 1: Early Childhood Education and Care

View Free Samples

BSBWHS414 Contribute to WHS Risk Management Assessment Answers Solution PDF

Category: Assignment

Subject: Management

University: _____

Module Title: BSBWHS414 Contribute to WHS Risk Management

View Free Samples

BSBWHS413 – Contribute to the implementation and maintenance of WHS consultation and participation processes Assessment Answer

Category: Assignment

Subject: Management

University: ________

Module Title: BSBWHS413 – Contribute to the implementation and maintenance of WHS consultation and participation processes

View Free Samples
Online Assignment Help in UK