Commit 5ade1223 authored by Rachel Wil Sha Singh's avatar Rachel Wil Sha Singh 💬
Browse files

Summer 2020 content

parent ca9bf893
obj/
bin/
# From GitHub user content
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
......@@ -2,4 +2,6 @@
CS 200: Concepts of Programming Algorithms using C++
Course at JCCC
\ No newline at end of file
Course at JCCC
[http://www.moosader.com/course-cs200.php](http://www.moosader.com/course-cs200.php)
rm *.log *.dvi *.aux
\relax
\providecommand\zref@newlabel[2]{}
\@writefile{toc}{\contentsline {section}{\numberline {0.1}Using Visual Studio}{4}}
\@writefile{toc}{\contentsline {subsection}{\numberline {0.1.1}Downloading Visual Studio}{4}}
\@writefile{toc}{\contentsline {subsection}{\numberline {0.1.2}Installing Visual Studio}{5}}
\@writefile{toc}{\contentsline {subsection}{\numberline {0.1.3}Creating a program}{6}}
\@writefile{toc}{\contentsline {subsection}{\numberline {0.1.4}Writing a program}{9}}
\@writefile{toc}{\contentsline {subsection}{\numberline {0.1.5}Building and running the program}{10}}
\@writefile{toc}{\contentsline {subsection}{\numberline {0.1.6}Locating your source file}{12}}
\@writefile{toc}{\contentsline {section}{\numberline {0.2}Using Code::Blocks}{14}}
\@writefile{toc}{\contentsline {subsection}{\numberline {0.2.1}Downloading Code::Blocks}{14}}
\@writefile{toc}{\contentsline {subsection}{\numberline {0.2.2}Installing Code::Blocks}{15}}
\@writefile{toc}{\contentsline {subsection}{\numberline {0.2.3}Creating a program}{15}}
\@writefile{toc}{\contentsline {paragraph}{Project type selection screen:}{16}}
\@writefile{toc}{\contentsline {paragraph}{Project information screen:}{16}}
\@writefile{toc}{\contentsline {paragraph}{Compiler information screen:}{17}}
\@writefile{toc}{\contentsline {subsection}{\numberline {0.2.4}Writing a program}{20}}
\@writefile{toc}{\contentsline {subsection}{\numberline {0.2.5}Building and running the program}{21}}
\@writefile{toc}{\contentsline {subsection}{\numberline {0.2.6}Locating your source file}{23}}
\newlabel{LastPage}{{}{23}}
\xdef\lastpage@lastpage{23}
\gdef\lastpage@lastpageHy{}
\documentclass[a4paper,12pt,oneside]{book}
\usepackage[utf8]{inputenc}
\newcommand{\laTopic} {Tools setup}
\newcommand{\laTitle} {CS 200 Lab}
\newcounter{question}
\renewcommand{\chaptername}{Topic}
\usepackage{../../rachwidgets}
\usepackage{../../rachdiagrams}
\title{}
\author{Rachel Singh}
\date{\today}
\pagestyle{fancy}
\fancyhf{}
\lhead{\laTopic \ / \laTitle}
\chead{}
\rhead{\thepage}
\rfoot{\tiny \thepage\ of \pageref{LastPage}}
\lfoot{\tiny Rachel Singh, last updated \today}
\renewcommand{\headrulewidth}{2pt}
\renewcommand{\footrulewidth}{1pt}
\begin{document}
\togglefalse{answerkey}
\section*{Lab instructions}
\begin{center}
\includegraphics[width=12cm]{images/lab00-codeblocks-sourcelocation.png}
\end{center}
\begin{itemize}
\item Once you've finished the lab, turn in your \textbf{.cpp} source file in on Canvas.
In Windows, they will be marked as a ``C++ source file'' type.
\item I prefer files to \textbf{not be zipped}, unless otherwise stated.
\item \textbf{Do not} zip an entire project/solution directory. I don't want all the
extra files. One source file is a few bytes; the entire directory will be several
megabytes and take longer to download.
\end{itemize}
\newpage
\section*{Setting up your IDE}
\begin{intro}{What is an IDE again?}
An IDE is an Integrated Development Environment.
IDEs contain multiple types of tools that help you
effectively create software in C++, such as a
\textbf{text editor with syntax highlighting},
a \textbf{compiler} to turn source into executables,
and a \textbf{debugger} to help you debug your code.
\end{intro}
You can write C++ code on any operating system; C++ is not a product
of a single company (like Microsoft), so there are a lot of options
out there for tools you can use to write C++ in. In general, my suggestions
would be:
\begin{center}
\begin{tabular}{l c c c c}
& Windows & Linux & Mac & Slow computer
\\ \hline
Visual Studio & x
\\
Code::Blocks & x & x & x & x
\\
Xcode & & & x
\end{tabular}
\end{center}
\begin{itemize}
\item \textbf{Visual Studio...} https://visualstudio.microsoft.com/vs/community/
\begin{itemize}
\item A very common tool, being used
on JCCC computers in the lab, at UMKC, and at lots of
software development companies here in Kansas City.
\item It can also be very bloated and very slow. If your computer
is having trouble running Visual Studio, you might try
Code::Blocks instead.
\end{itemize}
\item \textbf{Code::Blocks...} http://www.codeblocks.org/downloads/26
\begin{itemize}
\item Runs on Windows, Linux and Mac.
\item Is lighter-weight than Visual Studio.
\item Has the same debugging tools needed.
\item I've never worked at a company that uses Code::Blocks,
but I prefer it when writing C++ for myself.
\item When downloading on Windows, make sure to get the version
that says \textbf{``mingw-setup.exe''!}
\end{itemize}
\item \textbf{Xcode...} https://developer.apple.com/xcode/
\begin{itemize}
\item Runs on Mac.
\item Has the same debugging tools needed.
\item I am not very familiar with it.
\item Also used professionally a lot.
\end{itemize}
\end{itemize}
\tableofcontents
\newpage
\section{Using Visual Studio}
\subsection{Downloading Visual Studio}
From the Visual Studio Community page, select \textbf{Download Visual Studio}.
~\\
(https://visualstudio.microsoft.com/vs/community/)
\begin{center}
\includegraphics[width=12cm]{images/lab00-visualstudio-download.png}
\end{center}
Open the installer and it will begin downloading all the files it needs.
This will take a while.
\begin{center}
\includegraphics[width=12cm]{images/lab00-visualstudio-download2.png}
\end{center}
\newpage
\subsection{Installing Visual Studio}
Once the installer is ready, it will pop up a window with different
toolsets that Visual Studio supports.
Make sure to locate \textbf{``Desktop development with C++''},
then click \textbf{Install}.
\begin{center}
\includegraphics[width=14cm]{images/lab00-visualstudio-install1.png}
\end{center}
\begin{center}
\includegraphics[width=12cm]{images/lab00-visualstudio-install1b.png}
\end{center}
It will then take a while to install, and request that you restart your
computer after it's done installing. Go ahead and do that before continuing.
When you first launch Visual Studio, it will ask you to log in with a Microsoft account.
This could be a hotmail account or something. I have a hotmail account that I only
use to log into Visual Studio. You can skip this step, but I am not sure if it makes
you log in later on in the future.
\newpage
\subsection{Creating a program}
In Visual Studio, we create \textbf{solutions} for a program.
Later on, programs will have multiple source code files, but
for now we will just have one source file.
When Visual Studio is open, there's a splash screen with some
common options. Select \textbf{Create a new project}.
\begin{center}
\includegraphics[width=10cm]{images/lab00-visualstudio-makeproject1.png}
\end{center}
Then select \textbf{Empty Project} and click \textbf{Next}.
\begin{center}
\includegraphics[width=12cm]{images/lab00-visualstudio-makeproject2.png}
\end{center}
Next, you need to set the \textbf{Project name} and the \textbf{Location}.
I would suggest making one directory for your CS 200 projects, like
\begin{verbatim}
C:\CS200\
\end{verbatim}
instead of the default path that Visual Studio provides.
\begin{center}
\includegraphics[width=12cm]{images/lab00-visualstudio-makeproject3.png}
\end{center}
Click \textbf{Create} once you're done here.
\newpage
Now we have an empty solution. We need to add one source code file
to get started with our program. On the right-hand side of the screen
is the \textbf{Solution Explorer} with the solution (``Solution ToolsSetup'')
and the project (``ToolsSetup'').
Right-click on the project and click on Add $\to$ New item...
\begin{center}
\includegraphics[width=14cm]{images/lab00-visualstudio-newfile1.png}
\end{center}
\newpage
Select the \textbf{C++ File (.cpp)} and give it a name like \textbf{tools.cpp}
\begin{center}
\color{red}NOTE: the filename MUST end in .cpp!\color{black}
\end{center}
\begin{center}
\includegraphics[width=12cm]{images/lab00-visualstudio-newfile2.png}
\end{center}
\begin{center}
\includegraphics[width=12cm]{images/lab00-visualstudio-newfile3.png}
\end{center}
Click on \textbf{Add} once you're done.
Now in your \textbf{Solution Explorer} you'll see your \textbf{tools.cpp}
file under ``Source Files'', and the editor should have opened the source
file as well, allowing you to start typing code.
\newpage
\subsection{Writing a program}
Type out the following program source code. Note that copy-paste
out of this document might not work properly, so it's better to
just type it all out.
\begin{lstlisting}[style=code]
#include <iostream>
using namespace std;
int main()
{