Step 3

Step 3 introduces a number of new data types, derived from the simple integer and floating point types we earlier used. The theory of this step, arrays, strings, structures and pointers, spans quite a large area and is often considered advanced to newcomers. Therefore, the practical applications are divided in two distinct parts: part A and part B. 4 lab-points shall be reported for each part = 8 lab-Points in total for an approved step. However, steptest 3 covers both parts.

Part A covers Chapter 5: Arrays and Strings (p. 81-104) and first part of Chapter 10: Structures (pages 215-219).
Part B covers Chapter 6: Pointers (p. 105-126).

Please note that recommended reading in Study section is reflected in the Step test! If you have the equivalent knowledge, you are expected to pass the test by a good margin. The test MAY also contain questions from other material on the site – such increased knowledge is what will enable the highest grade, and is thus not a requirement to pass the exam.

Objectives

After Step 3 you will be able to handle complex data types like arrays, strings, structures and pointers. You will know how to correctly define and initialize them, and how to assign or retrieve its data in a proper manner, with use of the operators introduced. You will master simpler methods of sorting/manipulating data, as well as have a basic understanding of how different data types can be used in conjunction (eg array with structures/array with pointers). You should be able to describe relationships between pointers and arrays (or strings) and finally, you should also know how to provide a safe handling of data through pointers, by use of good programming conventions.

The programming constructs of step 1-2 is now expected to be well grounded and should be properly used with the new concepts, as well as previous requirements of good programming style and coding standard should be applied.

Content

  • One-dimensional arrays
    • simple sorting with  Bubble Sort
  • C-strings
    • reading input with cin.getline()          Do not use gets() or just cin (They are not secure)
    • standard functions for string manipulation from cstring
  • Multidimensional arrays
    • arrays with strings
  • Structures
    • parts of a structure template
    • initialization as well as access of members
    • array with structures
  • Pointers
    • address operator & and dereference operator *
    • pointer arithmetic
    • pitfalls with pointers
  • Pointers and arrays
    • array with pointers

Practical applications

Part A has 14 lab tasks and Part B has 11 tasks, among which you make appropriate choices to achieve 4 points for each part (minimum requirements for approved step). Note that task 2 in Part A is mandatory, as well as task 1 in Part B.

Stick to the deadline and be thorough in studying! Even if you feel that you master the principles – start from the 0-point-tasks (which are completely resolved and commented). They show the policies we consider should be applied to your code, ie important recommendations to follow! And do remember - following them improves your chances of a higher grade!

Please note the possibility to program your very own laboratory assignment, which may qualify for a maximum of 6 points (the teacher makes this assessment). A “specification of requirements” on such a task could be that your work in all areas should meet the objectives of this step.

Welcome to CoursePress

en utav Linnéuniversitets lärplattformar. Som inloggad student kan du kommunicera, hålla koll på dina kurser och mycket mer. Du som är gäst kan nå de flesta kurser och dess innehåll utan att logga in.

Läs mer lärplattformar vid Linnéuniversitetet

Student account

To log in you need a student account at Linnaeus University.

Read more about collecting your account

Log in LNU