15: Finals and Projects

What We Will Cover

Announcements and Answers


  • Make sure you follow along with the web page at edparrish.net
  • Please keep your microphone off unless you are asking a question
  • Please turn on camera if you can
  • Feel free to use the chat if you would like to comment or ask questions
  • However, I may not see chat questions right away while I am talking
  • Speak up if the question is about the current topic

COVID-19 Information

  • Students may request an EW (excused withdrawal) using the Appeals Petition eForm through May 17th
  • After login, select the form named AR - A&R Appeal
  • Choose the third bullet on the list of options
  • In the Comments field on the E-form, list the class to drop and "COVID-19" as the reason
  • May affect financial aid so contact office first: financial.aid@cabrillo.edu
  • Grade calculation "what-if" tool available in Canvas Grades
  • P/NP grading option also extended through May 17th (see form)
  • If you are not passing then an EW is better
  • CARES $500 emergency grant applications now being accepted: see COVID-19 Student Resources page
  • Undocumented students should contact the Dream Resource Center: dream@cabrillo.edu

Project Questions?

  • Anyone completed their project and ready to present or show it to me early?
  • Do not forget to submit your project before presenting

Questions from last class?

15.1: Running Under Windows

Learner Outcomes

At the end of the lesson the student will be able to:

  • Run console programs under Windows

15.1.1: About DLL's

  • We can run our compiled programs under Windows, on computers without Cygwin installed
  • To accomplish this, we need to include the appropriate Cygwin DLL's
  • DLL stands for Dynamic Link Library
  • A DLL is a binary file that provides a library of functions for use by Windows applications
  • All programs running under Windows use DLL's
  • Any DLL that a program uses must be available on the computer where the application is running

Cygwin DLL's

  • Cygwin provides a number of DLL's
  • These DLL's are located in the cygwin/bin directory
  • They are easy to identify because they have an extension of .dll and type Application Extension
  • Your programs uses one or more of these DLL's when they run
  • Any DLL that your program uses must be accessible to the program
  • Thus, to run your program on a computer without Cygwin installed, we need to include a copy of the needed Cygwin DLL's

15.1.2: Finding the DLL's We Need

  • The easiest way to find the DLL's your program needs is to run the program under Windows
  • Whenever the program needs a DLL, it attempts to load the DLL
  • When it cannot load the DLL, it fails and identifies the DLL it needs

need dll message

  • To fix the problem, we copy the needed DLL into the same directory as your application
  • Since the computers in our classroom have paths set to the Cygwin\bin directory, we need to delete the path setting for this test:

Example of Finding Needed DLL's

  • We want to run the playagain.cpp program under Windows
  • We save the program to the desktop and compile it using TextPad
  • Next we launch a Windows console:
    1. From the Start menu, Select Run...
    2. In the text box type cmd and press the Enter key
  • Then we remove the path to cygwin\bin by typing:
  • Now when we try to run the program, we get an error message
  • We locate the Cygwin DLL we need in the cygwin\bin directory and copy it to the desktop
  • Now we can successfully run the application

Example Application

#include <iostream>
using namespace std;

