diff --git a/program3_1/Debug/program3_1.exe b/program3_1/Debug/program3_1.exe new file mode 100644 index 0000000..95b0087 Binary files /dev/null and b/program3_1/Debug/program3_1.exe differ diff --git a/program3_1/Debug/program3_1.ilk b/program3_1/Debug/program3_1.ilk new file mode 100644 index 0000000..3f7961d Binary files /dev/null and b/program3_1/Debug/program3_1.ilk differ diff --git a/program3_1/Debug/program3_1.pdb b/program3_1/Debug/program3_1.pdb new file mode 100644 index 0000000..79554af Binary files /dev/null and b/program3_1/Debug/program3_1.pdb differ diff --git a/program3_1/ipch/program3_1-be69aade/program3_1-43ba7367.ipch b/program3_1/ipch/program3_1-be69aade/program3_1-43ba7367.ipch new file mode 100644 index 0000000..1683dd6 Binary files /dev/null and b/program3_1/ipch/program3_1-be69aade/program3_1-43ba7367.ipch differ diff --git a/program3_1/ipch/program3_1-c2debd07/program3_1-43ba7367.ipch b/program3_1/ipch/program3_1-c2debd07/program3_1-43ba7367.ipch new file mode 100644 index 0000000..dae551c Binary files /dev/null and b/program3_1/ipch/program3_1-c2debd07/program3_1-43ba7367.ipch differ diff --git a/program3_1/program3_1.sdf b/program3_1/program3_1.sdf new file mode 100644 index 0000000..1c842aa Binary files /dev/null and b/program3_1/program3_1.sdf differ diff --git a/program3_1/program3_1.sln b/program3_1/program3_1.sln new file mode 100644 index 0000000..80f861a --- /dev/null +++ b/program3_1/program3_1.sln @@ -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}") = "program3_1", "program3_1\program3_1.vcxproj", "{3AF64A8C-0BE3-4B0B-8FE3-B508B9CF0797}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3AF64A8C-0BE3-4B0B-8FE3-B508B9CF0797}.Debug|Win32.ActiveCfg = Debug|Win32 + {3AF64A8C-0BE3-4B0B-8FE3-B508B9CF0797}.Debug|Win32.Build.0 = Debug|Win32 + {3AF64A8C-0BE3-4B0B-8FE3-B508B9CF0797}.Release|Win32.ActiveCfg = Release|Win32 + {3AF64A8C-0BE3-4B0B-8FE3-B508B9CF0797}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/program3_1/program3_1.v12.suo b/program3_1/program3_1.v12.suo new file mode 100644 index 0000000..3db42e0 Binary files /dev/null and b/program3_1/program3_1.v12.suo differ diff --git a/program3_1/program3_1/Debug/program3_1.log b/program3_1/program3_1/Debug/program3_1.log new file mode 100644 index 0000000..161a202 --- /dev/null +++ b/program3_1/program3_1/Debug/program3_1.log @@ -0,0 +1,16 @@ +Build started 2/4/2015 6:18:07 PM. + 1>Project "C:\Users\thudr_000\Dropbox\tech\Programming_3\program3_1\program3_1\program3_1.vcxproj" on node 2 (Build target(s)). + 1>ClCompile: + C:\Program Files (x86)\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\program3_1.pch" /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt program3_1.cpp + program3_1.cpp + 1>c:\users\thudr_000\dropbox\tech\programming_3\program3_1\program3_1\program3_1.cpp(21): warning C4244: 'initializing' : conversion from 'float' to 'int', possible loss of data + 1>c:\users\thudr_000\dropbox\tech\programming_3\program3_1\program3_1\program3_1.cpp(41): warning C4244: '=' : conversion from 'float' to 'int', possible loss of data + Link: + C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"C:\Users\thudr_000\Dropbox\tech\Programming_3\program3_1\Debug\program3_1.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\thudr_000\Dropbox\tech\Programming_3\program3_1\Debug\program3_1.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\Users\thudr_000\Dropbox\tech\Programming_3\program3_1\Debug\program3_1.lib" /MACHINE:X86 Debug\program3_1.obj + Debug\stdafx.obj + program3_1.vcxproj -> C:\Users\thudr_000\Dropbox\tech\Programming_3\program3_1\Debug\program3_1.exe + 1>Done Building Project "C:\Users\thudr_000\Dropbox\tech\Programming_3\program3_1\program3_1\program3_1.vcxproj" (Build target(s)). + +Build succeeded. + +Time Elapsed 00:00:00.69 diff --git a/program3_1/program3_1/Debug/program3_1.obj b/program3_1/program3_1/Debug/program3_1.obj new file mode 100644 index 0000000..57a0ea1 Binary files /dev/null and b/program3_1/program3_1/Debug/program3_1.obj differ diff --git a/program3_1/program3_1/Debug/program3_1.pch b/program3_1/program3_1/Debug/program3_1.pch new file mode 100644 index 0000000..e082887 Binary files /dev/null and b/program3_1/program3_1/Debug/program3_1.pch differ diff --git a/program3_1/program3_1/Debug/program3_1.tlog/CL.read.1.tlog b/program3_1/program3_1/Debug/program3_1.tlog/CL.read.1.tlog new file mode 100644 index 0000000..0dc5f9d Binary files /dev/null and b/program3_1/program3_1/Debug/program3_1.tlog/CL.read.1.tlog differ diff --git a/program3_1/program3_1/Debug/program3_1.tlog/CL.write.1.tlog b/program3_1/program3_1/Debug/program3_1.tlog/CL.write.1.tlog new file mode 100644 index 0000000..18b07d6 Binary files /dev/null and b/program3_1/program3_1/Debug/program3_1.tlog/CL.write.1.tlog differ diff --git a/program3_1/program3_1/Debug/program3_1.tlog/cl.command.1.tlog b/program3_1/program3_1/Debug/program3_1.tlog/cl.command.1.tlog new file mode 100644 index 0000000..ca5baab Binary files /dev/null and b/program3_1/program3_1/Debug/program3_1.tlog/cl.command.1.tlog differ diff --git a/program3_1/program3_1/Debug/program3_1.tlog/link.command.1.tlog b/program3_1/program3_1/Debug/program3_1.tlog/link.command.1.tlog new file mode 100644 index 0000000..20740c2 Binary files /dev/null and b/program3_1/program3_1/Debug/program3_1.tlog/link.command.1.tlog differ diff --git a/program3_1/program3_1/Debug/program3_1.tlog/link.read.1.tlog b/program3_1/program3_1/Debug/program3_1.tlog/link.read.1.tlog new file mode 100644 index 0000000..0fc95e9 Binary files /dev/null and b/program3_1/program3_1/Debug/program3_1.tlog/link.read.1.tlog differ diff --git a/program3_1/program3_1/Debug/program3_1.tlog/link.write.1.tlog b/program3_1/program3_1/Debug/program3_1.tlog/link.write.1.tlog new file mode 100644 index 0000000..1aaf194 Binary files /dev/null and b/program3_1/program3_1/Debug/program3_1.tlog/link.write.1.tlog differ diff --git a/program3_1/program3_1/Debug/program3_1.tlog/program3_1.lastbuildstate b/program3_1/program3_1/Debug/program3_1.tlog/program3_1.lastbuildstate new file mode 100644 index 0000000..da086a3 --- /dev/null +++ b/program3_1/program3_1/Debug/program3_1.tlog/program3_1.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v120:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit +Debug|Win32|C:\Users\thudr_000\Dropbox\tech\Programming_3\program3_1\| diff --git a/program3_1/program3_1/Debug/stdafx.obj b/program3_1/program3_1/Debug/stdafx.obj new file mode 100644 index 0000000..2ae4a50 Binary files /dev/null and b/program3_1/program3_1/Debug/stdafx.obj differ diff --git a/program3_1/program3_1/Debug/vc120.idb b/program3_1/program3_1/Debug/vc120.idb new file mode 100644 index 0000000..92683ef Binary files /dev/null and b/program3_1/program3_1/Debug/vc120.idb differ diff --git a/program3_1/program3_1/Debug/vc120.pdb b/program3_1/program3_1/Debug/vc120.pdb new file mode 100644 index 0000000..ce60f03 Binary files /dev/null and b/program3_1/program3_1/Debug/vc120.pdb differ diff --git a/program3_1/program3_1/ReadMe.txt b/program3_1/program3_1/ReadMe.txt new file mode 100644 index 0000000..ad6fd1f --- /dev/null +++ b/program3_1/program3_1/ReadMe.txt @@ -0,0 +1,40 @@ +======================================================================== + CONSOLE APPLICATION : program3_1 Project Overview +======================================================================== + +AppWizard has created this program3_1 application for you. + +This file contains a summary of what you will find in each of the files that +make up your program3_1 application. + + +program3_1.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. + +program3_1.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). + +program3_1.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 program3_1.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. + +///////////////////////////////////////////////////////////////////////////// diff --git a/program3_1/program3_1/program3_1.cpp b/program3_1/program3_1/program3_1.cpp new file mode 100644 index 0000000..b68aae8 --- /dev/null +++ b/program3_1/program3_1/program3_1.cpp @@ -0,0 +1,58 @@ +// program3_1.cpp : Defines the entry point for the console application. +/*************************************************************** + * Author: Brandon McCurry + * some collaboration with Matt Gilmore and Jason Nyguen + * + * Reverse a float number without converting to a string + * try to leave the decimal inbetween the same numbers + * Ex: 123.45 to 54.321 + ***************************************************************/ + +#include "stdafx.h" +#include +using namespace std; + +int main() +{ + float num = 0.0; + float newNum = 0.0; + cout << "Please enter a number to reverse: "; + cin >> num; + int temp = num; + int dec = 1; + float whole = 1; + + // get multiplier (123.45, 1), (12.345, 10), + // (1.2345, 100), (.12345, 1000), (.012345, 10000) + while ((num / whole) >= 0.1) + { + whole *= 10; + } + // keep whole value but move decimal one left + // 123.45 / 1000 = .12345, but 54321 / 1000 = 5.4321 + // we want .54321 later + float hold = whole * 10; + + // compare the float to the int version + // float(123.45) == int(123) + while (num != temp) + { + num *= 10; + temp = num; + dec *= 10; + } + while (temp > 0) + { + newNum += (temp % 10) * whole; + temp /= 10; + whole /= 10; + } + // add decimal back from the beginning + // 54321 changes to .54321, then to 54.321 + newNum = newNum / hold * dec; + cout << "Reversed: " << newNum << endl; + cout << "Press enter to exit..."; + getchar(); + getchar(); +} + diff --git a/program3_1/program3_1/program3_1.vcxproj b/program3_1/program3_1/program3_1.vcxproj new file mode 100644 index 0000000..7598f8f --- /dev/null +++ b/program3_1/program3_1/program3_1.vcxproj @@ -0,0 +1,95 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {3AF64A8C-0BE3-4B0B-8FE3-B508B9CF0797} + Win32Proj + program3_1 + + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + true + + + false + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + + + + + Create + Create + + + + + + \ No newline at end of file diff --git a/program3_1/program3_1/program3_1.vcxproj.filters b/program3_1/program3_1/program3_1.vcxproj.filters new file mode 100644 index 0000000..412aa59 --- /dev/null +++ b/program3_1/program3_1/program3_1.vcxproj.filters @@ -0,0 +1,36 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/program3_1/program3_1/stdafx.cpp b/program3_1/program3_1/stdafx.cpp new file mode 100644 index 0000000..0ceb89f --- /dev/null +++ b/program3_1/program3_1/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// program3_1.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 diff --git a/program3_1/program3_1/stdafx.h b/program3_1/program3_1/stdafx.h new file mode 100644 index 0000000..b005a83 --- /dev/null +++ b/program3_1/program3_1/stdafx.h @@ -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 +#include + + + +// TODO: reference additional headers your program requires here diff --git a/program3_1/program3_1/targetver.h b/program3_1/program3_1/targetver.h new file mode 100644 index 0000000..87c0086 --- /dev/null +++ b/program3_1/program3_1/targetver.h @@ -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