-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha1_functions.h
More file actions
95 lines (74 loc) · 3.11 KB
/
a1_functions.h
File metadata and controls
95 lines (74 loc) · 3.11 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/********* a1_functions.h ********
Student Name = Marwan Alakhras
Student Number = 101296201
*/
#include "a1_data_structures.h"
/********** DON'T MODIFY - FROM HERE **********/
/*
Get unsigned short integer user input.
The value entered by the user must be positive.
If the user enters a negative value, the function asks user to re-enter a positive value.
*/
unsigned short int get_input_usi(void);
/*
Get float user input. The value must be positive.
The value entered by the user must be positive.
If the user enters a negative value, the function asks user to re-enter a positive value.
*/
float get_input_f(void);
/*
Initialize all fields in an activity as per the instructions (3)
*/
void init_activity(activity_t * activity_to_int);
/*
Initialize all fields in the milestone as per the instructions (3)
The implementation of your function MUST call the function init_activity.
*/
void init_milestone(milestone_t * milestone_to_int, unsigned short int num_activities);
/*
Initialize all fields in the project as per the instructions (4)
number_activities contains the number of activities per milestone
*/
project_t init_project(char name[], milestone_t *milestone_list, int number_milestones, const int * number_activities);
/*
Print the main menu as per the instructions (5)
*/
void print_main_menu(void);
/*
Print out milestone stats as per the instructions (6)
number_activities contains the number of activities per milestone
*/
void print_milestone_stats(const milestone_t * list_milestones, int num_milestones, const int * number_activities);
/*
Print out project stats as per the instructions (6)
number_activities contains the number of activities per milestone
The implementation MUST call print_stats_milestone
*/
void print_project_stats(project_t details, const milestone_t * list_milestones, int num_milestones, const int * number_activities);
/*
Update activity per the instructions (6)
*/
void update_activity(activity_t * activity_to_update);
/*
Update milestone per the instructions (6)
*/
void update_milestone(milestone_t * milestone_to_update, int activities_in_milestone);
/*
Update project per the instructions (6)
number_activities contains the number of activities per milestone
*/
void update_project(const milestone_t * milestone_array, int num_milestones, const int * number_activities, project_t * my_project);
/********** DON'T MODIFY - UNTIL HERE **********/
// Extra function prototypes/declarations go here
/*
Checks if the milestone ID is unique by comparing it to other existing milestone IDs.
*/
_Bool is_milestone_ID_unique(milestone_t array_of_IDs[], unsigned short int ID_to_check, int number_of_elements);
/*
Checks if the activity ID is unique by comparing it to other existing activity IDs.
*/
_Bool is_activity_ID_unique(const unsigned short int array_of_IDs [], unsigned short int ID_to_check, int number_of_elements);
/*
Checks if the actvity that the user inputs is completed or not.
*/
_Bool is_activity_completed(const milestone_t * list_milestones, int num_milestones, const int * number_activities, unsigned short int ID_to_check);