int main() {
    char repeat = 'y';
    while ('y' == repeat) {
        cout << "\nPlaying an exciting game!\n";
        cout << "Do you want to play again? (y/n) ";
        cin >> repeat;
    cout << "\nThanks for playing!\n";

    return 0;

Exercise 15.1: Running on Windows without Cygwin (5m)

In this exercise we run a program under Windows without starting Cygwin or using TextPad.


  1. Choose an application, compile it, and copy the .exe file to the desktop
  2. Open a Window's terminal window:
    1. Click the Start button
    2. Select "Run..."
    3. In the Open box type in: cmd
    4. Press the Enter key
  3. Change to the Desktop directory:
    cd Desktop
  4. Set the path on the computer to '.':
  5. Run the .exe file and find the missing DLL's

    To run in the Windows terminal, type the program name (no ./ needed).

  6. Copy the missing DLL's to the Desktop and run again

15.1.3: Summary

  • We can run C++ programs compiled in Cygwin on Windows computers without Cygwin installed
  • To make your programs work, we need to include any required DLL's
    • This is true for any Windows application
  • The easiest way to find the needed DLL is to run your program in the Windows terminal
  • When your program needs a DLL, Windows will try to load it
  • When Windows cannot load the DLL, it gives an error message identifying the missing DLL
  • To fix the problem, we copy the DLL into the directory in which we put your .exe file

Check Yourself

  1. What is a DLL?
  2. Why do your programs need DLL's?
  3. How can you add the DLL's needed to make your program run?

15.2: Final Exam Preparation

Learner Outcomes

At the end of the lesson the student will be able to:

  • Discuss how to prepare for the final exam
  • Describe how to take the final exam

15.2.1: About the Final Exam

Important Final Exam Information

Published Schedule: Exam Schedule
Date and Time: Thursday, May 21 @ 1:00pm-3:50pm
Location: online, everyone at the same time

  • You must attend the exam at the scheduled time or you will receive a score of zero (0)
    • Except by prior arrangement with the instructor for unforeseeable emergency and justifiable reasons
  • Be on time as you can only work on the exam during the scheduled time

15.2.2: How the Final Exam Works

  • The final exam is a Lab Practical
  • This means that you must write code for the exam
  • You need to solve a series of programming problems during the exam
  • Successfully completing each problem is worth some stated number of points

Administration and Ground Rules

  • You must take the exam online during the scheduled time
    • Except by prior arrangement with the instructor
  • The exam is closed books and closed notes
    • However, you may have one 3" x 5" card of handwritten notes for the exam
  • You will have a whiteboard in the exam for notes
  • The exam will start in a Zoom room to answer questions, verify 3x5 cards and scratch paper, and position phones
  • Join the Zoom room using your cell phone--not your computer
    • Zoom tends to crash some computers during exams
  • Your exam computer must have the Chrome browser with the Proctorio extension installed for the exam
    • Verify your computer with the quiz Pre-Final Computer Check (Remotely Proctored)
  • Questions or other messages to the instructor during the test can be sent via Canvas email
  • No applications may be run on the computer except a browser, Cygwin/g++ and one text editor like TextPad, NotePad++, or TextEdit.
    • Thus you will be able to compile and run your exam code
    • However, your code must compile to receive more than half-credit on the entire exam
    • Partial credit is available if you comment out your problem code
  • Must NOT use the computer to:
    1. View documents on the Internet
    2. Look at pre-existing code
    3. Open pre-existing documents of any kind
    4. Send messages to anyone but the instructor (instructor only via Canvas email)
  • Must NOT use a calculator, cell phone or similar electronic device
    • Touching a cell phone during the exam == automatic fail
    • A calculator will be provided as part of the exam
  • Must NOT communicate with anyone but the instructor during the exam
    • Find a separate room or space for the exam if possible
    • Make certain other people in your home know not to disturb you during the exam
    • Students are responsible for not invading third party privacy rights with their webcam

3"x5" Card Requirements

  • Put your name on your card
  • Maximum card or paper size is 3 inches by 5 inches
  • You may use both sides of the card
  • Notes must be handwritten and NOT photocopied
  • No more than three statements in a code sequence on the card — only snippets
  • Any 3" x 5" cards violating these rules will be denied use before the exam

15.2.3: What the Final Exam Covers

  • The final exam is cumulative -- you should know everything we have covered
  • However, the focus is writing code for what we have learned since the last exam
  • Prior exam topics are listed here:
  • See below for newer exam topics

Newer Topic Code You Must be Capable of Writing

  1. Declaring class types (9.2.2, 10.1.1)
  2. Declaring and defining member and non-member functions (9.2.4, 12.3.4)
  3. Coding constructors with and without parameters (9.2.5, 9.3.1, 9.3.2)
  4. Constructing objects and calling their functions (9.2.3, 9.3.3)
  5. Modifying (changing) values in an object (9.3.4)
  6. Writing set and get functions of classes (9.3.4)
  7. Defining and initializing vectors (10.2.2)
  8. Accessing vector elements (10.2.3)
  9. Finding and changing the size of a vector (10.2.4)
  10. Coding vector parameters and return values (10.2.5)
  11. Processing vectors using loops, including vectors of objects (10.2.4, 10.4.2)
  12. Coding common vector algorithms such as searching for, inserting and deleting elements (10.3.2, 10.3.3, 10.3.4)
  13. Opening a file stream for reading or writing (11.2.5)
  14. Reading different types of data from a file (11.2.5, 12.1.3, 12.1.4)
  15. Loading data from a file and saving it in variables, vectors and objects (11.2.5, 12.1.2-5, 12.3.5)
  16. Writing data from a vector and saving it in a file (12.1.6, 12.3.6)
  17. Developing recursive functions (14.2, Exercise 14.2)

15.2.4: Study Recommendations

  • Study over several sessions instead of one cram session
  • Review your homework assignments and solutions
  • Review the instructor's posted solutions to assignments:
    • Solutions are posted in Canvas
    • Understand how the instructor solved each problem
  • Work through the Practice Final questions in Canvas:
    • Get explanations for anything you do not understand

    Tip: Complete the entire practice exam.

Final Preparation Tips

  • Make notes on problems on the Practice Final that you had difficulty with
  • Make sure you know how to solve those types of problems
  • Review your notes and prepare your 3" x 5" card
  • Do a quick review just before bed to let your subconscious aid in long term memory.
  • Get plenty of rest before the exam

15.2.5: Exam Taking Tips

  • Listen carefully to any oral instructions for taking the exam and read instructions carefully.
  • Read every word in each test question
  • Note that you do not need to comment code for the final exam
    • Unless specifically instructed to in the exam question
  • Use the full time allowed

15.2.6: Review Materials, Questions and Answers

15.3: Sampler Project Demonstration

Learner Outcomes

At the end of the lesson the student will be able to:

  • Present their projects

15.3.1: Sampler Presentation

  • Here are the steps for an effective project presentation

Before the Presentation

  • Submit the following to Canvas before the presentation:
    1. README.txt file containing the project report
    2. All source code (i.e. .cpp files)
    3. Any other files needed to make your program function.
  • Remember that there are no late submittals accepted for the project
  • If you have problems completing the project, then turn in what you have on time and come to class

Project Setup

  • Verify your code compiles and your project loads its files
  • Prepare your computer to share it's screen
  • If you get stuck or do not know what to do, ask for help

During the Presentation

Present the following information:

  • Introduce yourself and state the purpose of your project
  • Compile your program completely and be sure to include all the warnings:
    g++ -Wall -Wextra -Wpedantic -o programName sourceFile.cpp
    • CodeBlocks: Project ⯈ Build options
    • NotePad++: Settings ⯈ NppExec ⯈ Show Console
    • TextPad: Configure ⯈ Preferences ⯈ Tools ⯈ Compile C++
  • Demonstrate your project, explaining aspects as you go
    • Show and explain all the extra-credit features
    • Explain how the extra credit and interesting features work
    • Show the code for recursive functions and to help explain features
  • Limit the presentation to 5 minutes or less

After the Presentation

  • Feel free to leave (or stay) after your presentation
  • You can present to the instructor alone after the other presentations are through
  • Remember to study for the final!

End of Course Survey

Wrap Up

Study for the final!
Last Updated: May 12 2020 @05:00:15