-
Notifications
You must be signed in to change notification settings - Fork 1
/
SoftDevFinProjDesign0.txt
71 lines (65 loc) · 1.9 KB
/
SoftDevFinProjDesign0.txt
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
Object: DBToList
Functions: connectToDatabase
readDatabase
writeToClassLists
Object: ClassLists
Variables: HashMap Classes classesComplete
HashMap Classes classesNeeded
Functions: getClassDescription
getClassDepartment
getClassNumber
getClassCategory
Object: Classes
Variables: String description
String department
int number
char category
From here, the User Interface can draw data to fill in the charts, bars, and graphs as we see fit.
For example, data for the ring chart we had centered would be:
------------------------------------------------------------------------
int CompleteRing1kCounter=0;
int CompleteRing2kCounter=0;
int CompleteRing3kCounter=0;
int CompleteRing4kCounter=0;
for(Classes : classesComplete){
switch(this.Classes.getClassDepartment){
>3999
ring4kCounter++;
break;
>2999
ring3kCounter++;
break;
>1999
ring2kCounter++;
break;
default
ring1kCounter++;
break;
}
}
int NeededRing1kCounter = 0;
int NeededRing2kCounter = 0;
int NeededRing3kCounter = 0;
int NeededRing4kCounter = 0;
for(Classes : classesNeeded){
switch(this.Classes.getClassDepartment){
>3999
ring4kCounter++;
break;
>2999
ring3kCounter++;
break;
>1999
ring2kCounter++;
break;
default
ring1kCounter++;
break;
}
}
double ring1Percent = (double)NeededRing1kCounter/CompleteRing1kCounter;
double ring2Percent = (double)NeededRing2kCounter/CompleteRing2kCounter;
double ring3Percent = (double)NeededRing3kCounter/CompleteRing3kCounter;
double ring4Percent = (double)NeededRing4kCounter/CompleteRing4kCounter;
------------------------------------------------------------------------
We can shorten this up and make more efficient using some static arrays since it's a definite number of rings to calculate for, this is just early pseudocode example given the design we're looking at.