-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.f90
34 lines (25 loc) · 900 Bytes
/
main.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
program CustomerChurn
use ChurnModule
use fintrcsv_module
implicit none
type(ChurnAnalyzer) :: churnAnalyzer
real, allocatable :: inputData(:,:)
real :: churn
character(len=1024) :: csvFilename
integer(c_int), parameter :: MAX_STRING_LEN = 1024
integer(c_int) :: numCustomers, numTimePoints, i, j, status
! Read the filename of the CSV file from the user
!ADD THE FILENAME
write(*,*) 'Enter the filename of the CSV file:'
read(*, '(a)') trim(csvFilename)
! Read the CSV file
call read_csv_file(trim(csvFilename), inputData, numTimePoints, numCustomers)
! Call the initialization subroutine
call churnAnalyzer%Initialize(numCustomers, inputData)
! Calculate churn
churn = churnAnalyzer%CalculateChurn()
! Display the churn rate
write(*,*) 'Churn rate:', churn
! Deallocate memory
deallocate(inputData)
end program CustomerChurn