Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Lab2_01/Debug/Lab2_01.exe
Binary file not shown.
Binary file added Lab2_01/Debug/Lab2_01.ilk
Binary file not shown.
Binary file added Lab2_01/Debug/Lab2_01.pdb
Binary file not shown.
Binary file added Lab2_01/Lab2_01.sdf
Binary file not shown.
22 changes: 22 additions & 0 deletions Lab2_01/Lab2_01.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lab2_01", "Lab2_01\Lab2_01.vcxproj", "{70E30008-1D3B-47A5-A823-61FE7C2C0A46}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{70E30008-1D3B-47A5-A823-61FE7C2C0A46}.Debug|Win32.ActiveCfg = Debug|Win32
{70E30008-1D3B-47A5-A823-61FE7C2C0A46}.Debug|Win32.Build.0 = Debug|Win32
{70E30008-1D3B-47A5-A823-61FE7C2C0A46}.Release|Win32.ActiveCfg = Release|Win32
{70E30008-1D3B-47A5-A823-61FE7C2C0A46}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file added Lab2_01/Lab2_01.v12.suo
Binary file not shown.
14 changes: 14 additions & 0 deletions Lab2_01/Lab2_01/Debug/Lab2_01.Build.CppClean.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
c:\users\ieuser\cpp_lab_02\lab2_01\lab2_01\debug\lab2_01.pch
c:\users\ieuser\cpp_lab_02\lab2_01\lab2_01\debug\vc120.pdb
c:\users\ieuser\cpp_lab_02\lab2_01\lab2_01\debug\vc120.idb
c:\users\ieuser\cpp_lab_02\lab2_01\lab2_01\debug\stdafx.obj
c:\users\ieuser\cpp_lab_02\lab2_01\lab2_01\debug\lab2_01.obj
c:\users\ieuser\cpp_lab_02\lab2_01\debug\lab2_01.ilk
c:\users\ieuser\cpp_lab_02\lab2_01\debug\lab2_01.exe
c:\users\ieuser\cpp_lab_02\lab2_01\debug\lab2_01.pdb
c:\users\ieuser\cpp_lab_02\lab2_01\lab2_01\debug\lab2_01.tlog\cl.command.1.tlog
c:\users\ieuser\cpp_lab_02\lab2_01\lab2_01\debug\lab2_01.tlog\cl.read.1.tlog
c:\users\ieuser\cpp_lab_02\lab2_01\lab2_01\debug\lab2_01.tlog\cl.write.1.tlog
c:\users\ieuser\cpp_lab_02\lab2_01\lab2_01\debug\lab2_01.tlog\link.command.1.tlog
c:\users\ieuser\cpp_lab_02\lab2_01\lab2_01\debug\lab2_01.tlog\link.read.1.tlog
c:\users\ieuser\cpp_lab_02\lab2_01\lab2_01\debug\lab2_01.tlog\link.write.1.tlog
15 changes: 15 additions & 0 deletions Lab2_01/Lab2_01/Debug/Lab2_01.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Build started 1/23/2015 5:12:57 AM.
Project "C:\Users\IEUser\Cpp_Lab_02\Lab2_01\Lab2_01\Lab2_01.vcxproj" on node 2 (Build target(s)).
ClCompile:
C:\Program Files\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /sdl /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _LIB /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yu"stdafx.h" /Fp"Debug\Lab2_01.pch" /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt Lab2_01.cpp
Lab2_01.cpp
c:\users\ieuser\cpp_lab_02\lab2_01\lab2_01\lab2_01.cpp(19): warning C4244: 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data
Link:
C:\Program Files\Microsoft Visual Studio 12.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"C:\Users\IEUser\Cpp_Lab_02\Lab2_01\Debug\Lab2_01.exe" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"C:\Users\IEUser\Cpp_Lab_02\Lab2_01\Debug\Lab2_01.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\Users\IEUser\Cpp_Lab_02\Lab2_01\Debug\Lab2_01.lib" /MACHINE:X86 Debug\Lab2_01.obj
Debug\stdafx.obj
Lab2_01.vcxproj -> C:\Users\IEUser\Cpp_Lab_02\Lab2_01\Debug\Lab2_01.exe
Done Building Project "C:\Users\IEUser\Cpp_Lab_02\Lab2_01\Lab2_01\Lab2_01.vcxproj" (Build target(s)).

Build succeeded.

