project2 / project3 com390
Signed-off-by: Amrit Panesar <apanesar@4195tech.com>
This commit is contained in:
1 parent
eb1cdc34a3
commit
b24453a5ba
16 files changed
+375
-13
No files matched your search
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lab1", "Lab1\Lab1.vcxproj", "{40B8067B-058B-4A8E-A8E5-961CB2327455}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{40B8067B-058B-4A8E-A8E5-961CB2327455}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{40B8067B-058B-4A8E-A8E5-961CB2327455}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{40B8067B-058B-4A8E-A8E5-961CB2327455}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{40B8067B-058B-4A8E-A8E5-961CB2327455}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>{40B8067B-058B-4A8E-A8E5-961CB2327455}</ProjectGuid>
|
||||
<RootNamespace>Lab1</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</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 />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?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;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>
|
||||
<ClCompile Include="main.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,35 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
char* name1 = "Mickey Mouse";
|
||||
char* name2 = "Minnie Mouse";
|
||||
|
||||
int retval;
|
||||
|
||||
void pause();
|
||||
|
||||
int main (int argc, char** argv) {
|
||||
|
||||
retval = strcmp(name1, name2);
|
||||
|
||||
switch (retval) {
|
||||
case -1:
|
||||
printf("%d: %s %s %s", retval, name1, "is shorter than", name2);
|
||||
break;
|
||||
case 0:
|
||||
printf("%d: %s %s %s", retval, name1, "is equal to", name2);
|
||||
break;
|
||||
case 1:
|
||||
printf("%d: %s %s %s", retval, name1, "is greater than", name2);
|
||||
break;
|
||||
default:
|
||||
printf("%s: %d", "Undefined return value", retval);
|
||||
}
|
||||
|
||||
pause();
|
||||
}
|
||||
|
||||
void pause() {
|
||||
getch();
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -43,7 +43,7 @@
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
|
||||
@@ -2,48 +2,106 @@
|
||||
* Program: COM 390 - Project 2
|
||||
* Author: Amrit Panesar <apanesar-77260@student.coleman.edu
|
||||
* Date: 2015-08-11
|
||||
* Purpose: Count from 100 to 0 and 0 to 100 two different ways.
|
||||
* Purpose: Count from 0 to 100 and 100 to 0 two different ways.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "main.h"
|
||||
|
||||
int i, j, k = 0;
|
||||
char bufnum[3];
|
||||
int i, j, k = 0, linebr = 80/3;
|
||||
#define BUFARR 100
|
||||
#define BUFLEN 3
|
||||
int bufnum1[BUFARR], bufnum2[BUFARR], bufnum3[BUFARR];
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
printf("%s\n", "Calculating...");
|
||||
|
||||
if (hundred2zero() != TRUE) {
|
||||
printf("Error condition found, exiting early");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (zero2hundred() != TRUE) {
|
||||
if (zero2hundred1() != TRUE) {
|
||||
printf("Error condition found, exiting early");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (zero2hundred2() != TRUE) {
|
||||
printf("Error condition found, exiting early");
|
||||
return 1;
|
||||
}
|
||||
|
||||
pause();
|
||||
|
||||
printf("%s\n", "Printing Hundred to Zero..");
|
||||
for (i = 0; i < BUFARR; i++) {
|
||||
if (i % 10 == 0) {
|
||||
printf("\n");
|
||||
}
|
||||
printf("%03d ", bufnum1[i]);
|
||||
}
|
||||
printf("\n");
|
||||
pause();
|
||||
|
||||
printf("%s\n", "Printing Hundred to Zero (1)");
|
||||
for (i = 0; i < BUFARR; i++) {
|
||||
if (i % 10 == 0) {
|
||||
printf("\n");
|
||||
}
|
||||
printf("%03d ", bufnum2[i]);
|
||||
}
|
||||
printf("\n");
|
||||
pause();
|
||||
|
||||
printf("%s\n", "Printing Hundred to Zero (2)");
|
||||
for (i = 0; i < BUFARR; i++) {
|
||||
if (i % 10 == 0) {
|
||||
printf("\n");
|
||||
}
|
||||
printf("%03d ", bufnum3[i]);
|
||||
}
|
||||
printf("\n");
|
||||
pause();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool hundred2zero() {
|
||||
for (i = 1; i <= 100; i++) {
|
||||
sprintf("%d03", i);
|
||||
for (i = 0; i < BUFARR; i++) {
|
||||
bufnum1[i] = i + 1;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool zero2hundred() {
|
||||
j = 100;
|
||||
bool zero2hundred1() {
|
||||
j = BUFARR + 1;
|
||||
|
||||
while (j > 0) {
|
||||
sprintf("%d03", j);
|
||||
bufnum2[BUFARR - j] = --j;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool zero2hundred2() {
|
||||
k = BUFARR + 1;
|
||||
|
||||
zerohundred_loop:
|
||||
|
||||
bufnum3[BUFARR - k] = --k;
|
||||
|
||||
if (k >= 0) {
|
||||
goto zerohundred_loop;
|
||||
} else {
|
||||
goto zerohundred_done;
|
||||
}
|
||||
|
||||
zerohundred_done:
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void pause() {
|
||||
printf("Press any key to continue. . .");
|
||||
printf("\n%s\n", "Press any key to continue. . .");
|
||||
getch();
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* Program: COM 390 - Project 2
|
||||
* Author: Amrit Panesar <apanesar-77260@student.coleman.edu
|
||||
* Date: 2015-08-11
|
||||
* Purpose: Count from 100 to 0 and 0 to 100 two different ways.
|
||||
* Purpose: Count from 0 to 100 and 100 to 0 two different ways.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -15,6 +15,7 @@ typedef int bool;
|
||||
#define FALSE 0
|
||||
|
||||
bool zero2hundred();
|
||||
bool hundred2zero();
|
||||
bool hundred2zero1();
|
||||
bool hundred2zero2();
|
||||
|
||||
void pause();
|
||||
Binary file not shown.
@@ -0,0 +1,32 @@
|
||||
;By Amrit Panesar <apanesar-77260@student.coleman.edu>
|
||||
;References code from Steve Hanna of vividmachines.com
|
||||
;Launches calc.exe
|
||||
|
||||
[Section .text]
|
||||
|
||||
global _start
|
||||
|
||||
_start:
|
||||
|
||||
jmp short GetCommand
|
||||
|
||||
CommandReturn:
|
||||
pop ebx ;ebx now holds the handle to the string
|
||||
xor eax,eax
|
||||
push eax
|
||||
xor eax,eax ;for some reason the registers can be very volatile, did this just in case
|
||||
mov [ebx + 89],al ;insert the NULL character
|
||||
push ebx
|
||||
mov ebx,0x77e6fd35
|
||||
call ebx ;call WinExec(path,showcode)
|
||||
|
||||
xor eax,eax ;zero the register again, clears winexec retval
|
||||
push eax
|
||||
mov ebx, 0x77e798fd
|
||||
call ebx ;call ExitProcess(0);
|
||||
|
||||
|
||||
GetCommand:
|
||||
;the N at the end of the db will be replaced with a null character
|
||||
call CommandReturn
|
||||
db "cmd.exe /c calc.exe"
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project3", "Project3\Project3.vcxproj", "{AC9AD92F-F278-4F00-94AD-AC87E0EE6CC9}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{AC9AD92F-F278-4F00-94AD-AC87E0EE6CC9}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{AC9AD92F-F278-4F00-94AD-AC87E0EE6CC9}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{AC9AD92F-F278-4F00-94AD-AC87E0EE6CC9}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{AC9AD92F-F278-4F00-94AD-AC87E0EE6CC9}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>{AC9AD92F-F278-4F00-94AD-AC87E0EE6CC9}</ProjectGuid>
|
||||
<RootNamespace>Project3</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</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 />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?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;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>
|
||||
<ClCompile Include="main.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
int main (int argc, char** argv) {
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user