This repository has been archived on 2022-10-18. You can view files and clone it, but cannot push or open issues or pull requests.
HPC/Project0/src/fraction_summing/main.cpp

60 lines
1.2 KiB
C++
Raw Normal View History

2022-09-20 14:38:03 +00:00
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include "fraction_toolbox.hpp"
using namespace std;
// read command line arguments
static void readcmdline(fraction & frac, int argc, char* argv[])
{
if (argc!=3)
{
printf("Usage: n d\n");
printf(" n numerator of fraction\n");
printf(" d denominator of fraction\n");
exit(1);
}
// read n
frac.num = atoi(argv[1]);
// read d
frac.denom = atoi(argv[2]);
}
static void test23467(int argc, char* argv[])
{
//TODO: implement function
}
static void test5()
{
//TODO: implement function
}
static void test_array_functions(int n)
{
//TODO: implement function
//TODO: find n for which sum function breaks. Explain what is happening.
}
static void test_toolbox(int argc, char* argv[])
{
cout << "\n=============== test23467 =============== " << endl;
test23467(argc, argv);
cout << "\n================= test5 ================= " << endl;
test5();
cout << "\n========== test_array_functions ========= " << endl;
int n = 5;
test_array_functions(n);
}
int main(int argc, char* argv[])
{
}