Time Elapsed 00:00:00.59
Binary file added Lab2_01/Lab2_01/Debug/Lab2_01.obj
Binary file not shown.
Binary file added Lab2_01/Lab2_01/Debug/Lab2_01.pch
Binary file not shown.
Binary file added Lab2_01/Lab2_01/Debug/Lab2_01.tlog/CL.read.1.tlog
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions Lab2_01/Lab2_01/Debug/Lab2_01.tlog/Lab2_01.lastbuildstate
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v120:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit
Debug|Win32|C:\Users\IEUser\Cpp_Lab_02\Lab2_01\|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Lab2_01/Lab2_01/Debug/Lab2_01.tlog/link.write.1.tlog
Binary file not shown.
Binary file added Lab2_01/Lab2_01/Debug/stdafx.obj
Binary file not shown.
Binary file added Lab2_01/Lab2_01/Debug/vc120.idb
Binary file not shown.
Binary file added Lab2_01/Lab2_01/Debug/vc120.pdb
Binary file not shown.
31 changes: 31 additions & 0 deletions Lab2_01/Lab2_01/Lab2_01.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Lab2_01.cpp : Flips a coin 100 times and reports # of heads and tails.
//Author: Thomas Morrissey
//Date: 1-23-2015


#include "stdafx.h"
#include <iostream>
#include <string>
#include <time.h>
using namespace std;


int main()
{
int CoinFlip = 0;
int Heads = 0;
int Tails = 0;
int Number = 0;
srand(time(NULL));
while (CoinFlip <= 99){
Number = rand() % 2;
if (Number == 1){
Heads++; }
else{
Tails++;}
CoinFlip++;}
cout << "The Results of the coin toss is " << Heads << " heads and " << Tails << " tails.";
getchar();
return 0;
}

95 changes: 95 additions & 0 deletions Lab2_01/Lab2_01/Lab2_01.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{70E30008-1D3B-47A5-A823-61FE7C2C0A46}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Lab2_01</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>Use</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Lab2_01.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
36 changes: 36 additions & 0 deletions Lab2_01/Lab2_01/Lab2_01.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Lab2_01.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
40 changes: 40 additions & 0 deletions Lab2_01/Lab2_01/ReadMe.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
========================================================================
CONSOLE APPLICATION : Lab2_01 Project Overview
========================================================================

AppWizard has created this Lab2_01 application for you.

This file contains a summary of what you will find in each of the files that
make up your Lab2_01 application.


Lab2_01.vcxproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.

Lab2_01.vcxproj.filters
This is the filters file for VC++ projects generated using an Application Wizard.
It contains information about the association between the files in your project
and the filters. This association is used in the IDE to show grouping of files with
similar extensions under a specific node (for e.g. ".cpp" files are associated with the
"Source Files" filter).

Lab2_01.cpp
This is the main application source file.

/////////////////////////////////////////////////////////////////////////////
Other standard files:

StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named Lab2_01.pch and a precompiled types file named StdAfx.obj.

/////////////////////////////////////////////////////////////////////////////
Other notes:

AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.

/////////////////////////////////////////////////////////////////////////////
8 changes: 8 additions & 0 deletions Lab2_01/Lab2_01/stdafx.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// Lab2_01.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information

#include "stdafx.h"

// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
15 changes: 15 additions & 0 deletions Lab2_01/Lab2_01/stdafx.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once

#include "targetver.h"

#include <stdio.h>
#include <tchar.h>



// TODO: reference additional headers your program requires here
8 changes: 8 additions & 0 deletions Lab2_01/Lab2_01/targetver.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once

// Including SDKDDKVer.h defines the highest available Windows platform.

// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.

