Updated name, removed norwegian characters
This commit is contained in:
31
Oving 2/Oppg5/Oppg5.sln
Normal file
31
Oving 2/Oppg5/Oppg5.sln
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.271
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Oppg5", "Oppg5\Oppg5.vcxproj", "{E31C569E-BC43-4B14-8514-116F432F27DF}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E31C569E-BC43-4B14-8514-116F432F27DF}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E31C569E-BC43-4B14-8514-116F432F27DF}.Debug|x64.Build.0 = Debug|x64
|
||||
{E31C569E-BC43-4B14-8514-116F432F27DF}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{E31C569E-BC43-4B14-8514-116F432F27DF}.Debug|x86.Build.0 = Debug|Win32
|
||||
{E31C569E-BC43-4B14-8514-116F432F27DF}.Release|x64.ActiveCfg = Release|x64
|
||||
{E31C569E-BC43-4B14-8514-116F432F27DF}.Release|x64.Build.0 = Release|x64
|
||||
{E31C569E-BC43-4B14-8514-116F432F27DF}.Release|x86.ActiveCfg = Release|Win32
|
||||
{E31C569E-BC43-4B14-8514-116F432F27DF}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {0CD61EBC-FE68-4048-811D-31E82A6BEBA6}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
158
Oving 2/Oppg5/Oppg5/Oppg5.vcxproj
Normal file
158
Oving 2/Oppg5/Oppg5/Oppg5.vcxproj
Normal file
@@ -0,0 +1,158 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.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>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{e31c569e-bc43-4b14-8514-116f432f27df}</ProjectGuid>
|
||||
<RootNamespace>Oppg5</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.17763.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>v141</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</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'">
|
||||
<IncludePath>C:\Program Files\TDT4102\includes;$(ProjectDir);C:\Program Files\TDT4102\Graph_lib\Graph;$(VCInstallDir);C:\Program Files\TDT4102\FLTK_1.3.4-2;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>C:\Program Files\TDT4102\Graph_lib\lib32;C:\Program Files\TDT4102\FLTK_1.3.4-2\lib32;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IncludePath>C:\Program Files\TDT4102\includes;$(ProjectDir);C:\Program Files\TDT4102\Graph_lib\Graph;$(VCInstallDir);C:\Program Files\TDT4102\FLTK_1.3.4-2;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>C:\Program Files\TDT4102\Graph_lib\lib32;C:\Program Files\TDT4102\FLTK_1.3.4-2\lib32;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<IncludePath>C:\Program Files\TDT4102\includes;$(ProjectDir);C:\Program Files\TDT4102\Graph_lib\Graph;$(VCInstallDir);C:\Program Files\TDT4102\FLTK_1.3.4-2;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>C:\Program Files\TDT4102\Graph_lib\lib64;C:\Program Files\TDT4102\FLTK_1.3.4-2\lib64;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<IncludePath>C:\Program Files\TDT4102\includes;$(ProjectDir);C:\Program Files\TDT4102\Graph_lib\Graph;$(VCInstallDir);C:\Program Files\TDT4102\FLTK_1.3.4-2;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>C:\Program Files\TDT4102\Graph_lib\lib64;C:\Program Files\TDT4102\FLTK_1.3.4-2\lib64;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PreprocessorDefinitions>NOGDI;WIN32;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>Graph_libd.lib;fltkd.lib;wsock32.lib;comctl32.lib;fltkjpegd.lib;fltkimagesd.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PreprocessorDefinitions>NOGDI;WIN32;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>Graph_libd.lib;fltkd.lib;wsock32.lib;comctl32.lib;fltkjpegd.lib;fltkimagesd.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PreprocessorDefinitions>NOGDI;WIN32;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>Graph_lib.lib;fltk.lib;wsock32.lib;comctl32.lib;fltkjpeg.lib;fltkimages.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PreprocessorDefinitions>NOGDI;WIN32;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>Graph_lib.lib;fltk.lib;wsock32.lib;comctl32.lib;fltkjpeg.lib;fltkimages.lib;;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
22
Oving 2/Oppg5/Oppg5/Oppg5.vcxproj.filters
Normal file
22
Oving 2/Oppg5/Oppg5/Oppg5.vcxproj.filters
Normal file
@@ -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;hh;hpp;hxx;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="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
76
Oving 2/Oppg5/Oppg5/loan_drawer.cpp
Normal file
76
Oving 2/Oppg5/Oppg5/loan_drawer.cpp
Normal file
@@ -0,0 +1,76 @@
|
||||
#include "loan_drawer.h"
|
||||
|
||||
using namespace Graph_lib;
|
||||
|
||||
constexpr int win_x = 800;
|
||||
constexpr int win_y = 600;
|
||||
constexpr int margin = 30;
|
||||
constexpr int axis_x_len = win_x - 2 * margin;
|
||||
constexpr int axis_y_len = win_y - 2 * margin;
|
||||
constexpr int origo_y = win_y - margin;
|
||||
constexpr int y_max_val = 2000;
|
||||
|
||||
const Color annuity_color = Color::dark_blue;
|
||||
const Color series_color = Color::dark_red;
|
||||
|
||||
void plot_mp(vector<int> points, Marked_polyline& plt)
|
||||
// Precondition: vector of size periods with values ranging from 0 to y_max_val
|
||||
{
|
||||
int periods = static_cast<int>(points.size());
|
||||
|
||||
constexpr double axis_y_scale = double{axis_y_len} / y_max_val;
|
||||
int x_step = axis_x_len / periods;
|
||||
int x = margin + x_step;
|
||||
int y;
|
||||
|
||||
for (int p : points) {
|
||||
y = origo_y - static_cast<int>(p * axis_y_scale);
|
||||
plt.add({x, y});
|
||||
x += x_step;
|
||||
}
|
||||
}
|
||||
|
||||
void drawPlot(vector<int> annuity, vector<int> series, int loan, int rate)
|
||||
// Naiv funksjon. Den tar ikke høyde for at vectorene kan ha ulik størrelse,
|
||||
// ingen transformering av koordinatsystem, osv.
|
||||
{
|
||||
Point tl{100, 100};
|
||||
int periods = static_cast<int>(series.size());
|
||||
const string win_label{"Årlig utgift ved annuitetslån og serielån over "
|
||||
+ to_string(periods) + " år pålydende "
|
||||
+ to_string(loan) + " kroner med "
|
||||
+ to_string(rate) + " % rente."};
|
||||
Simple_window win{tl, win_x, win_y, win_label};
|
||||
|
||||
Axis x{Axis::x, {margin, origo_y}, axis_x_len, periods, "målemerke = 1 år"};
|
||||
Axis y{Axis::y, {margin, origo_y}, axis_y_len, periods,
|
||||
"målemerke = " + to_string(y_max_val / periods) + " kr"};
|
||||
x.set_color(Color::black);
|
||||
y.set_color(Color::black);
|
||||
win.attach(x);
|
||||
win.attach(y);
|
||||
|
||||
// Annuitetslån
|
||||
Marked_polyline annuity_plt{"x"};
|
||||
plot_mp(annuity, annuity_plt);
|
||||
annuity_plt.set_color(annuity_color);
|
||||
|
||||
Text at{{margin + 20, margin + 20}, "Annuitet"};
|
||||
at.set_color(annuity_color);
|
||||
|
||||
win.attach(annuity_plt);
|
||||
win.attach(at);
|
||||
|
||||
// Serielån
|
||||
Marked_polyline series_plt{"x"};
|
||||
plot_mp(series, series_plt);
|
||||
series_plt.set_color(series_color);
|
||||
|
||||
Text st{{margin + 20, margin + 40}, "Serie"};
|
||||
st.set_color(series_color);
|
||||
|
||||
win.attach(series_plt);
|
||||
win.attach(st);
|
||||
|
||||
win.wait_for_button();
|
||||
}
|
||||
5
Oving 2/Oppg5/Oppg5/loan_drawer.h
Normal file
5
Oving 2/Oppg5/Oppg5/loan_drawer.h
Normal file
@@ -0,0 +1,5 @@
|
||||
#include "std_lib_facilities.h" // vector (Vector)
|
||||
#include "Graph.h"
|
||||
#include "Simple_window.h"
|
||||
|
||||
void drawPlot(vector<int> annuity, vector<int> series, int loan, int rate);
|
||||
53
Oving 2/Oppg5/Oppg5/main.cpp
Normal file
53
Oving 2/Oppg5/Oppg5/main.cpp
Normal file
@@ -0,0 +1,53 @@
|
||||
// Example program in TDT4102_Graphics template, from PPP page 415
|
||||
#include "std_lib_facilities.h"
|
||||
#include "Graph.h"
|
||||
#include "Simple_window.h"
|
||||
#include "loan_drawer.h"
|
||||
|
||||
vector<int> CalculateSeries(double loan, double years, double interest) {
|
||||
vector<int> payments(years);
|
||||
int curLoan = loan;
|
||||
for (int i = 0; i < years; i++) {
|
||||
payments[i] = int((loan / years) + (interest / 100) * curLoan);
|
||||
curLoan -= int(loan / years);
|
||||
}
|
||||
return payments;
|
||||
}
|
||||
|
||||
vector<int> CalculateAnnuity(double loan, double years, double interest) {
|
||||
int total = loan * ((interest / 100) / (1 - pow(1 + interest / 100, -years)));
|
||||
vector<int> payments(10);
|
||||
for (int i = 0; i < years; i++) {
|
||||
payments[i] = total;
|
||||
}
|
||||
return payments;
|
||||
}
|
||||
|
||||
int SumVector(vector<int>& vec) {
|
||||
int total = 0;
|
||||
for (int i = 0; i < vec.size(); i++)
|
||||
total += vec[i];
|
||||
return total;
|
||||
}
|
||||
|
||||
|
||||
void DrawLoanTable(vector<int>& seriesLoan, vector<int>& annuityLoan) {
|
||||
int tableW = 12;
|
||||
cout << setw(tableW) << "Year" << setw(tableW) << "Series" << setw(tableW) << "Annuity" << setw(tableW) << "Difference" << endl;
|
||||
|
||||
for (int i = 0; i < seriesLoan.size(); i++) {
|
||||
cout << setw(tableW) << (i + 1) << setw(tableW) << seriesLoan[i] << setw(tableW) << annuityLoan[i] << setw(tableW) << (seriesLoan[i] - annuityLoan[i]) << endl;
|
||||
}
|
||||
|
||||
cout << setw(tableW) << "Total" << setw(tableW) << SumVector(seriesLoan) << setw(tableW) << SumVector(annuityLoan) << setw(tableW) << (SumVector(seriesLoan) - SumVector(annuityLoan)) << endl;
|
||||
}
|
||||
|
||||
int main() {
|
||||
vector<int> seriesLoan = CalculateSeries(10000, 10, 3);
|
||||
vector<int> annuityLoan = CalculateAnnuity(10000, 10, 3);
|
||||
DrawLoanTable(seriesLoan, annuityLoan);
|
||||
//drawPlot(annuityLoan, seriesLoan, 10000, 3);
|
||||
keep_window_open();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user