Lecture 7 - Organizing Programs and Data (2)

Lecture 7 - Organizing Programs and Data (2) -...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Organizing Programs and Data 2 Lecture 7 Hartmut Kaiser hkaiser@cct.lsu.edu http://www.cct.lsu.edu/˜ hkaiser /fall_2011/csc1254.html  
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Programming Principle of the Day Abstraction Principle Related to DRY as it aims to reduce duplication Each significant piece of functionality in a program  should be implemented in just one place in the  source code.  The basic mechanism of control abstraction is a  function or subroutine. Data abstractions include various forms of type  polymorphism.  9/15/2 011,  Lecture  7 CSC 1254,  Fall 2011,  Organizing  Programs  and Data  (2) 2
Background image of page 2
Abstract We will discuss data structures as the main  means of organizing data. We extend the student  grades example to work with more than one  student’s grades. We will introduce the concept of partitioning the  program into several files, separate compilation,  and linking. 9/15/2 011,  Lecture  7 CSC 1254,  Fall 2011,  Organizing  Programs  and Data  (2) 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Language technicalities Are a necessary evil A programming language is a foreign language When learning a foreign language, you have to  look at the grammar and vocabulary Because: Programs must be precisely and completely  specified A computer is a very stupid (though very fast)  machine 9/15/2 011,  Lecture  7 CSC 1254,  Fall 2011,  Organizing  Programs  and Data  (2) 4
Background image of page 4
Technicalities Don’t spend your time on minor syntax and  semantic issues. There is more than one way to  say everything Just like in English Most design and programming concepts are  universal, or at least very widely supported by  popular programming languages So what you learn using C++ you can use with  many other languages 9/15/2 011,  Lecture  7 CSC 1254,  Fall 2011,  Organizing  Programs  and Data  (2) 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Organizing Data Let’s revise student grades program for a whole  course (many students) Read grades from a file: Smith 93 91 47 90 92 73 100 87 Carpenter 75 90 87 92 93 60 0 98 We want to produce output (overall grade) Carpenter  90.4 Smith  86.8 9/15/2 011,  Lecture  7 CSC 1254,  Fall 2011,  Organizing  Programs  and Data  (2) 6
Background image of page 6
Organizing Data Need to store all student data
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 27

Lecture 7 - Organizing Programs and Data (2) -...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online