Skip to content

Commit

Permalink
p8 p9 done
Browse files Browse the repository at this point in the history
  • Loading branch information
jasojone committed May 18, 2021
1 parent b08f9c6 commit 6d9b9cf
Show file tree
Hide file tree
Showing 44 changed files with 2,305 additions and 6 deletions.
1 change: 1 addition & 0 deletions cis17cMtP1.1/nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
<activeConfTypeElem>1</activeConfTypeElem>
<activeConfIndexElem>0</activeConfIndexElem>
</data>
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
</project-private>
1 change: 1 addition & 0 deletions cis17cMtP1/nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
<activeConfTypeElem>1</activeConfTypeElem>
<activeConfIndexElem>0</activeConfIndexElem>
</data>
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
</project-private>
1 change: 1 addition & 0 deletions cis17cMtP2.1/nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
<activeConfTypeElem>1</activeConfTypeElem>
<activeConfIndexElem>0</activeConfIndexElem>
</data>
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
</project-private>
1 change: 1 addition & 0 deletions cis17cMtP2/nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
<activeConfTypeElem>1</activeConfTypeElem>
<activeConfIndexElem>0</activeConfIndexElem>
</data>
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
</project-private>
4 changes: 2 additions & 2 deletions cis17cMtP3.3/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ int main(int argc, char** argv) {
Object o(SIZE);
operations += svl.push(o);
}
duration<float> dur = system_clock::now() - start;
duration<float> t = system_clock::now() - start;
cout<<"Object Size: "<<loopCnt<<" Pushed"<<endl;
cout<<"Operations: "<<operations<<endl;
cout<<"Time to Push: "<<dur.count()<<" Seconds"<<endl;;
cout<<"Time to Push: "<<t.count()<<" Seconds"<<endl;

return 0;
}
4 changes: 3 additions & 1 deletion cis17cMtP3.3/nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
</data>
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group/>
<group>
<file>file:/C:/Users/Jason/OneDrive/Documents/GitHub/Cis17c2021/cis17cMtP3.3/main.cpp</file>
</group>
</open-files>
</project-private>
1 change: 1 addition & 0 deletions cis17cMtP4.1/nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
<activeConfTypeElem>1</activeConfTypeElem>
<activeConfIndexElem>0</activeConfIndexElem>
</data>
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
</project-private>
1 change: 1 addition & 0 deletions cis17cMtP4/nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
<activeConfTypeElem>1</activeConfTypeElem>
<activeConfIndexElem>0</activeConfIndexElem>
</data>
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
</project-private>
4 changes: 1 addition & 3 deletions cis17cMtP7/nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
</data>
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/C:/Users/Jason/OneDrive/Documents/GitHub/Cis17c2021/cis17cMtP7/main.cpp</file>
</group>
<group/>
</open-files>
</project-private>
5 changes: 5 additions & 0 deletions cis17cMtP8/.dep.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This code depends on make tool being used
DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES} ${TESTOBJECTFILES}))
ifneq (${DEPFILES},)
include ${DEPFILES}
endif
128 changes: 128 additions & 0 deletions cis17cMtP8/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# Available make variables:
#
# CND_BASEDIR base directory for relative paths
# CND_DISTDIR default top distribution directory (build artifacts)
# CND_BUILDDIR default top build directory (object files, ...)
# CONF name of current configuration
# CND_PLATFORM_${CONF} platform name (current configuration)
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
#
# NOCDDL


# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin


# build
build: .build-post

.build-pre:
# Add your pre 'build' code here...

.build-post: .build-impl
# Add your post 'build' code here...


# clean
clean: .clean-post

.clean-pre:
# Add your pre 'clean' code here...

.clean-post: .clean-impl
# Add your post 'clean' code here...


# clobber
clobber: .clobber-post

.clobber-pre:
# Add your pre 'clobber' code here...

.clobber-post: .clobber-impl
# Add your post 'clobber' code here...


# all
all: .all-post

.all-pre:
# Add your pre 'all' code here...

.all-post: .all-impl
# Add your post 'all' code here...


# build tests
build-tests: .build-tests-post

.build-tests-pre:
# Add your pre 'build-tests' code here...

.build-tests-post: .build-tests-impl
# Add your post 'build-tests' code here...


# run tests
test: .test-post

.test-pre: build-tests
# Add your pre 'test' code here...

.test-post: .test-impl
# Add your post 'test' code here...


# help
help: .help-post

.help-pre:
# Add your pre 'help' code here...

.help-post: .help-impl
# Add your post 'help' code here...



# include project implementation makefile
include nbproject/Makefile-impl.mk

# include project make variables
include nbproject/Makefile-variables.mk
59 changes: 59 additions & 0 deletions cis17cMtP8/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

/*
* File: main.cpp
* Author: Jason
*
* Created on May 17, 2021, 4:22 PM
*/

#include <iostream>
#include <vector>
#include <math.h>
using namespace std;


int main(int argc, char** argv)
{

srand(static_cast<unsigned int>(time(0)));

float passes = 0;

for(int i = 0; i < pow(10,6); i++)
{
int bit = 0;

vector<int> v(100, 0);
for(int i = 0; i < 40; i++)
{
v[i] = 1;
}

for(int i = 0; i < 5; i++)
{
int pos = rand()%100;
if(v[pos] == 1)
{
bit++;
}
}
if(bit == 5)
{
passes++;
}
}

cout<<"Given a biased coin analogy, if a bit vector is 40% full\n"
<<"the odds that 5 bits randomly chosen fall within section are: "
<<(passes/pow(10,6))*100<<"%\n"
<<"The Calculated Probability: "<<pow(0.4, 5) * 100<<"%"<<endl;

return 0;
}


83 changes: 83 additions & 0 deletions cis17cMtP8/nbproject/Makefile-Debug.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a -pre and a -post target defined where you can add customized code.
#
# This makefile implements configuration specific macros and targets.


# Environment
MKDIR=mkdir
CP=cp
GREP=grep
NM=nm
CCADMIN=CCadmin
RANLIB=ranlib
CC=gcc
CCC=g++
CXX=g++
FC=gfortran
AS=as

# Macros
CND_PLATFORM=Cygwin-Windows
CND_DLIB_EXT=dll
CND_CONF=Debug
CND_DISTDIR=dist
CND_BUILDDIR=build

# Include project Makefile
include Makefile

# Object Directory
OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}

# Object Files
OBJECTFILES= \
${OBJECTDIR}/main.o


# C Compiler Flags
CFLAGS=

# CC Compiler Flags
CCFLAGS=
CXXFLAGS=

# Fortran Compiler Flags
FFLAGS=

# Assembler Flags
ASFLAGS=

# Link Libraries and Options
LDLIBSOPTIONS=

# Build Targets
.build-conf: ${BUILD_SUBPROJECTS}
"${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cis17cmtp8.exe

${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cis17cmtp8.exe: ${OBJECTFILES}
${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}
${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cis17cmtp8 ${OBJECTFILES} ${LDLIBSOPTIONS}

${OBJECTDIR}/main.o: main.cpp
${MKDIR} -p ${OBJECTDIR}
${RM} "$@.d"
$(COMPILE.cc) -g -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp

# Subprojects
.build-subprojects:

# Clean Targets
.clean-conf: ${CLEAN_SUBPROJECTS}
${RM} -r ${CND_BUILDDIR}/${CND_CONF}

# Subprojects
.clean-subprojects:

# Enable dependency checking
.dep.inc: .depcheck-impl

include .dep.inc
Loading

0 comments on commit 6d9b9cf

Please sign in to comment.