Skip to content

Commit 42a5625

Browse files
authored
Add files via upload
0 parents  commit 42a5625

37 files changed

+2874
-0
lines changed

lab1/Debug/Lab1.c.o

4.79 KB
Binary file not shown.

lab1/Debug/Lab1.c.o.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Debug/Lab1.c.o: Lab1.c

lab1/Debug/lab1

8.4 KB
Binary file not shown.

lab1/Lab1

8.27 KB
Binary file not shown.

lab1/Lab1.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* Description: C program that reads 3 integer inputs from the user and outputs the sum of the inputs, the first input negated, the number after the second input, and the product of the second and third input.
2+
* Author: Nicholas Ishankov - 1005798521
3+
* Date: 01/10/2020
4+
*/
5+
#include <stdio.h>
6+
7+
int main(int argc, char **argv)
8+
{
9+
//declare variables to store user inputs 1,2 and 3
10+
int inputNum1;
11+
int inputNum2;
12+
int inputNum3;
13+
14+
printf("Enter First Number: "); //prompt user to input integers
15+
scanf("%d", &inputNum1); //read user input and save to integer
16+
printf("Enter Second Number: ");
17+
scanf("%d", &inputNum2);
18+
printf("Enter Third Number: ");
19+
scanf("%d", &inputNum3);
20+
21+
printf("Sum: %d\n", inputNum1 + inputNum2 + inputNum3); //output sum of inputs
22+
printf("First negated: %d\n", -1*inputNum1); //output first input negated
23+
printf("After Number 2: %d\n", inputNum2+1); //output number after second input
24+
printf("Product of Number 2 and Number 3: %d\n", inputNum2*inputNum3); //output product of second and third input
25+
26+
return 0;
27+
}

lab1/Lab1.c.1

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* Description: C program that reads 3 integer inputs from the user and outputs the sum of the inputs, the first input negated, the number after the second input, and the product of the second and third input.
2+
* Author: Nicholas Ishankov - 1005798521
3+
* Date: 01/10/2020
4+
*/
5+
#include <stdio.h>
6+
7+
int main(int argc, char **argv)
8+
{
9+
//declare variables to store user inputs 1,2 and 3
10+
int inputNum1;
11+
int inputNum2;
12+
int inputNum3;
13+
14+
printf("Enter First Number: "); //prompt user to input integers
15+
scanf("%d", &inputNum1); //read user input and save to integer
16+
printf("Enter Second Number: ");
17+
scanf("%d", &inputNum2);
18+
printf("Enter Third Number: ");
19+
scanf("%d", &inputNum3);
20+
21+
printf("Sum: %d\n", inputNum1 + inputNum2 + inputNum3); //output sum of inputs
22+
printf("First negated: %d\n", -1*inputNum1); //output first input negated
23+
printf("After Number 2: %d\n", inputNum2+1); //output number after second input
24+
printf("Product of Number 2 and Number 3: %d\n", inputNum2*inputNum3); //output product of second and third input
25+
26+
return 0;
27+
}

