YOUR BGUNIX ACCOUNT
1. Get your BGUnix account
2. Login to your account
3. Configure your account
BGUNIX Documentation can be found at
BGUnix is a Sun Microsystems SunFire V440 se
What is an enumerated type?
Custom data type definition; helps with readability of programs
What library needs to be included to use input/output files?
What specific file type can be used for both input and/or output?
What do we mean when we say linked list?
Abstract data type
Nodes linked together
Head (and possibly Tail) pointers designate beginning (end) of
What do we mean when we append a node to the list?
Add at the end
How is the linked li
MEET OUR SUPPLEMENTAL INSTRUCTOR
CS2020, Spring 2016
MEET YOUR INSTRUCTOR
Office: Hayes Hall 236
M.B.A., BGSU (2016)
M.S. in Computer Science, BGSU (2002)
B.A. in Computer Science, SIU-Carbondale (1988)
PROCEDURAL VS. OBJECT-ORIENTED PROGRAMMING
Dividing problem into sub-problems usually implemented as
functions and operating on data passed to functions as pa
GRADES AND MORE
Grades are on Canvas
GRADES AND MORE
on BGUnix always do sanity check when submitting your lab or program
ls l (dash letter L but lower case)
check to make sure lab#.cpp and lab#.info is in the cs2020 directory
check to make sure prog#.
What do we mean by abstraction ?
a definition that captures general characteristics without details
What ADT (abstract data type) did we learn to define last time?
What is the purpose of structures?
To be able to store and manipula
Program 2 on Canvas - Due in two weeks from last Friday.
Needs to be called prog2.cpp
There is a data file prog2.txt that will need to be copied from lib
Needs to be located in your cs2020 directory
No news is good news :) when program colle
Program # 6
Pts : 25
Due: April 26
Step 1: I have created a base class named Appliance. This class will permit the use of polymorphism. This class contains the
following protected data.
the customers name
the name of
Write overloaded operator functions
Write functions for the base class and derived class
Understand the relationship between the base class and derived class
a. Tracing a recursive function
5. KNOW YOUR TERMS (th
How is procedural programming different than object oriented
Procedural programming: functions operate on data
Object oriented programming: objects combine functions & data
What 3 access specifiers are used in a class definition (
What three files are usually used to separate definition from
implementation from user/client of the class?
Code using the class (xxxclient.cpp)
What is stale data?
When data value depends
What is a pointer variable?
Variable capable of holding an address of a memory location
How to declare a pointer variable?
datatype* ptrvarname ; (e.g.,
How to initialize a pointer to NOT point to anything?
ptr = nullptr;
LAST DAY TO WITHDRAW IS FRIDAY 4/7
No need for
What is inheritance in context of OOP?
The ability to create new classes based on already existing classes
(base vs. derived / parent vs. child)
How do we set a pointer variable to point to an address (i.e.,
contain address of a memory location)?
ptr = &variable;
How are arrays and pointers related?
Array name can be used as a pointer, and vice versa
Pointer to the same data type as t
INSTANCE AND STATIC MEMBERS
Two kinds of members can be included in a class (data or methods):
instance: Each object has its own copy.
static: Shared among all objects of a class
static member function: can be used to access
LAB 5 MAIN()
/ allocate memory, create the list
/ menu validation loop
/ display menu and validate
while (choice <1 | choice >3);
/ Got valid menu choice, process it
LINKED LIST ADT
Abstract data type dynamically allocated, can be any size that is
needed (can be grown or shrunken was needed)
Utilizes what we have already learned this semester:
(3) dynamic memory allocation
INTRODUCTION TO T
What two ways exist to implement an overloaded operator function?
As a member function
As a non-member function (i.e., friend)
What is the major difference between these two implementations?
As a member: overloaded function is called on the o
No new material
Was due THIS Friday now due on Sunday at midnight
Bring grade sheet to class on Monday
LAB1 NOTES: THE PROBLEM
/ Display account numbers
/ Get an account number from the user.
cout < endl < "Pl
When is dynamically allocated memory actually allocated?
Why would we want to use dynamic allocation vs. static allocation?
Can allocate EXACTLY the amount of memory that is needed
when amount is only known during run-time
How do we
What is function overloading?
providing another function with same name but different
What functions did we overload in context of OOP?
the default constructor can be overloaded
What is the best way to pass structures to functions?
SUMMARY OF CONSTRUCTOR INFO
Constructors in class definition
C+ provides one BUT it does
nothing; data still uninitialized
(1) Default constructor only: Cat()cfw_age=0;
(1) Default constru
PROGRAM 2 NOTES
No data file to read, all input interactive
at the console window
prog2.txt is a file to simulate user
interaction testing your program
a.out < prog2.txt
You can use the commands out of the
test data file to test
DIE.CPP CLASS IMPLEMENTATION
using namespace std;
face = 1;
face = value;
DIE.CPP CLASS IMPLEMENTATION
face = ra
The int data type can represent integers in the range of approximately -2 billion to +2 billion (long int can
represent larger integers but still has a limit). There are applications in which you might want