diff options
Diffstat (limited to 'CST116-Lab3-Ahmed')
| -rw-r--r-- | CST116-Lab3-Ahmed/CST116-Lab3-Ahmed.cpp | 170 | ||||
| -rw-r--r-- | CST116-Lab3-Ahmed/CST116-Lab3-Ahmed.filters | 30 | ||||
| -rw-r--r-- | CST116-Lab3-Ahmed/CST116-Lab3-Ahmed.vcxproj | 151 | ||||
| -rw-r--r-- | CST116-Lab3-Ahmed/CST116-Lab3-Output.txt | 91 | ||||
| -rw-r--r-- | CST116-Lab3-Ahmed/CST116-Lab3-Pseudocode.txt | 73 | ||||
| -rw-r--r-- | CST116-Lab3-Ahmed/large.txt | 48 | ||||
| -rw-r--r-- | CST116-Lab3-Ahmed/out.txt | 59 | ||||
| -rw-r--r-- | CST116-Lab3-Ahmed/small.txt | 11 |
8 files changed, 633 insertions, 0 deletions
diff --git a/CST116-Lab3-Ahmed/CST116-Lab3-Ahmed.cpp b/CST116-Lab3-Ahmed/CST116-Lab3-Ahmed.cpp new file mode 100644 index 0000000..72076d7 --- /dev/null +++ b/CST116-Lab3-Ahmed/CST116-Lab3-Ahmed.cpp @@ -0,0 +1,170 @@ + +#include <iostream> +#include <fstream> // For the files!!!! +#include <iomanip> // For manipulators & formatting options +#include <string> +#include<array> + +using std::cin; +using std::cout; +using std::endl; +using std::setw; +using std::ios; +using std::string; +using std::ifstream; +using std::ofstream; +using std::setprecision; + + + +// The max amount of records in one file +const int MAX = 50; + +// initialize all functions +int ReadData(ifstream& inFile, int pick[], int drop[], int passCount[], double distance[], double fare[], double toll[], double costPMile[], int counter, double totalFare[]); +void WriteOutputFile(ofstream& outFile, int totalRecords, int people, int pick[], int drop[], int passCount[], double distance[], double fare[], double toll[], double costPMile[]); +void PrintTotalsAndSummary(ofstream& outFile, int totalRecords, int people, int passCount[], double distance[], double fare[], double toll[], double totalFare[], double costPMile[], double paid); + + +int main() +{ + // initialize all arrays and counters + int pick[MAX]; + int drop[MAX]; + int passCount[MAX]; + double distance[MAX]; + double fare[MAX]; + double toll[MAX]; + double totalFare[MAX] = { 0 }; + double costPMile[MAX] = { 0 }; + int record_counter(0); + int people(0); + int counter = 0; + double paid = 0; + + // initialize files + string filename; + ifstream inFile; + ofstream outFile("out.txt"); + + + cout << "Please enter the input file name including extension: " << endl; + cin >> filename; + + // open the requested file + inFile.open(filename); + + if (inFile.is_open()) + { + // read the data from the file, and output the total number of records (store into arrays) + record_counter = ReadData(inFile, pick, drop, passCount, distance, fare, toll, costPMile, counter, totalFare); + + // close the read file + inFile.close(); + + if (outFile.is_open()) + { + // write the new data to the output file + WriteOutputFile(outFile, record_counter, people, pick, drop, passCount, distance, fare, toll, costPMile); + // output the summary both to screen and to file + PrintTotalsAndSummary(outFile, record_counter, people, passCount, distance, fare, toll, totalFare, costPMile, paid); + outFile.close(); + } + else + { + cout << "Trouble Opening File"; + cout << "\n\n\t\t ** About to EXIT NOW! ** "; + } + } + else + { + cout << "Trouble Opening File"; + cout << "\n\n\t\t ** About to EXIT NOW! ** "; + } + return 0; +} +int ReadData(ifstream& inFile, int pick[], int drop[], int passCount[], double distance[], double fare[], double toll[], double costPMile[], int counter, double totalFare[]) +{ + + // print headers + cout << setiosflags(ios::left) << setw(10) << "Trip" << setw(15) + << "Pick" << setw(10) << "Drop" << setw(10) + << "# ppl" + << setw(10) << "Distance" << setw(10) + << "Fare" + << setw(10) << "Toll" + << setw(10) << "Total" + << setw(10) << "Cost per Mile" << endl; + + inFile >> pick[counter] >> drop[counter] >> passCount[counter] >> distance[counter] >> fare[counter] >> toll[counter]; // Priming Read + // read all of the data into arrays + while (!inFile.eof()) + { + totalFare[counter] = fare[counter] + toll[counter]; + cout << setiosflags(ios::left) << setw(10) << counter << setw(15) + << pick[counter] + << setw(10) << drop[counter] << setw(10) + << passCount[counter] + << setw(10) << distance[counter] << setw(10) + << fare[counter] + << setw(10) << toll[counter] << setw(15) + << totalFare[counter] << setw(10); + // if distance is 0 then there is no cost per mile + if (distance[counter] == 0) { + costPMile[counter] = 0; + } + // cost per mile = (toll + fare) / distance + else { + costPMile[counter] = (toll[counter] + fare[counter]) / distance[counter]; + } + cout << setprecision(3) << costPMile[counter]; + counter++; + inFile >> pick[counter] >> drop[counter] >> passCount[counter] >> distance[counter] >> fare[counter] >> toll[counter]; + cout << endl; + + } + + return counter; +} +void WriteOutputFile(ofstream& outFile, int totalRecords, int people, int pick[], int drop[], int passCount[], double distance[], double fare[], double toll[], double costPMile[]) +{ + + // write the same data to the output files + outFile << " Here is the Output File" << endl; + for (int r = 0; r < totalRecords; r++) + { + + outFile << setiosflags(ios::left) << setw(15) + << pick[r] + << setw(15) << drop[r] << setw(15) + << passCount[r] + << setw(15) << distance[r] << setw(15) + << fare[r] + << setw(15) << toll[r] + << setw(15) << costPMile[r] << endl; + } + +} +void PrintTotalsAndSummary(ofstream& outFile, int totalRecords, int people, int passCount[], double distance[], double fare[], double toll[], double totalFare[], double costPMile[], double paid) +{ + // do the calculations for all of the totals. + for (int i = 0; i < totalRecords; i++) { + people += passCount[i]; + double temp = fare[i] + toll[i]; + paid += temp; + totalFare[i] = temp; + + } + // print ot screen + cout << "\n\n\t** Avg Cost Per Person: " << paid/people << " **\n" + << "\n\n\t** People Transported: " << people << " **\n" + << "\n\n\t** Total Cost: " << setprecision(5) << paid << " **\n" + + << "\t\t The End \n"; + // print to output file + outFile << "\n\n\t** Avg Cost Per Person: " << paid/people << " **\n" + << "\n\n\t** People Transported: " << people << " **\n" + << "\n\n\t** Total Cost: " << paid << " **\n" + << "\t\t The End \n"; +} + diff --git a/CST116-Lab3-Ahmed/CST116-Lab3-Ahmed.filters b/CST116-Lab3-Ahmed/CST116-Lab3-Ahmed.filters new file mode 100644 index 0000000..2dfd9f0 --- /dev/null +++ b/CST116-Lab3-Ahmed/CST116-Lab3-Ahmed.filters @@ -0,0 +1,30 @@ +<?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;c++;cppm;ixx;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;h++;hm;inl;inc;ipp;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="Lab3-Ahmed.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <Text Include="CST116-Lab3-Output.txt"> + <Filter>Source Files</Filter> + </Text> + <Text Include="CST116-Lab3-Pseudocode.txt"> + <Filter>Source Files</Filter> + </Text> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/CST116-Lab3-Ahmed/CST116-Lab3-Ahmed.vcxproj b/CST116-Lab3-Ahmed/CST116-Lab3-Ahmed.vcxproj new file mode 100644 index 0000000..4d48773 --- /dev/null +++ b/CST116-Lab3-Ahmed/CST116-Lab3-Ahmed.vcxproj @@ -0,0 +1,151 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" 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> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <VCProjectVersion>16.0</VCProjectVersion> + <Keyword>Win32Proj</Keyword> + <ProjectGuid>{3cecade6-3e15-4852-bd24-65bfe5d3a3aa}</ProjectGuid> + <RootNamespace>BlankConsoleLab</RootNamespace> + <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v143</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v143</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v143</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v143</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </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> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <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|x64'"> + <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> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="Lab3-Ahmed.cpp" /> + </ItemGroup> + <ItemGroup> + <Text Include="CST116-Lab3-Output.txt" /> + <Text Include="CST116-Lab3-Pseudocode.txt" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/CST116-Lab3-Ahmed/CST116-Lab3-Output.txt b/CST116-Lab3-Ahmed/CST116-Lab3-Output.txt new file mode 100644 index 0000000..9ae6094 --- /dev/null +++ b/CST116-Lab3-Ahmed/CST116-Lab3-Output.txt @@ -0,0 +1,91 @@ +OUTPUT FOR LARGE TEXT + +Please enter the input file name including extension: +large.txt +Trip Pick Drop # ppl Distance Fare Toll Total Cost per Mile +0 129 7 3 1.3 7.5 0 7.5 5.77 +1 36 69 1 11.4 32 5.76 37.8 3.31 +2 7 41 1 4.6 15 5.76 20.8 4.51 +3 150 61 2 6.75 23 0 23 3.41 +4 112 17 1 3.84 15 0 15 3.91 +5 80 112 6 1.64 9.5 0 9.5 5.79 +6 256 183 1 16.1 44.5 0 44.5 2.77 +7 138 166 2 7.4 24.5 6.12 30.6 4.14 +8 142 50 5 1.7 8 0 8 4.71 +9 107 163 0 3.6 17 0 17 4.72 +10 132 3 2 19.1 52 6.12 58.1 3.04 +11 48 41 1 4.07 18 4.36 22.4 5.49 +12 132 226 1 14.3 39 0 39 2.73 +13 229 151 1 3.96 14.5 4.58 19.1 4.82 +14 238 166 1 0.76 4.5 0 4.5 5.92 +15 151 238 2 0.64 5 2.2 7.2 11.2 +16 138 82 4 3 12 0 12 4 +17 264 231 3 10.7 32.5 0 32.5 3.03 +18 170 114 5 2.01 9 0 9 4.48 +19 186 87 2 3.45 12 0 12 3.48 +20 209 256 1 3.79 17 0 17 4.49 +21 132 107 1 17.2 52 6.12 58.1 3.38 +22 232 112 1 3.1 11 0 11 3.55 +23 164 141 3 2.85 10.5 0 10.5 3.68 +24 129 7 3 1.3 7.5 0 7.5 5.77 +25 36 69 1 11.4 32 5.76 37.8 3.31 +26 7 41 1 4.6 15 5.76 20.8 4.51 +27 150 61 2 6.75 23 0 23 3.41 +28 112 17 1 3.84 15 0 15 3.91 +29 80 112 6 1.64 9.5 0 9.5 5.79 +30 256 183 1 16.1 44.5 0 44.5 2.77 +31 138 166 2 7.4 24.5 6.12 30.6 4.14 +32 142 50 5 1.7 8 0 8 4.71 +33 107 163 0 3.6 17 0 17 4.72 +34 132 3 2 19.1 52 6.12 58.1 3.04 +35 48 41 1 4.07 18 4.36 22.4 5.49 +36 132 226 1 14.3 39 0 39 2.73 +37 229 151 1 3.96 14.5 4.58 19.1 4.82 +38 238 166 1 0.76 4.5 0 4.5 5.92 +39 151 238 2 0.64 5 2.2 7.2 11.2 +40 138 82 4 3 12 0 12 4 +41 264 231 3 10.7 32.5 0 32.5 3.03 +42 170 114 5 2.01 9 0 9 4.48 +43 186 87 2 3.45 12 0 12 3.48 +44 209 256 1 3.79 17 0 17 4.49 +45 132 107 1 17.2 52 6.12 58.1 3.38 +46 232 112 1 3.1 11 0 11 3.55 +47 164 141 3 2.85 10.5 0 10.5 3.68 + + + ** Avg Cost Per Person: 10.5 ** + + + ** People Transported: 100 ** + + + ** Total Cost: 1052 ** + The End + + +OUTPUT FOR SMALL TEXT + + +Please enter the input file name including extension: +small.txt +Trip Pick Drop # ppl Distance Fare Toll Total Cost per Mile +0 129 7 3 1.3 7.5 0 7.5 5.77 +1 36 69 1 11.4 32 5.76 37.8 3.31 +2 7 41 1 4.6 15 5.76 20.8 4.51 +3 150 61 2 6.75 23 0 23 3.41 +4 112 17 1 3.84 15 0 15 3.91 +5 80 112 6 1.64 9.5 0 9.5 5.79 + + + ** Avg Cost Per Person: 8.11 ** + + + ** People Transported: 14 ** + + + ** Total Cost: 113.52 ** + The End + +C:\Users\macho\source\repos\cst116-lab3-M005A\x64\Debug\BlankConsoleLab.exe (process 9692) exited with code 0. +To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. +Press any key to close this window . . .
\ No newline at end of file diff --git a/CST116-Lab3-Ahmed/CST116-Lab3-Pseudocode.txt b/CST116-Lab3-Ahmed/CST116-Lab3-Pseudocode.txt new file mode 100644 index 0000000..059fda7 --- /dev/null +++ b/CST116-Lab3-Ahmed/CST116-Lab3-Pseudocode.txt @@ -0,0 +1,73 @@ +Initialize a constant int MAX for the maximum amount of records, set to 50 + +START MAIN + +initialize function ReadData, with input file, arrays, and counters +initialize function WriteOutputFile with output file, counters, and arrays +initialize PrintTotalsAndSummary with output file, counters, and arrays + +Initialize an array for each needed value, with the length being equal to max +initialize record counter +initialize people counter +initialize payment counter + +initialize filename +initialize input file +initialize output file + +prompt the user to input a filename wiht extension + set the input equal to filename + +open the file + +if the file is open + call the function ReadData and have its return value be set into record_counter + + close the input file + + if the output file is open + call the functions writeoutputfile and printotalsummary + close the output file + + else + print an error message +else + print an error message + +return 0 + +END MAIN + +ReadData + + prints out headers corresponding to each array + read in the first line of data from the input file and have it set to the first of each array + + while it is not the end of the file + the totalfare at the current index is equal to the far + toll + print out the arrays at the current index, formatting into a table + + if the distance at the current index is 0, the cost per mile is 0 + otherwise the cost per mile is equal to the total cost over the distance + + increment the index + read data again + + return counter + + +WriteOutputFile + + enter a for loop which goes until the end of the total records in the file + print out all the modified data to the output file at the current index + +PrintTotalsAndSummary + + enter a for loop which goes until the end of the total records in the file + set the total amount of people to the array of passCount at the index added together + set a double temp equal to the far + toll at the current index + paid += temp + the totalFare at the current index is equal to temp + + print out the avg cost per person, # people transported, and the total cost to both + the screen and the output file. diff --git a/CST116-Lab3-Ahmed/large.txt b/CST116-Lab3-Ahmed/large.txt new file mode 100644 index 0000000..1c3dbbb --- /dev/null +++ b/CST116-Lab3-Ahmed/large.txt @@ -0,0 +1,48 @@ +129 7 3 1.3 7.5 0 +36 69 1 11.41 32 5.76 +7 41 1 4.6 15 5.76 +150 61 2 6.75 23 0 +112 17 1 3.84 15 0 +80 112 6 1.64 9.5 0 +256 183 1 16.08 44.5 0 +138 166 2 7.4 24.5 6.12 +142 50 5 1.7 8 0 +107 163 0 3.6 17 0 +132 3 2 19.1 52 6.12 +48 41 1 4.07 18 4.36 +132 226 1 14.3 39 0 +229 151 1 3.96 14.5 4.58 +238 166 1 0.76 4.5 0 +151 238 2 0.64 5 2.2 +138 82 4 3 12 0 +264 231 3 10.74 32.5 0 +170 114 5 2.01 9 0 +186 87 2 3.45 12 0 +209 256 1 3.79 17 0 +132 107 1 17.2 52 6.12 +232 112 1 3.1 11 0 +164 141 3 2.85 10.5 0 +129 7 3 1.3 7.5 0 +36 69 1 11.41 32 5.76 +7 41 1 4.6 15 5.76 +150 61 2 6.75 23 0 +112 17 1 3.84 15 0 +80 112 6 1.64 9.5 0 +256 183 1 16.08 44.5 0 +138 166 2 7.4 24.5 6.12 +142 50 5 1.7 8 0 +107 163 0 3.6 17 0 +132 3 2 19.1 52 6.12 +48 41 1 4.07 18 4.36 +132 226 1 14.3 39 0 +229 151 1 3.96 14.5 4.58 +238 166 1 0.76 4.5 0 +151 238 2 0.64 5 2.2 +138 82 4 3 12 0 +264 231 3 10.74 32.5 0 +170 114 5 2.01 9 0 +186 87 2 3.45 12 0 +209 256 1 3.79 17 0 +132 107 1 17.2 52 6.12 +232 112 1 3.1 11 0 +164 141 3 2.85 10.5 0 diff --git a/CST116-Lab3-Ahmed/out.txt b/CST116-Lab3-Ahmed/out.txt new file mode 100644 index 0000000..addee3c --- /dev/null +++ b/CST116-Lab3-Ahmed/out.txt @@ -0,0 +1,59 @@ + Here is the Output File +129 7 3 1.3 7.5 0 5.76923 +36 69 1 11.41 32 5.76 3.30938 +7 41 1 4.6 15 5.76 4.51304 +150 61 2 6.75 23 0 3.40741 +112 17 1 3.84 15 0 3.90625 +80 112 6 1.64 9.5 0 5.79268 +256 183 1 16.08 44.5 0 2.76741 +138 166 2 7.4 24.5 6.12 4.13784 +142 50 5 1.7 8 0 4.70588 +107 163 0 3.6 17 0 4.72222 +132 3 2 19.1 52 6.12 3.04293 +48 41 1 4.07 18 4.36 5.49386 +132 226 1 14.3 39 0 2.72727 +229 151 1 3.96 14.5 4.58 4.81818 +238 166 1 0.76 4.5 0 5.92105 +151 238 2 0.64 5 2.2 11.25 +138 82 4 3 12 0 4 +264 231 3 10.74 32.5 0 3.02607 +170 114 5 2.01 9 0 4.47761 +186 87 2 3.45 12 0 3.47826 +209 256 1 3.79 17 0 4.48549 +132 107 1 17.2 52 6.12 3.37907 +232 112 1 3.1 11 0 3.54839 +164 141 3 2.85 10.5 0 3.68421 +129 7 3 1.3 7.5 0 5.76923 +36 69 1 11.41 32 5.76 3.30938 +7 41 1 4.6 15 5.76 4.51304 +150 61 2 6.75 23 0 3.40741 +112 17 1 3.84 15 0 3.90625 +80 112 6 1.64 9.5 0 5.79268 +256 183 1 16.08 44.5 0 2.76741 +138 166 2 7.4 24.5 6.12 4.13784 +142 50 5 1.7 8 0 4.70588 +107 163 0 3.6 17 0 4.72222 +132 3 2 19.1 52 6.12 3.04293 +48 41 1 4.07 18 4.36 5.49386 +132 226 1 14.3 39 0 2.72727 +229 151 1 3.96 14.5 4.58 4.81818 +238 166 1 0.76 4.5 0 5.92105 +151 238 2 0.64 5 2.2 11.25 +138 82 4 3 12 0 4 +264 231 3 10.74 32.5 0 3.02607 +170 114 5 2.01 9 0 4.47761 +186 87 2 3.45 12 0 3.47826 +209 256 1 3.79 17 0 4.48549 +132 107 1 17.2 52 6.12 3.37907 +232 112 1 3.1 11 0 3.54839 +164 141 3 2.85 10.5 0 3.68421 + + + ** Avg Cost Per Person: 10.5204 ** + + + ** People Transported: 100 ** + + + ** Total Cost: 1052.04 ** + The End diff --git a/CST116-Lab3-Ahmed/small.txt b/CST116-Lab3-Ahmed/small.txt new file mode 100644 index 0000000..1fba087 --- /dev/null +++ b/CST116-Lab3-Ahmed/small.txt @@ -0,0 +1,11 @@ +129 7 3 1.3 7.5 0 + +36 69 1 11.41 32 5.76 + +7 41 1 4.6 15 5.76 + +150 61 2 6.75 23 0 + +112 17 1 3.84 15 0 + +80 112 6 1.64 9.5 0
\ No newline at end of file |