lab1/lab1.mk

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
##
2+
## Auto Generated makefile by CodeLite IDE
3+
## any manual changes will be erased
4+
##
5+
## Debug
6+
ProjectName :=lab1
7+
ConfigurationName :=Debug
8+
WorkspacePath :=/home/user/Desktop/APS105/aps105
9+
ProjectPath :=/home/user/Desktop/APS105/aps105/lab1
10+
IntermediateDirectory :=./Debug
11+
OutDir := $(IntermediateDirectory)
12+
CurrentFileName :=
13+
CurrentFilePath :=
14+
CurrentFileFullPath :=
15+
User :=APS 105 Student
16+
Date :=16/01/20
17+
CodeLitePath :=/home/user/.codelite
18+
LinkerName :=/usr/bin/g++
19+
SharedObjectLinkerName :=/usr/bin/g++ -shared -fPIC
20+
ObjectSuffix :=.o
21+
DependSuffix :=.o.d
22+
PreprocessSuffix :=.i
23+
DebugSwitch :=-g
24+
IncludeSwitch :=-I
25+
LibrarySwitch :=-l
26+
OutputSwitch :=-o
27+
LibraryPathSwitch :=-L
28+
PreprocessorSwitch :=-D
29+
SourceSwitch :=-c
30+
OutputFile :=$(IntermediateDirectory)/$(ProjectName)
31+
Preprocessors :=
32+
ObjectSwitch :=-o
33+
ArchiveOutputSwitch :=
34+
PreprocessOnlySwitch :=-E
35+
ObjectsFileList :="lab1.txt"
36+
PCHCompileFlags :=
37+
MakeDirCommand :=mkdir -p
38+
LinkOptions :=
39+
IncludePath := $(IncludeSwitch). $(IncludeSwitch).
40+
IncludePCH :=
41+
RcIncludePath :=
42+
Libs :=
43+
ArLibs :=
44+
LibPath := $(LibraryPathSwitch).
45+
46+
##
47+
## Common variables
48+
## AR, CXX, CC, AS, CXXFLAGS and CFLAGS can be overriden using an environment variables
49+
##
50+
AR := /usr/bin/ar rcu
51+
CXX := /usr/bin/g++
52+
CC := /usr/bin/gcc
53+
CXXFLAGS := -g -O0 -Wall $(Preprocessors)
54+
CFLAGS := -g -O0 -Wall $(Preprocessors)
55+
ASFLAGS :=
56+
AS := /usr/bin/as
57+
58+
59+
##
60+
## User defined environment variables
61+
##
62+
CodeLiteDir:=/usr/share/codelite
63+
Objects0=$(IntermediateDirectory)/Lab1.c$(ObjectSuffix)
64+
65+
66+
67+
Objects=$(Objects0)
68+
69+
##
70+
## Main Build Targets
71+
##
72+
.PHONY: all clean PreBuild PrePreBuild PostBuild MakeIntermediateDirs
73+
all: $(OutputFile)
74+
75+
$(OutputFile): $(IntermediateDirectory)/.d $(Objects)
76+
@$(MakeDirCommand) $(@D)
77+
@echo "" > $(IntermediateDirectory)/.d
78+
@echo $(Objects0) > $(ObjectsFileList)
79+
$(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions)
80+
81+
MakeIntermediateDirs:
82+
@test -d ./Debug || $(MakeDirCommand) ./Debug
83+
84+
85+
$(IntermediateDirectory)/.d:
86+
@test -d ./Debug || $(MakeDirCommand) ./Debug
87+
88+
PreBuild:
89+
90+
91+
##
92+
## Objects
93+
##
94+
$(IntermediateDirectory)/Lab1.c$(ObjectSuffix): Lab1.c $(IntermediateDirectory)/Lab1.c$(DependSuffix)
95+
$(CC) $(SourceSwitch) "/home/user/Desktop/APS105/aps105/lab1/Lab1.c" $(CFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/Lab1.c$(ObjectSuffix) $(IncludePath)
96+
$(IntermediateDirectory)/Lab1.c$(DependSuffix): Lab1.c
97+
@$(CC) $(CFLAGS) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/Lab1.c$(ObjectSuffix) -MF$(IntermediateDirectory)/Lab1.c$(DependSuffix) -MM Lab1.c
98+
99+
$(IntermediateDirectory)/Lab1.c$(PreprocessSuffix): Lab1.c
100+
$(CC) $(CFLAGS) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/Lab1.c$(PreprocessSuffix) Lab1.c
101+
102+
103+
-include $(IntermediateDirectory)/*$(DependSuffix)
104+
##
105+
## Clean
106+
##
107+
clean:
108+
$(RM) -r ./Debug/
109+
110+

lab1/lab1.project

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<CodeLite_Project Name="lab1" Version="10.0.0" InternalType="Console">
3+
<Description/>
4+
<Dependencies/>
5+
<Settings Type="Executable">
6+
<GlobalSettings>
7+
<Compiler Options="" C_Options="" Assembler="">
8+
<IncludePath Value="."/>
9+
</Compiler>
10+
<Linker Options="">
11+
<LibraryPath Value="."/>
12+
</Linker>
13+
<ResourceCompiler Options=""/>
14+
</GlobalSettings>
15+
<Configuration Name="Debug" CompilerType="GCC" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
16+
<Compiler Options="-g;-O0;-Wall" C_Options="-g;-O0;-Wall" Assembler="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" PCHFlags="" PCHFlagsPolicy="0">
17+
<IncludePath Value="."/>
18+
</Compiler>
19+
<Linker Options="" Required="yes"/>
20+
<ResourceCompiler Options="" Required="no"/>
21+
<General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Debug" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes" IsGUIProgram="no" IsEnabled="yes"/>
22+
<BuildSystem Name="Default"/>
23+
<Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
24+
<![CDATA[]]>
25+
</Environment>
26+
<Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="" IsExtended="no">
27+
<DebuggerSearchPaths/>
28+
<PostConnectCommands/>
29+
<StartupCommands/>
30+
</Debugger>
31+
<PreBuild/>
32+
<PostBuild/>
33+
<CustomBuild Enabled="no">
34+
<RebuildCommand/>
35+
<CleanCommand/>
36+
<BuildCommand/>
37+
<PreprocessFileCommand/>
38+
<SingleFileCommand/>
39+
<MakefileGenerationCommand/>
40+
<ThirdPartyToolName>None</ThirdPartyToolName>
41+
<WorkingDirectory/>
42+
</CustomBuild>
43+
<AdditionalRules>
44+
<CustomPostBuild/>
45+
<CustomPreBuild/>
46+
</AdditionalRules>
47+
<Completion EnableCpp11="no" EnableCpp14="no">
48+
<ClangCmpFlagsC/>
49+
<ClangCmpFlags/>
50+
<ClangPP/>
51+
<SearchPaths/>
52+
</Completion>
53+
</Configuration>
54+
<Configuration Name="Release" CompilerType="GCC" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
55+
<Compiler Options="-O2;-Wall" C_Options="-O2;-Wall" Assembler="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" PCHFlags="" PCHFlagsPolicy="0">
56+
<IncludePath Value="."/>
57+
<Preprocessor Value="NDEBUG"/>
58+
</Compiler>
59+
<Linker Options="" Required="yes"/>
60+
<ResourceCompiler Options="" Required="no"/>
61+
<General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Release" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes" IsGUIProgram="no" IsEnabled="yes"/>
62+
<BuildSystem Name="Default"/>
63+
<Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
64+
<![CDATA[]]>
65+
</Environment>
66+
<Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="" IsExtended="no">
67+
<DebuggerSearchPaths/>
68+
<PostConnectCommands/>
69+
<StartupCommands/>
70+
</Debugger>
71+
<PreBuild/>
72+
<PostBuild/>
73+
<CustomBuild Enabled="no">
74+
<RebuildCommand/>
75+
<CleanCommand/>
76+
<BuildCommand/>
77+
<PreprocessFileCommand/>
78+
<SingleFileCommand/>
79+
<MakefileGenerationCommand/>
80+
<ThirdPartyToolName>None</ThirdPartyToolName>
81+
<WorkingDirectory/>
82+
</CustomBuild>
83+
<AdditionalRules>
84+
<CustomPostBuild/>
85+
<CustomPreBuild/>
86+
</AdditionalRules>
87+
<Completion EnableCpp11="no" EnableCpp14="no">
88+
<ClangCmpFlagsC/>
89+
<ClangCmpFlags/>
90+
<ClangPP/>
91+
<SearchPaths/>
92+
</Completion>
93+
</Configuration>
94+
</Settings>
95+
<VirtualDirectory Name="src">
96+
<File Name="Lab1.c"/>
97+
</VirtualDirectory>
98+
<Dependencies Name="Debug"/>
99+
<Dependencies Name="Release"/>
100+
</CodeLite_Project>

lab1/lab1.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./Debug/Lab1.c.o

lab2/Lab2Part1

8.39 KB
Binary file not shown.

0 commit comments

Comments
 (0)