#include <SDKDDKVer.h>
Binary file not shown.
Binary file added Lab2_03/Debug/Lab2_03.exe
Binary file not shown.
Binary file added Lab2_03/Debug/Lab2_03.ilk
Binary file not shown.
Binary file added Lab2_03/Debug/Lab2_03.pdb
Binary file not shown.
Binary file added Lab2_03/Lab2_03.sdf
Binary file not shown.
22 changes: 22 additions & 0 deletions Lab2_03/Lab2_03.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lab2_03", "Lab2_03\Lab2_03.vcxproj", "{E82164EC-A3D2-453A-BF9F-569CD78DCAC7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E82164EC-A3D2-453A-BF9F-569CD78DCAC7}.Debug|Win32.ActiveCfg = Debug|Win32
{E82164EC-A3D2-453A-BF9F-569CD78DCAC7}.Debug|Win32.Build.0 = Debug|Win32
{E82164EC-A3D2-453A-BF9F-569CD78DCAC7}.Release|Win32.ActiveCfg = Release|Win32
{E82164EC-A3D2-453A-BF9F-569CD78DCAC7}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file added Lab2_03/Lab2_03.v12.suo
Binary file not shown.
15 changes: 15 additions & 0 deletions Lab2_03/Lab2_03/Debug/Lab2_03.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Build started 1/27/2015 4:16:16 AM.
Project "C:\Users\IEUser\Cpp_Lab_02\Lab2_03\Lab2_03\Lab2_03.vcxproj" on node 2 (Build target(s)).
ClCompile:
C:\Program Files\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /sdl /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _LIB /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yu"stdafx.h" /Fp"Debug\Lab2_03.pch" /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt Lab2_03.cpp
Lab2_03.cpp
c:\users\ieuser\cpp_lab_02\lab2_03\lab2_03\lab2_03.cpp(39): warning C4244: 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data
Link:
C:\Program Files\Microsoft Visual Studio 12.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"C:\Users\IEUser\Cpp_Lab_02\Lab2_03\Debug\Lab2_03.exe" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"C:\Users\IEUser\Cpp_Lab_02\Lab2_03\Debug\Lab2_03.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\Users\IEUser\Cpp_Lab_02\Lab2_03\Debug\Lab2_03.lib" /MACHINE:X86 Debug\Lab2_03.obj
Debug\stdafx.obj
Lab2_03.vcxproj -> C:\Users\IEUser\Cpp_Lab_02\Lab2_03\Debug\Lab2_03.exe
Done Building Project "C:\Users\IEUser\Cpp_Lab_02\Lab2_03\Lab2_03\Lab2_03.vcxproj" (Build target(s)).

Build succeeded.

Time Elapsed 00:00:01.22
Binary file added Lab2_03/Lab2_03/Debug/Lab2_03.obj
Binary file not shown.
Binary file added Lab2_03/Lab2_03/Debug/Lab2_03.pch
Binary file not shown.
Binary file added Lab2_03/Lab2_03/Debug/Lab2_03.tlog/CL.read.1.tlog
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions Lab2_03/Lab2_03/Debug/Lab2_03.tlog/Lab2_03.lastbuildstate
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v120:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit
Debug|Win32|C:\Users\IEUser\Cpp_Lab_02\Lab2_03\|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Lab2_03/Lab2_03/Debug/Lab2_03.tlog/link.write.1.tlog
Binary file not shown.
Binary file added Lab2_03/Lab2_03/Debug/stdafx.obj
Binary file not shown.
Binary file added Lab2_03/Lab2_03/Debug/vc120.idb
Binary file not shown.
Binary file added Lab2_03/Lab2_03/Debug/vc120.pdb
Binary file not shown.
54 changes: 54 additions & 0 deletions Lab2_03/Lab2_03/Lab2_03.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Lab2_03.cpp : This application acts as a dice machine.
// Contributted with Jacob Snipes.
// Author: Thomas Morrissey
// Date: 1-23-2015


#include "stdafx.h"
#include <iostream>
#include <string>
#include <ctime>
using namespace std;


int main(){
int DiceNumber = 0;
int DiceSide = 0;
int Modifier = 0;
int TotalRoll = 4;
int Total = 0;
cout << "WELCOME TO *" << endl;
cout << "Die-Roller! *" << endl;
cout << "*" << endl;
cout << "Instructions: *" << endl;
cout << "To roll, type the number of dice, then the number *" << endl;
cout << "of sides then any modifiers, all seperated by *" << endl;
cout << "spaces. *" << endl;
cout << "*" << endl;
cout << "like this: 3 6 -1" << endl;
cout << "that would mean: *" << endl;
cout << "Roll 3 6-sided dice, and subtract 1 from each die *" << endl;
cout << "*" << endl;
cout << "To exit, enter: 1 1 1 *" << endl;
while (TotalRoll > 3){
cout << "Your Roll: ";
cin >> DiceNumber >> DiceSide >> Modifier;
TotalRoll = DiceNumber + DiceSide + Modifier;
if (TotalRoll > 3){
int count = 0;
int Dice = 0;
srand(time(NULL));
while (count < DiceNumber){
count++;
Dice = rand() % DiceSide + 1 + Modifier;
Total = Total + Dice;
}
cout << "From having " << DiceSide << "-" << DiceNumber << " dice and adding" << Modifier << " from each die." << endl;
cout << " Your total is " << Total << endl;
}
}
cout << "Press <Enter> to Exit." << endl;
getchar();
getchar();
return 0;
}
Loading