{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture 7 - Organizing Programs and Data (2)

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

Info icon This preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Organizing Programs and Data 2 Lecture 7 Hartmut Kaiser [email protected] http://www.cct.lsu.edu/˜ hkaiser /fall_2011/csc1254.html  
Image of page 1

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

View Full Document Right 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
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
Image of page 3

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

View Full Document Right 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
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 Language technicalities are specific to a given  9/15/2 011,  Lecture  7 CSC 1254,  Fall 2011,  Organizing  Programs  and Data  (2) 5
Image of page 5

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

View Full Document Right 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 Alphabetical, formatting vertically lining up 9/15/2 011,  Lecture  7 CSC 1254,  Fall 2011,  Organizing  Programs  and Data  (2) 6
Image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern