100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Computer Science Chapter 12 Notes £9.75   Add to cart

Lecture notes

Computer Science Chapter 12 Notes

 10 views  0 purchase

This is a comprehensive and detailed note on Chapter 12; Data structures for computer science. Essential!!

Preview 2 out of 6  pages

  • July 30, 2024
  • 6
  • 2020/2021
  • Lecture notes
  • Prof. ronald
  • All classes
All documents for this subject (8)
avatar-seller
anyiamgeorge19
CIE IGCSE COMPUTER SCIENCE
Practical problem-solving and programming
Chapter 12 – Data structures: arrays and using pre-release material
12.1 Introduction
One of the advantages of using computer systems is their ability to accurately repeat the same task many
times, for example, producing electricity bills or calculating exam scores. In order to do this, programs are
written with loops for repetitions to work with lists of similar items.

These lists are identified by the use of a single name and each item in the list can be found by an index
number showing the place in the list. This type of list is called a one-dimensional array. The items in the list are
the elements of the array.




12.2 Arrays
12.2.1 One-dimensional arrays
In order to use a one-dimensional array in a computer program, consider:
 what the array is going to be used for, so it can be given a meaningful name
 how many items are going to be stored, so the size of the array can be determined
 what sort of data is to be stored, so that the array can be appropriate data type.

For example, if a one-dimensional array for all the students’ test marks in a class was to be set up:

 array name StudentMarkTest
 number of items = number of students in the class, this could be a constant NoStudents
 whole numbers need to be stored, data type Integer.

Arrays usually start at element 0 or element 1. Often if an array starts at element 0, the size of the array is
given as one more than required and element 0 is not used.




1

, Above is array declaration in JavaScript.




Above is declaration of lists and arrays in Python.

12.2.2 Using a variable as an index in an array
In order to repeat the same task many times for all the items in a list, each item needs to be referred to in the
same way using the index number for each element of the one-dimensional array. If a variable is used for this
index number, then the same code can be re-used for each item.




This allows several arrays to be used together with the same index number to show related information, for
example, each student could sit more than one test and the name and gender of the student could also be
recorded.




2

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller anyiamgeorge19. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for £9.75. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

60434 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy revision notes and other study material for 14 years now

Start selling
£9.75
  • (0)
  Add to cart