Practical C++ Programming by manish baranwal

Start from the beginning
                                        

where the machines are and where to go for help.

Review Questions

1. Define “class.”

A set of data and the functions that work on that data.

2. Where are the computers that are to be used for homework for this course?

3. What compiler are we using for this course?

Page 3

Chapter 2: The Basics of

Program Writing

The first and most important thing of all, at least for writers today, is to strip language clean, to lay it

bare down to the bone.

— Ernest Hemingway

Teacher’s Notes

In this chapter we give students an idea of what a programming language is. We try to give students an

idea of the work done to translate a high-level programing language into an executable program.

Finally, we have a section that describes in extreme detail the steps needed to run a compiler. Four

specific compilers, Borland-C++, Microsoft Visual C++ .NET, GNU’s g++, and a generic UNIX CC

compiler, are described.

Computers require precise instructions in order to work. We start by introducing the students to a

language they probably already know: English. Even with English, precise instructions are hard to

create.

Programming languages have evolved over the years. In the beginning everyone programed in machine

language. This evolved through assembly language, higher level language, the C language, to the C++

language. This chapter gives a brief description of each of these stages.

Next the students are introduced to the tools used to create programs. At this point I suggest that you tell

the students the absolute minimum needed to actually use the tools and no more. After that they can

either learn by reading the manual or you can give little ten minute mini-lectures at the beginning of

future classes.

But for now they need to know only how to use the editor, compiler, linker, and the make utility. If they

are programming in DOS or Microsoft Windows, a short tour of the various components of the

Integrated Development Environment is in order.

At this point it would be good to demonstrate creating a program. I suggest that you deliberately include

a mistake. This gives you a chance to show the students what an error message looks like and how to

correct it.

When the chapter is finished the students should be able to type in a program and get it to run. The

program won’t be understandable to the student at this point, but it will be enough to get something to

run.

Live Demonstration

Slide 13 hello/hello.cpp

Page 4

You've reached the end of published parts.

⏰ Last updated: Nov 04, 2012 ⏰

Add this story to your Library to get notified about new parts!

Practical C++ Programming by manish baranwalWhere stories live. Discover now