/*
Rebecca Han
CSPC 1011 Section 003
Spring 2023
03/28/2023
Lab 9

This program reads information in from a file, then stores it in an array of
structures using the initArray() function. Then, it is sent to a function called
getWorkout() that uses some user input to create a workout. After it is
created, the workout is printed from the function printArray to the screen. 
*/

#include"defs.h"

int main(){ 
	
	int arraySize;

	FILE *inFile = fopen("exercises.txt", "r"); //File pointer
	fscanf(inFile, "%d", &arraySize);
	exercise workout[arraySize]; //creates array of structures
	
	initArray(arraySize, workout,inFile); //Stores file in struct array
	getWorkout(arraySize, workout);//Asks the user to enter values for workout
	printArray(arraySize, workout); //Prints the array to the screen

	return 0;
}
