Skip to content

Commit 4be5498

Browse files
format path change and const type modifer added
1 parent 7d47df4 commit 4be5498

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

NUB Admission Costing Calculator/main

1.29 MB
Binary file not shown.

NUB Admission Costing Calculator/test.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ double semesterFee, creditFee, admissionFee, otherFees;
1414
// Readfile buffer size, format text file and temporary text file name for output generation
1515
#define BUFFER_SIZE 1024
1616
char FILE_NAME[] = "formats/format.txt";
17+
char D_FILE_NAME[] = "formats/D_format.txt";
1718
char TEMP_FILE_NAME[] = "formats/temp.txt";
1819

1920

@@ -29,7 +30,7 @@ char D_DATABASE_NAME[] = "database/d_costing_chart.db";
2930

3031

3132
// getwaiver function to calculate waiver based on SSC and HSC result for Undergraduate
32-
void getwaiver(double SSC, double HSC, char *department)
33+
void getwaiver(double SSC, double HSC, const char *department)
3334
{
3435
// Waiver is given on lowest result.
3536
double Result = fmin(SSC, HSC);
@@ -168,7 +169,7 @@ void Display(ResultCallback callback)
168169
// Display function for Diploma Holders
169170
void D_Display(ResultCallback callback)
170171
{
171-
FILE *fp = fopen(FILE_NAME, "r");
172+
FILE *fp = fopen(D_FILE_NAME, "r");
172173
if (fp == NULL)
173174
{
174175
perror("Failed to open input file");

NUB Admission Costing Calculator/test.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
typedef void (*ResultCallback)(const char *);
1515

1616
// getwaiver functions
17-
void getwaiver(double SSC, double HSC, char *department);
17+
void getwaiver(double SSC, double HSC, const char *department);
1818
bool D_getwaiver(double DiplomaResult);
1919

2020
void replace_placeholder(char *buffer, const char *placeholder, const char *value);

0 commit comments

Comments
 (0)