SlideShare a Scribd company logo
1 of 52
PUBH 6034 Module 3 Assignment: Air Quality Standards
Worksheet (Rubric embedded)
Student Name:
Part 1: NAAQS Quiz (Short answer)
Go to EPA’s National Ambient Air Quality Standards website
homepage at http://www3.epa.gov/ttn/naaqs/criteria.html.
Review the details of NAAQS for the criteria pollutants and
answer the following questions:
Question
Student Response
Score
(5 points each)
How many criteria pollutants are covered under the NAAQS?
In what year was the ozone standard first initiated?
For which pollutant has the standard been most recently
strengthened?
Over what period of time are lead measurements made to assess
meeting the standard?
What human health effect is associated with exposure to carbon
monoxide?
List the top two sources of sulfur dioxide emissions in the U.S.
Define a “non-attainment” area with respect to the NAAQS
For which regions of the U.S. is attainment of PM10 a particular
problem?
Instructor comments:
Total Score (40 possible points)
---------------------------------------------------------------------------
---------------------------------------------------------------
Part 2: Choosing national air quality priorities (short essay
answer)
Review the background information on each of the pollutants
covered under the NAAQS and, based on the available
information and considering the questions you addressed above,
indicate which ambient air pollutant you believe should be a
national regulatory priority for the United States and why.
Support your choice by describing the types of health
consequences associated with the pollutant (including any
susceptible populations), its major sources, and when the
standards were last reviewed and/or changed. Then, provide a
brief explanation of one or more global implications for
regulation of this pollutant by the United States. Be sure to cite
your sources.
Student Response:
This question will be scored using the rubric below.
Quality Indicators
Fully Met
Partially Met/Good
Partially Met/Fair
Not Met
Content Quality
(20 points)
Choice of regulatory priority was fully supported with
quantitative data on health consequences, major sources of the
choice pollutant, and when standards were last
reviewed/changed
AND
Global implications of U.S. regulation of the pollutant were
clearly discussed
AND
Data sources were referenced and highly appropriate to support
the choice and discussion
(20 points)
One of the following expected criteria was not clearly
discussed: health consequences, major source, when standards
were last reviewed, or global implications.
AND/OR
Choice was mostly but not fully supported with quantitative
data and references
AND/OR
Writing was a little unclear (typos, minor issues)
(16-19 points)
Two of the following expected criteria were not clearly
discussed: health consequences, major source, when standards
were last reviewed, or global implications.
AND/OR
Choice was not well supported with quantitative data and
references
AND.OR
Writing was unclear (frequent typos, grammatical errors)
(14-15 points)
The pollutant choice was not a pollutant regulated under the
NAAQS
AND/OR
Three or more of the following expected criteria were not
clearly discussed: health consequences, major source, when
standards were last reviewed, or global implications.
AND/OR
Choice was not supported with quantitative data and references
(0-13 points)
Instructor comments:
Score (20 possible points):
---------------------------------------------------------------------------
---------------------------------------------------------------
Part 3: Identify which pollutants significantly contribute to
these issues
Although many pollutants get a bad reputation, certain types of
gas emissions contribute more to specific environmental issues.
Review section 4.1 in your text and the background information
on each of the pollutants covered under the NAAQS. Choose
from among the eight pollutants below and fill in the name of
the correct pollutant in the grid below.
chlorofluorocarbons
particulate matter
dioxins
nitrogen dioxide
carbon monoxide
sulfur dioxide
ozone
carbon dioxide
Pollutant
Global warming
Ozone layer depletion
Acid deposition
Score
Response(5 points)
yes
no
no
Response(5 points)
yes
yes
no
Response(5 points)
no
no
yes
Instructor Comments:
Total Score(15 possible points)
Final Score:
Part 1 Score (40 possible points)
Part 2 Score (20 possible points)
Part 3 Score (15 possible points)
Total Score (75 possible points)
Instructor comments (Timeliness):
Timeliness Factor (late points deducted):
assignment/.DS_Store
__MACOSX/assignment/._.DS_Store
assignment/assignment.docx
The application will keep track of one student’s assignment
grade information for any number courses, and each course can
be anywhere from 1 to 16 weeks long. For each week of the
course, the assignments are (1) threaded discussion score, (2)
quiz score, (3) lab assignment score, and an exam. Not all the
week’s will have each of the assignment score recorded, and the
final week of the course will have a final exam score only.
A student will be able to keep assignment scores for any number
of courses, and each course will have the school name, the
course number, the course title, and how many weeks there are
in the course.
For a selected course, the application will allow the user to
enter the scores, and once the scores are entered for the week
the application will calculate the weekly total and the weekly
average, along with the course running total score, running
average, and letter grade to date (based on course syllabus grade
breakdown).
The database will contain two tables (1) Courses and (2)
Assignments, using the following table names and fields
1. Course
a. Id
b. School
c. Number
d. Title
2. Assignments
a. Id
b. CourseID
c. WeekNumber
d. TDA
e. Lab
f. Quiz
g. Test
The application will display a table that displays the following
for each course that is recorded:
1. Course Number
2. Course Title
3. Course Grade
While the application and database will be user name and
password protected, it is outside the scope of this project to
provide a complete, robust, and secure authentication
component. So, for the purposes of this development, you will
just store the user name and password comma separated value
text file.Design Requirements
The program design shall adhere to the following design
requirements:
1. The program will be constructed using a 3-tier architecture
(1) data, (2) business, and (3) presentation tier and each tier
will only implement the operations appropriate for the tier.
2. The graphical user interface will be constructed using a tab
panel interface, with each tab containing only those operations
related to the tab heading.
3. The order of the tabs will be in logical sequence.
4. The graphical user interface will contain a main menu bar,
and there shall be a menu for each tab that mirrors the
operations on the tab.
5. Each menu item will have a logical name and short cut key
assigned.
6. Each “active” control (i.e. radio button, command button...)
shall have a tooltip describing the operation the control
provides.
7. There shall be a logical, sequential tab order for the input
controls on the form.
8. All class members, both variables and methods, shall by
default be made private.
9. Access to any class/object data member shall only be done
through getters and setters.
10. Methods shall only be made public if it is necessary for
other objects to call the methods.
11. Private variables shall only be access through getters and
setters.
12. All setters will have validation logic to ensure the private
variable is always in a stable state.
FUNCTIONAL REQUIREMENTS
The program operations will adhere to the following
requirements:
1. The maximum points of all the assignments is 1000 points.
2. Each input score item shall be validated against a lower and
upper bound.
3. The lower and upper bounds of each of the assignments shall
be stored in the database or a file.
4. The user must authenticate into the program when it starts.
5. The user name and password shall be stored in a file (which
simulates an authentication component).
6. The running total, running average, and current grade shall
only include scores that have been recorded.
7. The threaded discussion score shall be calculated by the user
being able to select whether a student attended, or posted a note
on a day of the week, for each of the 7 weeks.
8. If a student attends at least three days, the student will
receive full credit for the weekly threaded discussion score.
9. The automatically assigned threaded discussion score, can be
overridden to a lower, or higher score, but within the limits of
the minimum and maximum scores.
10. The weekly total, weekly average, running total, and
running average shall be updated any time one of the dependent
fields is updated.
11. Database operations shall be secure and be written to
minimize SQL injection or other transport type attacks.
Analysis and Design
You will create an analysis and design document that consists
of:
1. Document the current “as is” structure of the program.
2. Create a class/Object Diagram (this can be done in any
drawing tool, or even hand drawn and take a picture).
Instead of you creating a program from scratch, I am giving a
program shell with several TODO action items. You will also
be asked to document the structure and class/object diagram
given the project."
Because of this, I assume that these diagrams (UML) as well as
a completed TODO list (commented throughout the shell) will
need to be completed.
__MACOSX/assignment/._assignment.docx
assignment/source code/.DS_Store
__MACOSX/assignment/source code/._.DS_Store
assignment/source code/src/.DS_Store
__MACOSX/assignment/source code/src/._.DS_Store
assignment/source code/src/business/.DS_Store
__MACOSX/assignment/source code/src/business/._.DS_Store
assignment/source
code/src/business/Assignment.javaassignment/source
code/src/business/Assignment.javapackage business;
import helpers.*;
publicclassAssignment{
privatestaticfinalString DEFAULT_TITLE ="Assignment";
privatestaticfinalint MIN_POINTS =0;
privatestaticfinalint MAX_POINTS =1000;
privateString title;
privateint maxScore;
privateint score;
publicAssignment(){
setTitle(DEFAULT_TITLE);
setMaxScore(maxScore);
setScore(MIN_POINTS);
}
publicAssignment(String title,int maxScore){
setTitle(title);
setMaxScore(maxScore);
setScore(maxScore);
}
publicvoid setTitle(String title){
this.title =StringHelpers.setStringValue(title, DEFAULT_TITL
E);
}
publicString getTitle(){
return title;
}
publicvoid setMaxScore(int maxScore){
this.maxScore =NumberHelpers.findRangeValue(maxScore, MI
N_POINTS, MAX_POINTS);
}
publicint getMaxScore(){
return maxScore;
}
publicvoid setScore(int score){
this.score =NumberHelpers.findRangeValue(score, MIN_POINT
S, maxScore);
}
publicint getScore(){
return score;
}
publicdouble getPercent(){
double percent =0;
if(maxScore >0){
percent = score/maxScore;
}
return percent;
}
publicvoid clearScore(){
score = MIN_POINTS;
}
@Override
publicString toString(){
// TODO: create an output create that displays the title, awarde
d score
//the maximum score, and the percentage ensuring all numbers
//are properly formatted to no more than one decimal
StringBuilder str =newStringBuilder();
return str.toString();
}
}
__MACOSX/assignment/source
code/src/business/._Assignment.java
assignment/source
code/src/business/AssignmentList.javaassignment/source
code/src/business/AssignmentList.java
package business;
import java.util.ArrayList;
import data.AssignmentDB;
publicclassAssignmentList{
privateArrayList<WeekAssignment> assignmentList;
privatefinalAssignmentDB assignmentDB;
privateint courseKey =-1;
publicAssignmentList(int courseKey,Authentication authenticati
on){
setCourseKey(courseKey);
assignmentDB =newAssignmentDB(authentication);
retrieveAssignmentList();
}
publicArrayList<WeekAssignment> getAssignmentList(){
return assignmentList;
}
publicvoid setCourseKey(int courseKey){
this.courseKey = courseKey;
}
privatevoid retrieveAssignmentList(){
assignmentList = assignmentDB.getList(courseKey);
}
publicvoid setAttendance(int weekNumber,int dayNumber,boole
an wasThere){
assignmentList.get(weekNumber-
1).setAttendance(dayNumber, wasThere);
}
publicint getCalculatedAttendance(int weekNumber){
return assignmentList.get(weekNumber-
1).getCalculatedAttendanceScore();
}
publicvoid setTDAScore(int weekNumber,int score){
assignmentList.get(weekNumber-1).setTDAScore(score);
}
publicvoid setLabScore(int weekNumber,int score){
assignmentList.get(weekNumber-1).setLabScore(score);
}
publicvoid setQuizScore(int weekNumber,int score){
assignmentList.get(weekNumber-1).setQuizScore(score);
}
publicvoid setTestScore(int weekNumber,int score){
assignmentList.get(weekNumber-1).setTestScore(score);
}
publicString getWeekAssignmentInformation(int weekNumber){
return assignmentList.get(weekNumber-1).toString();
}
publicvoid clearScores(int weekNumber){
// TODO: for the given week assignment, clear the score in the
assignment object.
}
}
__MACOSX/assignment/source
code/src/business/._AssignmentList.java
assignment/source
code/src/business/Authentication.javaassignment/source
code/src/business/Authentication.javapackage business;
import helpers.*;
import data.AuthenticationIO;
import java.io.Serializable;
publicclassAuthenticationimplementsSerializable{
privateString userName ="";
privateString password ="";
privateAuthenticationIO authIO;
publicAuthentication(){}
publicAuthentication(String userName,String password){
setUserName(userName);
setPassword(password);
}
publicvoid setUserName(String userName){
this.userName =StringHelpers.setStringValue(userName,"");
}
publicString getUserName(){
return userName;
}
publicvoid setPassword(String passWord){
this.password =StringHelpers.setStringValue(passWord,"");
}
publicString getPassword(){
return password;
}
publicboolean authenticate(){
boolean success =false;
authIO =newAuthenticationIO();
Authentication stored = authIO.getAuthentication();
if(stored ==null){
success = authIO.createAuthenticationFile(this);
OutputHelpers.showStandardDialog("New User: "+ userName +
" created","Create new user");
}
else{
if(userName.compareToIgnoreCase(stored.getUserName())==0)
{
success =true;
}
else{
OutputHelpers.showStandardDialog("Invalid user name--
please update user name and try again","Invalid User Name");
}
if(success){
// TODO: write the algorithm to compare the provided passwor
d with the
//stored password, keeping in mind that character case matters.
}
}
return success;
}
}
__MACOSX/assignment/source
code/src/business/._Authentication.java
assignment/source
code/src/business/ClassAssignments.javaassignment/source
code/src/business/ClassAssignments.java
package business;
import helpers.*;
import java.util.ArrayList;
publicclassClassAssignments{
privatestaticfinaldouble MAX_PERCENT =1;
privatestaticfinaldouble LOW_A =.90;
privatestaticfinaldouble LOW_B =.80;
privatestaticfinaldouble LOW_C =.70;
privatestaticfinaldouble LOW_D =.60;
privatestaticfinalint FINAL_EXAM_POINTS =210;
publicstaticfinalint MIN_SCORE =0;
privatefinalCourse course;
privateAssignmentList assignmentList;
privateint totalScore =0;
privateint totalPoints =0;
privateint key =-1;
privateint courseKey =-1;
privatefinalAuthentication authentication;
publicClassAssignments(Course course,Authentication authentic
ation){
this.course = course;
this.authentication = authentication;
initializeAssignmentList();
}
publicvoid setKey(int key){
this.key = key;
}
publicint getKey(){
return key;
}
publicint getCourseKey(){
return courseKey;
}
publicvoid setCourseKey(int courseKey){
this.courseKey = courseKey;
}
privatevoid initializeAssignmentList(){
assignmentList =newAssignmentList(course.getKey(), auth
entication);
}
publicint getNumberWeeks(){
return course.getNumberWeeks();
}
/***************** bounds ****************************
***/
publicint getMinScore(){
return MIN_SCORE;
}
publicint getMAXTDAScore(){
returnWeekAssignment.TDA_POINTS;
}
publicint getMAXLabScore(){
returnWeekAssignment.LAB_POINTS;
}
publicint getMaxQuizScore(){
returnWeekAssignment.QUIZ_POINTS;
}
publicint getMaxTestScore(){
//TODO: write the code to return the maximum vaue of a test sc
ore
return0;
}
/************* school information **********************
*/
publicvoid setSchool(String school){
course.setSchool(school);
}
publicvoid setCourseTitle(String title){
course.setTitle(title);
}
publicvoid setCourseNumber(String courseNumber){
course.setNumber(courseNumber);
}
/******************** weekly assignment information *****
*******************/
publicvoid setAttendance(int weekNumber,int dayNumber,boole
an wasThere){
assignmentList.setAttendance(weekNumber, dayNumber,
wasThere);
}
publicint getCalculatedAttendance(int weekNumber){
return assignmentList.getCalculatedAttendance(weekNumber);
}
publicvoid setTDAScore(int weekNumber,int score){
assignmentList.setTDAScore(weekNumber, score);
}
publicvoid setLabScore(int weekNumber,int score){
assignmentList.setLabScore(weekNumber, score);
}
publicvoid setQuizScore(int weekNumber,int score){
//TODO: write the code to set the quiz score for the given week
}
publicvoid setTestScore(int weekNumber,int score){
assignmentList.setTestScore(weekNumber, score);
}
/*************** running totals ************************
***********/
privatevoid getRunningTotals(){
totalScore =0;
totalPoints =0;
for(WeekAssignment week:assignmentList.getAssignmentList())
{
if(week.IncludeInTotal()){
totalScore += week.getTotalScore();
totalPoints += week.getMaxPoints();
}
}
}
publicint getTotalScore(){
getRunningTotals();
return totalScore;
}
publicdouble getPercent(){
double percent =0;
getRunningTotals();
if(totalPoints >0){
percent =(double) totalScore /(double) totalPoints;
}
return percent;
}
publicString getGrade(){
String grade ="U";
double percent = getPercent();
// TODO: write the algorithm to determine the grade
return grade;
}
publicString getWeekAssignmentInformation(int weekNumber){
return assignmentList.getWeekAssignmentInformation(weekNu
mber);
}
publicvoid clearScores(int weekNumber){
assignmentList.clearScores(weekNumber);
}
@Override
publicString toString(){
StringBuilder str =newStringBuilder();
str.append(course.toString());
str.append("n");
for(WeekAssignment week:assignmentList.getAssignmentList())
{
str.append("n");
str.append(week.toString());
}
str.append("n");
return str.toString();
}
}
__MACOSX/assignment/source
code/src/business/._ClassAssignments.java
assignment/source
code/src/business/Course.javaassignment/source
code/src/business/Course.java
package business;
import helpers.*;
publicclassCourse{
privatestaticfinalString DEFAULT_SCHOOL ="Devry Universit
y";
privatestaticfinalString DEFAULT_NUMBER ="CIS355A";
privatestaticfinalString DEFAULT_TITLE ="Business Applicati
on Programming";
privatestaticfinalint DEFAULT_NUMBER_WEEKS =8;
privatestaticfinalint MIN_NUMBER_WEEKS =1;
privatestaticfinalint MAX_WEEKS =16;
privateString school;
privateString number;
privateString title;
privateint numberWeeks;
privateint key =-1;
publicCourse(){
this.school = DEFAULT_SCHOOL;
this.number = DEFAULT_NUMBER;
this.title = DEFAULT_TITLE;
this.numberWeeks = DEFAULT_NUMBER_WEEKS;
}
publicCourse(int key){
this();
setKey(key);
}
publicCourse(int key,String school,String number,String title,in
t numberWeeks){
setKey(key);
setSchool(school);
setNumber(number);
setTitle(title);
setNumberWeeks(numberWeeks);
}
publicint getKey(){
return key;
}
publicvoid setKey(int key){
this.key = key;
}
publicvoid setSchool(String school){
this.school =StringHelpers.setStringValue(school, DEFAULT_S
CHOOL);
}
publicString getSchool(){
return school;
}
publicString getNumber(){
return number;
}
publicString getTitle(){
return title;
}
publicvoid setNumber(String number){
this.number =StringHelpers.setStringValue(number, DEFAULT
_NUMBER);
}
publicvoid setTitle(String title){
this.title =StringHelpers.setStringValue(title, DEFAULT_TITL
E);
}
publicvoid setNumberWeeks(int numWeeks){
//TODO: write the code to set the number of weeks betwee 1 an
d maximum number of weeks allowed
}
publicint getNumberWeeks(){
return numberWeeks;
}
@Override
publicString toString(){
return getNumber()+": "+ getTitle();
}
}
__MACOSX/assignment/source code/src/business/._Course.java
assignment/source
code/src/business/CourseList.javaassignment/source
code/src/business/CourseList.java
package business;
import java.util.ArrayList;
import javax.swing.DefaultListModel;
import data.CourseDB;
import helpers.*;
import java.util.Vector;
publicclassCourseList{
privateArrayList<Course> courseList;
privatefinalCourseDB courseDB;
privateArrayList<CourseSummary> summaryList;
privateAuthentication authentication;
publicCourseList(Authentication authentication){
courseList =newArrayList<>();
courseDB =newCourseDB(authentication);
retrieveCourseList();
}
privatevoid retrieveCourseList(){
courseList.clear();
courseList = courseDB.getList();
retreivedSummaryList();
}
publicint displayCourseList(DefaultListModel<Course> listMod
el){
int numRecords =0;
if(courseList ==null){
retrieveCourseList();
}
if(courseList.size()>0){
numRecords = courseList.size();
for(Course course:courseList){
listModel.addElement(course);
}
}
return numRecords;
}
privatevoid retreivedSummaryList(){
summaryList =newArrayList<>();
CourseSummary aSummary;
ClassAssignments assignment;
for(Course course:courseList){
aSummary =newCourseSummary();
aSummary.setNumber(course.getNumber());
aSummary.setTitle(course.getTitle());
assignment =newClassAssignments(course, authenticati
on);
aSummary.setGrade(assignment.getGrade());
summaryList.add(aSummary);
}
}
publicArrayList<CourseSummary> summaryList(){
return summaryList;
}
publicVector<String> getColumnNames(){
Vector<String> columnNames =newVector<>();
// TODO: write the code to set the columns names to logical, us
er friendly names
return columnNames;
}
}
__MACOSX/assignment/source
code/src/business/._CourseList.java
assignment/source
code/src/business/CourseSummary.javaassignment/source
code/src/business/CourseSummary.javapackage business;
import helpers.StringHelpers;
publicclassCourseSummary{
privateString number ="";
privateString title ="";
privateString grade ="";
// TODO: add code to validate all the input values to ensure the
y are not empty
publicCourseSummary(){
}
publicCourseSummary(String number,String title,String grade){
setNumber(number);
setTitle(title);
setGrade(grade);
}
publicString getNumber(){
return number;
}
// TODO: for all the setters, write the code to ensure the strings
are not empty
publicvoid setNumber(String courseNumber){
this.number =StringHelpers.setStringValue(courseNumber,"CN"
);
}
publicString getTitle(){
return title;
}
publicvoid setTitle(String courseTitle){
// TODO: for all the setters, write the code to ensure the strings
are not empty
}
publicString getGrade(){
return grade;
}
publicvoid setGrade(String grade){
// TODO: for all the setters, write the code to ensure the strings
are not empty
}
}
__MACOSX/assignment/source
code/src/business/._CourseSummary.java
assignment/source
code/src/business/Student.javaassignment/source
code/src/business/Student.javapackage business;
import helpers.*;
publicclassStudent{
privatestaticfinalString DEFAULT_NAME ="Not Given";
String firstName;
String lastName;
String email;
publicStudent()
{
this.firstName = DEFAULT_NAME;
this.lastName = DEFAULT_NAME;
this.email = DEFAULT_NAME;
}
publicStudent(String firstName,String lastName){
setFirstName(firstName);
setLastName(lastName);
}
publicString getFirstName(){
return firstName;
}
publicfinalvoid setFirstName(String firstName){
this.firstName =StringHelpers.setStringValue(firstName, DEFA
ULT_NAME);
}
publicString getLastName(){
return lastName;
}
publicfinalvoid setLastName(String lastName){
this.lastName =StringHelpers.setStringValue(lastName, DEFAU
LT_NAME);
}
publicvoid setEmail(String email){
if(StringHelpers.validateEmail(email)){
this.email = email;
}
else{
this.email = DEFAULT_NAME;
}
}
publicString getEmail(){
String str ="";
if(isValidEmail()){
str =this.email;
}
return str;
}
publicboolean isValidEmail(){
returnStringHelpers.validateEmail(this.email);
}
publicString getFullName(){
return firstName +" "+ lastName;
}
@Override
publicString toString(){
StringBuilder str =newStringBuilder();
str.append(getFullName());
return str.toString();
}
}
__MACOSX/assignment/source
code/src/business/._Student.java
assignment/source
code/src/business/WeekAssignment.javaassignment/source
code/src/business/WeekAssignment.java
package business;
import helpers.*;
publicclassWeekAssignment{
publicstaticfinalint TDA_POINTS =20;
publicstaticfinalint LAB_POINTS =55;
publicstaticfinalint QUIZ_POINTS =30;
publicstaticfinalint TEST_POINTS =210;
publicstaticfinalint MIN_DAYS_PARTICIPATION =3;
privatestaticfinalint MIN_WEEK =1;
privatestaticfinalint MAX_WEEK =8;
privateint key =-1;
privateint classKey =-1;
privateint weekNumber;
privatefinalWeekAttendance attendance =newWeekAttendance(
TDA_POINTS, MIN_DAYS_PARTICIPATION);
privatefinalAssignment tda =newAssignment("Threaded Discuss
ion", TDA_POINTS);
privatefinalAssignment lab =newAssignment("Programming Lab
", LAB_POINTS);
privatefinalAssignment quiz =newAssignment("Quiz", QUIZ_P
OINTS);
privatefinalAssignment test =newAssignment("Test", TEST_PO
INTS);
privateboolean includeInTotal =false;
publicWeekAssignment(){
weekNumber = MIN_WEEK;
}
publicWeekAssignment(int classKey,int weekNumber){
setWeekNumber(weekNumber);
setClassKey(classKey);
}
publicint getClassKey(){
return classKey;
}
publicvoid setClassKey(int classKey){
this.classKey = classKey;
}
publicint getKey(){
return key;
}
publicvoid setKey(int key){
this.key = key;
}
publicvoid setWeekNumber(int weekNumber){
this.weekNumber =NumberHelpers.findRangeValue(weekNumb
er, MIN_WEEK, MAX_WEEK);
}
publicvoid clearScores(){
// TODO: write the code to clear all the assignment scores as w
ell as the attendance attributes
}
publicvoid setAttendance(int day,boolean wasThere){
attendance.setAttendance(day, wasThere);
setTDAScore(attendance.getScore());
includeInTotal =true;
}
publicint getCalculatedAttendanceScore(){
return attendance.getScore();
}
publicvoid setTDAScore(int score){
tda.setScore(score);
includeInTotal =true;
}
publicvoid setLabScore(int score){
lab.setScore(score);
includeInTotal =true;
}
publicvoid setQuizScore(int score){
// TODO: write the code to set the quiz score and ensure it is in
cluded in the total
}
publicvoid setTestScore(int score){
test.setScore(score);
includeInTotal =true;
}
publicint getTotalScore(){
int total =0;
total = tda.getScore();
// TODO: complete the summing of all the assignment scores for
the week
return total;
}
publicbooleanIncludeInTotal(){
return includeInTotal;
}
publicint getMaxPoints(){
return TDA_POINTS + LAB_POINTS + QUIZ_POINTS + TEST
_POINTS ;
}
publicdouble getPercent(){
double percent =0;
if(getMaxPoints()>0){
percent =(double)getTotalScore()/(double)getMaxPoints
();
}
return percent;
}
publicString weekAssignmentDetails(){
StringBuilder str =newStringBuilder();
str.append("Assignment Week: ");
str.append(weekNumber);
str.append("Total: ");
str.append(getTotalScore());
str.append("/");
str.append(getMaxPoints());
str.append(" = ");
str.append(OutputHelpers.formattedPercent(getPercent(),0
));
str.append("n");
str.append(tda.toString());
str.append("n");
str.append(quiz.toString());
str.append("n");
str.append(lab.toString());
str.append("n");
str.append(test.toString());
return str.toString();
}
@Override
publicString toString(){
StringBuilder str =newStringBuilder();
str.append("Week: ");
str.append(weekNumber);
str.append(" Total: ");
str.append(getTotalScore());
str.append("/");
str.append(getMaxPoints());
str.append(" = ");
str.append(OutputHelpers.formattedPercent(getPercent(),0
));
return str.toString();
}
}
__MACOSX/assignment/source
code/src/business/._WeekAssignment.java
assignment/source
code/src/business/WeekAttendance.javaassignment/source
code/src/business/WeekAttendance.java
package business;
import helpers.NumberHelpers;
publicclassWeekAttendance{
privatestaticfinalint MIN_DAYS =3;
privatestaticfinalint FIRST_DAY =1;
privatestaticfinalint LAST_DAY =7;
privatestaticfinalint FIRST_WEEK =1;
privatestaticfinalint LAST_WEEK =7;
privatestaticfinalint MIN_POINTS =0;
privatestaticfinalint MAX_POINTS =100;
privatestaticfinalint MIN_NUM_DAYS =0;
privatestaticfinalint MAX_NUM_DAYS =3;
privateint score =0;
privateboolean[] attended =newboolean[7];
privateint maxScore =0;
privateint minDays = MIN_DAYS;
privateint pointsPerDay;
publicWeekAttendance(){
initializeAttendance();
}
publicWeekAttendance(int maxScore,int minDays){
this();
setMaxScore(maxScore);
setMinDays(minDays);
}
publicvoid clearAttendance(){
initializeAttendance();
}
publicvoid setMinDays(int minDays){
this.minDays =NumberHelpers.findRangeValue(minDays, MIN_
NUM_DAYS, MAX_NUM_DAYS);
}
publicvoid setMaxScore(int maxScore){
this.maxScore =NumberHelpers.findRangeValue(maxScore, MI
N_POINTS, MAX_POINTS );
}
publicint getMaxScore(){
return maxScore;
}
privatevoid initializeAttendance(){
for(int i =0; i < attended.length; i++){
attended[i]=false;
}
}
publicvoid setAttendance(int day,boolean wasThere){
if(day >= FIRST_DAY && day <= LAST_DAY){
attended[day -1]= wasThere;
}
}
publicint getNumberDaysAttended(){
int count =0;
//TODO: write the code to count how many days of attendance
for the week
return count;
}
publicint getScore(){
int count =0;
if(minDays >0){
pointsPerDay = maxScore/minDays;
}
for(int i =0; i < attended.length; i++){
if(attended[i]){
count++;
}
}
if(count >= minDays){
score = maxScore;
}
else{
score = count * pointsPerDay;
}
return score;
}
@Override
publicString toString(){
StringBuilder str =newStringBuilder();
str.append("n#Days attendended: ");
str.append(getNumberDaysAttended());
str.append("nScore: ");
str.append(getScore());
return str.toString();
}
}
__MACOSX/assignment/source
code/src/business/._WeekAttendance.java
__MACOSX/assignment/source code/src/._business
assignment/source code/src/data/.DS_Store
__MACOSX/assignment/source code/src/data/._.DS_Store
assignment/source
code/src/data/AssignmentDB.javaassignment/source
code/src/data/AssignmentDB.javapackage data;
import business.Authentication;
import helpers.*;
import business.WeekAssignment;
import java.util.ArrayList;
publicclassAssignmentDBextendsDataBaseParent{
publicAssignmentDB(){
super();
}
publicAssignmentDB(Authentication authentication){
super("Assignment", authentication);
}
//TODO: write the code to save the weekly assignment
publicboolean save(WeekAssignment aAssignment){
boolean success =true;
OutputHelpers.showStandardDialog(aAssignment.toString()+" s
aved","Save Week Assignment");
return success;
}
//TODO: write the code to delete the weekly assignment
publicboolean delete(WeekAssignment aAssignment){
boolean success =true;
OutputHelpers.showStandardDialog(aAssignment.toString()+" d
eleted","Delete Week Assignment");
return success;
}
//TODO: write the code to update the weekly assignment
publicboolean update(WeekAssignment aAssignment){
boolean success =true;
OutputHelpers.showStandardDialog(aAssignment.toString()+" u
pdated","Update Week Assignment");
return success;
}
// TODO: write the code to pull all the weekly assignments for a
course from the database
publicArrayList<WeekAssignment> getList(int courseKey){
ArrayList<WeekAssignment> assignmentList =newArrayList<>(
);
for(int i =1; i <=8; i++){
assignmentList.add(newWeekAssignment(courseKey, i)
);
}
return assignmentList;
}
//TODO: write the code to delete all assignments from the datab
ase
//ensuring that the user is prompted to verify that they want to d
elete all the
//course assignment information
publicboolean deleteAll(){
boolean success =true;
OutputHelpers.showStandardDialog("All assignments deleted","
Delete All Assignments");
return success;
}
}
__MACOSX/assignment/source
code/src/data/._AssignmentDB.java
assignment/source
code/src/data/AuthenticationIO.javaassignment/source
code/src/data/AuthenticationIO.javapackage data;
import business.Authentication;
import helpers.FileHelpers;
import helpers.OutputHelpers;
import helpers.StringHelpers;
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
publicclassAuthenticationIO{
publicstaticfinalString DEFAULT_FILE_NAME ="studentcred.
dat";
privateString fileName;
privatestaticfinalString DELIMTER =",";
publicAuthenticationIO(){
setFileName(fileName);
}
publicfinalvoid setFileName(String fileName){
if(StringHelpers.IsNullOrEmpty(fileName)){
fileName = DEFAULT_FILE_NAME;
}
else{
this.fileName = fileName;
}
}
publicAuthentication getAuthentication(){
Authentication storedAuth =null;
ArrayList<String> recordList;
String[] fields;
if(StringHelpers.IsNullOrEmpty(fileName)){
fileName = DEFAULT_FILE_NAME;
}
recordList =FileHelpers.readList(fileName);
if(recordList !=null&&!recordList.isEmpty()){
fields = recordList.get(0).split(DELIMTER);
if(fields.length ==2){
storedAuth =newAuthentication(fields[0], fields[1]);
}
}
return storedAuth;
}
publicboolean createAuthenticationFile(Authentication newAuth
){
boolean success =false;
StringBuilder str =newStringBuilder();
//TODO: write the code to create a comma delimited username,
password pair and write
//the record to the file
return success;
}
}
__MACOSX/assignment/source
code/src/data/._AuthenticationIO.java
assignment/source
code/src/data/CourseDB.javaassignment/source
code/src/data/CourseDB.javapackage data;
import helpers.*;
import business.Course;
import business.Authentication;
import java.util.ArrayList;
publicclassCourseDBextendsDataBaseParent{
publicCourseDB(){
super();
}
publicCourseDB(Authentication authentication){
super("Course", authentication);
}
//TODO: write the code to save the course information to the d
atabase
publicboolean save(Course aCourse){
boolean success =true;
OutputHelpers.showStandardDialog(aCourse.toString()+" saved
","Save Course");
return success;
}
//TODO: write the code to delete the course information from th
e database
publicboolean delete(Course aCourse){
boolean success =true;
OutputHelpers.showStandardDialog(aCourse.toString()+" delete
d","Delete Course");
return success;
}
//TODO: write the code to update the course information from t
he database
publicboolean update(Course aCourse){
boolean success =true;
OutputHelpers.showStandardDialog(aCourse.toString()+" updat
ed","Update Course");
return success;
}
//TODO: write the code to get the course list from the datbase
publicArrayList<Course> getList(){
ArrayList<Course> courseList =newArrayList<>();
courseList.add(newCourse(-1));
courseList.add(newCourse(-1,
"DeVry University",
"CIS247A",
"Object Oriented Programming with C#",
8));
courseList.add(newCourse(-1,
"DeVry University",
"CIS170a",
"Structured Programming with C#",
16));
courseList.add(newCourse(-1,
"DeVry University",
"CIS363A",
"Web Interface Design",
10));
return courseList;
}
//TODO: write the code to delete all courses from the database
//ensuring that the user is prompted to verify that they want to d
elete all the
//course assignment information
//keeping in mind that this will also delete all assignments for t
he course as well
publicboolean deleteAll(){
boolean success =true;
OutputHelpers.showStandardDialog("All courses deleted","Dele
te all Assignments");
return success;
}
}
__MACOSX/assignment/source code/src/data/._CourseDB.java
assignment/source
code/src/data/DataBaseParent.javaassignment/source
code/src/data/DataBaseParent.javapackage data;
import helpers.*;
import business.Authentication;
import java.util.ArrayList;
publicabstractclassDataBaseParent{
//TODO: set the connection string to point to your MySql serve
r and database
privatefinalString CONNECTION_STRING ="jdbc:mysql://devr
y.edupe.net:4300/CIS355A_1011";
protectedString table;
protectedAuthentication authentication;
privateConnectionHelper connHelper;
publicDataBaseParent(){
connHelper =newConnectionHelper();
}
publicDataBaseParent(String table,Authentication authenticatio
n){
this();
setTableName(table);
this.authentication = authentication;
setConnection();
}
protectedvoid setConnection(){
if(authentication.authenticate()){
connHelper.setConnection(CONNECTION_STRING, a
uthentication.getUserName(), authentication.getPassword());
}
else{
OutputHelpers.showExceptionDialog("Database credentials inva
lid","Invalid Database Credentials");
}
}
publicvoid setTableName(String table){
this.table =StringHelpers.setStringValue(table,"");
}
}
__MACOSX/assignment/source
code/src/data/._DataBaseParent.java
__MACOSX/assignment/source code/src/._data
assignment/source code/src/presentation/pnlAssignments.form
__MACOSX/assignment/source
code/src/presentation/._pnlAssignments.form
assignment/source
code/src/presentation/pnlAssignments.javaassignment/source
code/src/presentation/pnlAssignments.java
package presentation;
import business.Authentication;
import helpers.GUIUtilities;
import helpers.InputHelpers;
import helpers.OutputHelpers;
import business.Course;
/**
*
* @author Tevis
*/
publicclass pnlAssignments extends javax.swing.JPanel{
privateScores_Main mainForm;
privateint week;
privateCourse course;
privateAuthentication authentication;
public pnlAssignments(){
initComponents();
}
public pnlAssignments(Scores_Main mainForm,Course course,i
nt week){
this();
this.mainForm = mainForm;
this.week = week;
this.course = course;
setWeekInformation();
}
publicint getWeek(){
return week;
}
privatevoid setWeekInformation(){
String title ="Enter Week "+ week +" Scores for "+ course.getN
umber();
lblDirections.setText(title);
txtTDAScore.setText(OutputHelpers.formattedInteger(mai
nForm.getTDAMaxScore()));
lblTDAMax.setText("/"+ mainForm.getTDAMaxScore());
txtQuizScore.setText(OutputHelpers.formattedInteger(mai
nForm.getMaxQuizScore()));
lblQuizMax.setText("/"+ mainForm.getMaxQuizScore());
txtLabScore.setText(OutputHelpers.formattedInteger(main
Form.getMaxLabScore()));
lblLabMax.setText("/"+ mainForm.getMaxLabScore());
txtTestScore.setText("");
lblTestMax.setText("/"+ mainForm.getMaxTestScore());
}
privatevoid setAttendance(int dayNum,boolean wasThere){
mainForm.setAttendance(week, dayNum, wasThere);
txtTDAScore.setText(OutputHelpers.formattedInteger(mai
nForm.getCalculatedAttendance(week)));
}
publicvoid saveAssignmentInformation(){
//TODO: call back to the main form and save the current week's
assignment information
OutputHelpers.showStandardDialog(mainForm.getWeekAssign
mentDetails(week),"Week Information Saved");
}
publicvoid clearAssignmentInformation(){
GUIUtilities.clearInputFields(pnlTDA);
GUIUtilities.clearInputFields(pnlQuiz);
// TODO: clear the input fields in the lab panel
mainForm.clearScores(week);
}
/**
* This method is called from within the constructor to initial
ize the form.
* WARNING: Do NOT modify this code. The content of this
method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-
fold defaultstate="collapsed" desc="Generated Code">//GEN-
BEGIN:initComponents
privatevoid initComponents(){
lblDirections =new javax.swing.JLabel();
pnlTDA =new javax.swing.JPanel();
chkDay1 =new javax.swing.JCheckBox();
chkDay2 =new javax.swing.JCheckBox();
chkDay3 =new javax.swing.JCheckBox();
chkDay4 =new javax.swing.JCheckBox();
chkDay5 =new javax.swing.JCheckBox();
chkDay6 =new javax.swing.JCheckBox();
chkDay7 =new javax.swing.JCheckBox();
jLabel1 =new javax.swing.JLabel();
txtTDAScore =new javax.swing.JTextField();
lblTDAMax =new javax.swing.JLabel();
pnlQuiz =new javax.swing.JPanel();
txtQuizScore =new javax.swing.JTextField();
jLabel2 =new javax.swing.JLabel();
lblQuizMax =new javax.swing.JLabel();
pnlLab =new javax.swing.JPanel();
txtLabScore =new javax.swing.JTextField();
jLabel3 =new javax.swing.JLabel();
lblLabMax =new javax.swing.JLabel();
btnSave =new javax.swing.JButton();
btnClear =new javax.swing.JButton();
pnlTest =new javax.swing.JPanel();
txtTestScore =new javax.swing.JTextField();
jLabel4 =new javax.swing.JLabel();
lblTestMax =new javax.swing.JLabel();
setBorder(javax.swing.BorderFactory.createLineBorder(ne
w java.awt.Color(0,0,0)));
lblDirections.setFont(new java.awt.Font("Tahoma",2,12));
// NOI18N
lblDirections.setForeground(new java.awt.Color(0,0,80));
lblDirections.setText("Enter the attendance and assignmen
t information");
lblDirections.setToolTipText("");
pnlTDA.setBorder(javax.swing.BorderFactory.createTitled
Border(null,"Daily Attendance/Participation", javax.swing.bord
er.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.bord
er.TitledBorder.DEFAULT_POSITION,new java.awt.Font("Tah
oma",1,11),new java.awt.Color(0,0,80)));// NOI18N
chkDay1.setText("Sunday");
chkDay1.addItemListener(new java.awt.event.ItemListener
(){
publicvoid itemStateChanged(java.awt.event.ItemEvent evt){
chkDay1ItemStateChanged(evt);
}
});
chkDay2.setText("Monday");
chkDay2.addItemListener(new java.awt.event.ItemListener
(){
publicvoid itemStateChanged(java.awt.event.ItemEvent evt){
chkDay2ItemStateChanged(evt);
}
});
chkDay3.setText("Tuesday");
chkDay3.setToolTipText("");
chkDay3.addItemListener(new java.awt.event.ItemListener
(){
publicvoid itemStateChanged(java.awt.event.ItemEvent evt){
chkDay3ItemStateChanged(evt);
}
});
chkDay4.setText("Wednesday");
chkDay4.addItemListener(new java.awt.event.ItemListener
(){
publicvoid itemStateChanged(java.awt.event.ItemEvent evt){
chkDay4ItemStateChanged(evt);
}
});
chkDay5.setText("Thursday");
chkDay5.addItemListener(new java.awt.event.ItemListener
(){
publicvoid itemStateChanged(java.awt.event.ItemEvent evt){
chkDay5ItemStateChanged(evt);
}
});
chkDay6.setText("Friday");
chkDay6.addItemListener(new java.awt.event.ItemListener
(){
publicvoid itemStateChanged(java.awt.event.ItemEvent evt){
chkDay6ItemStateChanged(evt);
}
});
chkDay7.setText("Saturday");
chkDay7.addItemListener(new java.awt.event.ItemListener
(){
publicvoid itemStateChanged(java.awt.event.ItemEvent evt){
chkDay7ItemStateChanged(evt);
}
});
jLabel1.setForeground(new java.awt.Color(0,0,80));
jLabel1.setText("Score");
txtTDAScore.setToolTipText("Enter the score for the parti
cipation/attendance");
txtTDAScore.addFocusListener(new java.awt.event.Focus
Adapter(){
publicvoid focusLost(java.awt.event.FocusEvent evt){
txtTDAScoreFocusLost(evt);
}
});
lblTDAMax.setForeground(new java.awt.Color(0,0,80));
lblTDAMax.setText("/30");
javax.swing.GroupLayout pnlTDALayout =new javax.swin
g.GroupLayout(pnlTDA);
pnlTDA.setLayout(pnlTDALayout);
pnlTDALayout.setHorizontalGroup(
pnlTDALayout.createParallelGroup(javax.swing.Group
Layout.Alignment.LEADING)
.addGroup(pnlTDALayout.createSequentialGroup()
.addContainerGap()
.addGroup(pnlTDALayout.createParallelGroup(javax.swing.Gro
upLayout.Alignment.LEADING)
.addGroup(pnlTDALayout.createSequentialGroup()
.addComponent(chkDay1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.UNRELATED)
.addComponent(chkDay2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.UNRELATED)
.addComponent(chkDay3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.UNRELATED)
.addComponent(chkDay4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.UNRELATED)
.addComponent(chkDay5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.UNRELATED)
.addComponent(chkDay6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.UNRELATED)
.addComponent(chkDay7))
.addGroup(pnlTDALayout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.UNRELATED)
.addComponent(txtTDAScore, javax.swing.GroupLayout.PREFE
RRED_SIZE,50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED)
.addComponent(lblTDAMax)))
.addContainerGap(16,Short.MAX_VALUE))
);
pnlTDALayout.setVerticalGroup(
pnlTDALayout.createParallelGroup(javax.swing.Group
Layout.Alignment.LEADING)
.addGroup(pnlTDALayout.createSequentialGroup()
.addContainerGap()
.addGroup(pnlTDALayout.createParallelGroup(javax.swing.Gro
upLayout.Alignment.BASELINE)
.addComponent(chkDay1)
.addComponent(chkDay2)
.addComponent(chkDay3)
.addComponent(chkDay4)
.addComponent(chkDay5)
.addComponent(chkDay6)
.addComponent(chkDay7))
.addGap(11,11,11)
.addGroup(pnlTDALayout.createParallelGroup(javax.swing.Gro
upLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addGroup(pnlTDALayout.createParallelGroup(javax.swing.Gro
upLayout.Alignment.BASELINE)
PUBH 6034 Module 3 Assignment Air Quality Standards Worksheet (Ru.docx

More Related Content

Similar to PUBH 6034 Module 3 Assignment Air Quality Standards Worksheet (Ru.docx

Case Study Analysis 2The Cholesterol.xls records cholesterol lev.docx
Case Study Analysis 2The Cholesterol.xls records cholesterol lev.docxCase Study Analysis 2The Cholesterol.xls records cholesterol lev.docx
Case Study Analysis 2The Cholesterol.xls records cholesterol lev.docx
wendolynhalbert
 
CS631 Formal Research Report or QA (Online)The Formal Research Re
CS631 Formal Research Report or QA (Online)The Formal Research ReCS631 Formal Research Report or QA (Online)The Formal Research Re
CS631 Formal Research Report or QA (Online)The Formal Research Re
MargenePurnell14
 
Assessment 2 descriptor
Assessment 2  descriptorAssessment 2  descriptor
Assessment 2 descriptor
Praneel Chand
 

Similar to PUBH 6034 Module 3 Assignment Air Quality Standards Worksheet (Ru.docx (20)

IFSM 461 Enhance teaching - snaptutorial.com
IFSM 461  Enhance teaching - snaptutorial.comIFSM 461  Enhance teaching - snaptutorial.com
IFSM 461 Enhance teaching - snaptutorial.com
 
Showcase 2
Showcase 2Showcase 2
Showcase 2
 
Online quiz system
Online quiz systemOnline quiz system
Online quiz system
 
IFSM 461 EXceptional Education/snaptutorial.COM
IFSM 461 EXceptional Education/snaptutorial.COMIFSM 461 EXceptional Education/snaptutorial.COM
IFSM 461 EXceptional Education/snaptutorial.COM
 
Ifsm 461 Education Specialist -snaptutorial.com
Ifsm 461 Education Specialist -snaptutorial.comIfsm 461 Education Specialist -snaptutorial.com
Ifsm 461 Education Specialist -snaptutorial.com
 
IFSM 461 Education Organization - snaptutorial.com
IFSM 461  Education Organization - snaptutorial.comIFSM 461  Education Organization - snaptutorial.com
IFSM 461 Education Organization - snaptutorial.com
 
Exam – june 2010 – qp 11
Exam – june 2010 – qp 11Exam – june 2010 – qp 11
Exam – june 2010 – qp 11
 
Marking report
Marking reportMarking report
Marking report
 
BSOP 326 Expect Success/newtonhelp.com
BSOP 326 Expect Success/newtonhelp.comBSOP 326 Expect Success/newtonhelp.com
BSOP 326 Expect Success/newtonhelp.com
 
Bsop 326 Enhance teaching / snaptutorial.com
Bsop 326  Enhance teaching / snaptutorial.comBsop 326  Enhance teaching / snaptutorial.com
Bsop 326 Enhance teaching / snaptutorial.com
 
IFSM 461 Effective Communication - tutorialrank.com
IFSM 461  Effective Communication - tutorialrank.comIFSM 461  Effective Communication - tutorialrank.com
IFSM 461 Effective Communication - tutorialrank.com
 
Case Study Analysis 2The Cholesterol.xls records cholesterol lev.docx
Case Study Analysis 2The Cholesterol.xls records cholesterol lev.docxCase Study Analysis 2The Cholesterol.xls records cholesterol lev.docx
Case Study Analysis 2The Cholesterol.xls records cholesterol lev.docx
 
IFSM 461 Inspiring Innovation/tutorialrank.com
 IFSM 461 Inspiring Innovation/tutorialrank.com IFSM 461 Inspiring Innovation/tutorialrank.com
IFSM 461 Inspiring Innovation/tutorialrank.com
 
Nursing informatics
Nursing informaticsNursing informatics
Nursing informatics
 
Analysis
AnalysisAnalysis
Analysis
 
BSOP 326 Effective Communication/tutorialrank.com
 BSOP 326 Effective Communication/tutorialrank.com BSOP 326 Effective Communication/tutorialrank.com
BSOP 326 Effective Communication/tutorialrank.com
 
Bsop 326 Enhance teaching - tutorialrank.com
Bsop 326  Enhance teaching - tutorialrank.comBsop 326  Enhance teaching - tutorialrank.com
Bsop 326 Enhance teaching - tutorialrank.com
 
CS631 Formal Research Report or QA (Online)The Formal Research Re
CS631 Formal Research Report or QA (Online)The Formal Research ReCS631 Formal Research Report or QA (Online)The Formal Research Re
CS631 Formal Research Report or QA (Online)The Formal Research Re
 
Bsop 330Education Redefined / snaptutorial.com
Bsop 330Education Redefined / snaptutorial.comBsop 330Education Redefined / snaptutorial.com
Bsop 330Education Redefined / snaptutorial.com
 
Assessment 2 descriptor
Assessment 2  descriptorAssessment 2  descriptor
Assessment 2 descriptor
 

More from potmanandrea

Seeing” Social MovementsAn important component of studying social.docx
Seeing” Social MovementsAn important component of studying social.docxSeeing” Social MovementsAn important component of studying social.docx
Seeing” Social MovementsAn important component of studying social.docx
potmanandrea
 
Seeking someone that is great at writing papers!  Must be familar .docx
Seeking someone that is great at writing papers!  Must be familar .docxSeeking someone that is great at writing papers!  Must be familar .docx
Seeking someone that is great at writing papers!  Must be familar .docx
potmanandrea
 
See comments at the right of the data set..docx
See comments at the right of the data set..docxSee comments at the right of the data set..docx
See comments at the right of the data set..docx
potmanandrea
 
see the attached filesThe QuestionIs management in the publ.docx
see the attached filesThe QuestionIs management in the publ.docxsee the attached filesThe QuestionIs management in the publ.docx
see the attached filesThe QuestionIs management in the publ.docx
potmanandrea
 
See discussions, stats, and author profiles for this publicati.docx
See discussions, stats, and author profiles for this publicati.docxSee discussions, stats, and author profiles for this publicati.docx
See discussions, stats, and author profiles for this publicati.docx
potmanandrea
 
Section Four Answer all questions thoroughly and hand-write on loos.docx
Section Four Answer all questions thoroughly and hand-write on loos.docxSection Four Answer all questions thoroughly and hand-write on loos.docx
Section Four Answer all questions thoroughly and hand-write on loos.docx
potmanandrea
 

More from potmanandrea (20)

Select a foreign country and analyze its monetary system. Formatted .docx
Select a foreign country and analyze its monetary system. Formatted .docxSelect a foreign country and analyze its monetary system. Formatted .docx
Select a foreign country and analyze its monetary system. Formatted .docx
 
Select a company of your choice. Study the company’ CEO and determ.docx
Select a company of your choice. Study the company’ CEO and determ.docxSelect a company of your choice. Study the company’ CEO and determ.docx
Select a company of your choice. Study the company’ CEO and determ.docx
 
Seeing” Social MovementsAn important component of studying social.docx
Seeing” Social MovementsAn important component of studying social.docxSeeing” Social MovementsAn important component of studying social.docx
Seeing” Social MovementsAn important component of studying social.docx
 
Seeking someone that is great at writing papers!  Must be familar .docx
Seeking someone that is great at writing papers!  Must be familar .docxSeeking someone that is great at writing papers!  Must be familar .docx
Seeking someone that is great at writing papers!  Must be familar .docx
 
See comments at the right of the data set..docx
See comments at the right of the data set..docxSee comments at the right of the data set..docx
See comments at the right of the data set..docx
 
Select a company you are familiar with. Imagine that this company is.docx
Select a company you are familiar with. Imagine that this company is.docxSelect a company you are familiar with. Imagine that this company is.docx
Select a company you are familiar with. Imagine that this company is.docx
 
Select a contemporary issue that is of interest to you.Create .docx
Select a contemporary issue that is of interest to you.Create .docxSelect a contemporary issue that is of interest to you.Create .docx
Select a contemporary issue that is of interest to you.Create .docx
 
see the attached filesThe QuestionIs management in the publ.docx
see the attached filesThe QuestionIs management in the publ.docxsee the attached filesThe QuestionIs management in the publ.docx
see the attached filesThe QuestionIs management in the publ.docx
 
See discussions, stats, and author profiles for this publicati.docx
See discussions, stats, and author profiles for this publicati.docxSee discussions, stats, and author profiles for this publicati.docx
See discussions, stats, and author profiles for this publicati.docx
 
See details below with a minimum of 8 scholarly referencesKey .docx
See details below with a minimum of 8 scholarly referencesKey .docxSee details below with a minimum of 8 scholarly referencesKey .docx
See details below with a minimum of 8 scholarly referencesKey .docx
 
See attatched for part 1Part 2Develop a 10- to 12-slide Micr.docx
See attatched for part 1Part 2Develop a 10- to 12-slide Micr.docxSee attatched for part 1Part 2Develop a 10- to 12-slide Micr.docx
See attatched for part 1Part 2Develop a 10- to 12-slide Micr.docx
 
SEE ATTACHMENTRefer to the Intervention Series #38 Anthony” vid.docx
SEE ATTACHMENTRefer to the Intervention Series #38 Anthony” vid.docxSEE ATTACHMENTRefer to the Intervention Series #38 Anthony” vid.docx
SEE ATTACHMENTRefer to the Intervention Series #38 Anthony” vid.docx
 
SEE Attachment for subject MatterMust be eight to ten double-spa.docx
SEE Attachment for subject MatterMust be eight to ten double-spa.docxSEE Attachment for subject MatterMust be eight to ten double-spa.docx
SEE Attachment for subject MatterMust be eight to ten double-spa.docx
 
See attachment for my proposal and exampleUse the completed prio.docx
See attachment for my proposal and exampleUse the completed prio.docxSee attachment for my proposal and exampleUse the completed prio.docx
See attachment for my proposal and exampleUse the completed prio.docx
 
Securities Fraud Please respond to the followingFrom the e-Acti.docx
Securities Fraud Please respond to the followingFrom the e-Acti.docxSecurities Fraud Please respond to the followingFrom the e-Acti.docx
Securities Fraud Please respond to the followingFrom the e-Acti.docx
 
Security Standards  Please respond to the followingA number of .docx
Security Standards  Please respond to the followingA number of .docxSecurity Standards  Please respond to the followingA number of .docx
Security Standards  Please respond to the followingA number of .docx
 
Section Four Answer all questions thoroughly and hand-write on loos.docx
Section Four Answer all questions thoroughly and hand-write on loos.docxSection Four Answer all questions thoroughly and hand-write on loos.docx
Section Four Answer all questions thoroughly and hand-write on loos.docx
 
Security Support Responsibilities Please respond to the following.docx
Security Support Responsibilities Please respond to the following.docxSecurity Support Responsibilities Please respond to the following.docx
Security Support Responsibilities Please respond to the following.docx
 
Section 1 (200 words)In cognition, one of the major areas of discu.docx
Section 1 (200 words)In cognition, one of the major areas of discu.docxSection 1 (200 words)In cognition, one of the major areas of discu.docx
Section 1 (200 words)In cognition, one of the major areas of discu.docx
 
Second Wave Feminism, gained strength during the 1970s. For this .docx
Second Wave Feminism, gained strength during the 1970s. For this .docxSecond Wave Feminism, gained strength during the 1970s. For this .docx
Second Wave Feminism, gained strength during the 1970s. For this .docx
 

Recently uploaded

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
SoniaTolstoy
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Recently uploaded (20)

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 

PUBH 6034 Module 3 Assignment Air Quality Standards Worksheet (Ru.docx

  • 1. PUBH 6034 Module 3 Assignment: Air Quality Standards Worksheet (Rubric embedded) Student Name: Part 1: NAAQS Quiz (Short answer) Go to EPA’s National Ambient Air Quality Standards website homepage at http://www3.epa.gov/ttn/naaqs/criteria.html. Review the details of NAAQS for the criteria pollutants and answer the following questions: Question Student Response Score (5 points each) How many criteria pollutants are covered under the NAAQS? In what year was the ozone standard first initiated? For which pollutant has the standard been most recently strengthened? Over what period of time are lead measurements made to assess meeting the standard? What human health effect is associated with exposure to carbon monoxide? List the top two sources of sulfur dioxide emissions in the U.S.
  • 2. Define a “non-attainment” area with respect to the NAAQS For which regions of the U.S. is attainment of PM10 a particular problem? Instructor comments: Total Score (40 possible points) --------------------------------------------------------------------------- --------------------------------------------------------------- Part 2: Choosing national air quality priorities (short essay answer) Review the background information on each of the pollutants covered under the NAAQS and, based on the available information and considering the questions you addressed above, indicate which ambient air pollutant you believe should be a national regulatory priority for the United States and why. Support your choice by describing the types of health consequences associated with the pollutant (including any susceptible populations), its major sources, and when the standards were last reviewed and/or changed. Then, provide a brief explanation of one or more global implications for regulation of this pollutant by the United States. Be sure to cite your sources. Student Response: This question will be scored using the rubric below. Quality Indicators Fully Met Partially Met/Good Partially Met/Fair
  • 3. Not Met Content Quality (20 points) Choice of regulatory priority was fully supported with quantitative data on health consequences, major sources of the choice pollutant, and when standards were last reviewed/changed AND Global implications of U.S. regulation of the pollutant were clearly discussed AND Data sources were referenced and highly appropriate to support the choice and discussion (20 points) One of the following expected criteria was not clearly discussed: health consequences, major source, when standards were last reviewed, or global implications. AND/OR Choice was mostly but not fully supported with quantitative data and references AND/OR Writing was a little unclear (typos, minor issues) (16-19 points)
  • 4. Two of the following expected criteria were not clearly discussed: health consequences, major source, when standards were last reviewed, or global implications. AND/OR Choice was not well supported with quantitative data and references AND.OR Writing was unclear (frequent typos, grammatical errors) (14-15 points) The pollutant choice was not a pollutant regulated under the NAAQS AND/OR Three or more of the following expected criteria were not clearly discussed: health consequences, major source, when standards were last reviewed, or global implications. AND/OR Choice was not supported with quantitative data and references (0-13 points) Instructor comments: Score (20 possible points): --------------------------------------------------------------------------- ---------------------------------------------------------------
  • 5. Part 3: Identify which pollutants significantly contribute to these issues Although many pollutants get a bad reputation, certain types of gas emissions contribute more to specific environmental issues. Review section 4.1 in your text and the background information on each of the pollutants covered under the NAAQS. Choose from among the eight pollutants below and fill in the name of the correct pollutant in the grid below. chlorofluorocarbons particulate matter dioxins nitrogen dioxide carbon monoxide sulfur dioxide ozone carbon dioxide Pollutant Global warming Ozone layer depletion Acid deposition Score Response(5 points) yes no no Response(5 points) yes yes no Response(5 points)
  • 6. no no yes Instructor Comments: Total Score(15 possible points) Final Score: Part 1 Score (40 possible points) Part 2 Score (20 possible points) Part 3 Score (15 possible points) Total Score (75 possible points) Instructor comments (Timeliness): Timeliness Factor (late points deducted): assignment/.DS_Store __MACOSX/assignment/._.DS_Store assignment/assignment.docx The application will keep track of one student’s assignment grade information for any number courses, and each course can be anywhere from 1 to 16 weeks long. For each week of the course, the assignments are (1) threaded discussion score, (2) quiz score, (3) lab assignment score, and an exam. Not all the
  • 7. week’s will have each of the assignment score recorded, and the final week of the course will have a final exam score only. A student will be able to keep assignment scores for any number of courses, and each course will have the school name, the course number, the course title, and how many weeks there are in the course. For a selected course, the application will allow the user to enter the scores, and once the scores are entered for the week the application will calculate the weekly total and the weekly average, along with the course running total score, running average, and letter grade to date (based on course syllabus grade breakdown). The database will contain two tables (1) Courses and (2) Assignments, using the following table names and fields 1. Course a. Id b. School c. Number d. Title 2. Assignments a. Id b. CourseID c. WeekNumber d. TDA e. Lab f. Quiz g. Test The application will display a table that displays the following for each course that is recorded: 1. Course Number 2. Course Title 3. Course Grade While the application and database will be user name and password protected, it is outside the scope of this project to
  • 8. provide a complete, robust, and secure authentication component. So, for the purposes of this development, you will just store the user name and password comma separated value text file.Design Requirements The program design shall adhere to the following design requirements: 1. The program will be constructed using a 3-tier architecture (1) data, (2) business, and (3) presentation tier and each tier will only implement the operations appropriate for the tier. 2. The graphical user interface will be constructed using a tab panel interface, with each tab containing only those operations related to the tab heading. 3. The order of the tabs will be in logical sequence. 4. The graphical user interface will contain a main menu bar, and there shall be a menu for each tab that mirrors the operations on the tab. 5. Each menu item will have a logical name and short cut key assigned. 6. Each “active” control (i.e. radio button, command button...) shall have a tooltip describing the operation the control provides. 7. There shall be a logical, sequential tab order for the input controls on the form. 8. All class members, both variables and methods, shall by default be made private. 9. Access to any class/object data member shall only be done through getters and setters. 10. Methods shall only be made public if it is necessary for other objects to call the methods. 11. Private variables shall only be access through getters and setters. 12. All setters will have validation logic to ensure the private variable is always in a stable state. FUNCTIONAL REQUIREMENTS The program operations will adhere to the following
  • 9. requirements: 1. The maximum points of all the assignments is 1000 points. 2. Each input score item shall be validated against a lower and upper bound. 3. The lower and upper bounds of each of the assignments shall be stored in the database or a file. 4. The user must authenticate into the program when it starts. 5. The user name and password shall be stored in a file (which simulates an authentication component). 6. The running total, running average, and current grade shall only include scores that have been recorded. 7. The threaded discussion score shall be calculated by the user being able to select whether a student attended, or posted a note on a day of the week, for each of the 7 weeks. 8. If a student attends at least three days, the student will receive full credit for the weekly threaded discussion score. 9. The automatically assigned threaded discussion score, can be overridden to a lower, or higher score, but within the limits of the minimum and maximum scores. 10. The weekly total, weekly average, running total, and running average shall be updated any time one of the dependent fields is updated. 11. Database operations shall be secure and be written to minimize SQL injection or other transport type attacks. Analysis and Design You will create an analysis and design document that consists of: 1. Document the current “as is” structure of the program. 2. Create a class/Object Diagram (this can be done in any drawing tool, or even hand drawn and take a picture). Instead of you creating a program from scratch, I am giving a program shell with several TODO action items. You will also be asked to document the structure and class/object diagram given the project."
  • 10. Because of this, I assume that these diagrams (UML) as well as a completed TODO list (commented throughout the shell) will need to be completed. __MACOSX/assignment/._assignment.docx assignment/source code/.DS_Store __MACOSX/assignment/source code/._.DS_Store assignment/source code/src/.DS_Store __MACOSX/assignment/source code/src/._.DS_Store assignment/source code/src/business/.DS_Store __MACOSX/assignment/source code/src/business/._.DS_Store assignment/source code/src/business/Assignment.javaassignment/source code/src/business/Assignment.javapackage business; import helpers.*; publicclassAssignment{ privatestaticfinalString DEFAULT_TITLE ="Assignment"; privatestaticfinalint MIN_POINTS =0; privatestaticfinalint MAX_POINTS =1000; privateString title; privateint maxScore; privateint score; publicAssignment(){ setTitle(DEFAULT_TITLE);
  • 11. setMaxScore(maxScore); setScore(MIN_POINTS); } publicAssignment(String title,int maxScore){ setTitle(title); setMaxScore(maxScore); setScore(maxScore); } publicvoid setTitle(String title){ this.title =StringHelpers.setStringValue(title, DEFAULT_TITL E); } publicString getTitle(){ return title; } publicvoid setMaxScore(int maxScore){ this.maxScore =NumberHelpers.findRangeValue(maxScore, MI N_POINTS, MAX_POINTS); } publicint getMaxScore(){ return maxScore; } publicvoid setScore(int score){ this.score =NumberHelpers.findRangeValue(score, MIN_POINT S, maxScore); } publicint getScore(){ return score; } publicdouble getPercent(){ double percent =0; if(maxScore >0){ percent = score/maxScore; } return percent;
  • 12. } publicvoid clearScore(){ score = MIN_POINTS; } @Override publicString toString(){ // TODO: create an output create that displays the title, awarde d score //the maximum score, and the percentage ensuring all numbers //are properly formatted to no more than one decimal StringBuilder str =newStringBuilder(); return str.toString(); } } __MACOSX/assignment/source code/src/business/._Assignment.java assignment/source code/src/business/AssignmentList.javaassignment/source code/src/business/AssignmentList.java package business; import java.util.ArrayList; import data.AssignmentDB; publicclassAssignmentList{ privateArrayList<WeekAssignment> assignmentList; privatefinalAssignmentDB assignmentDB; privateint courseKey =-1;
  • 13. publicAssignmentList(int courseKey,Authentication authenticati on){ setCourseKey(courseKey); assignmentDB =newAssignmentDB(authentication); retrieveAssignmentList(); } publicArrayList<WeekAssignment> getAssignmentList(){ return assignmentList; } publicvoid setCourseKey(int courseKey){ this.courseKey = courseKey; } privatevoid retrieveAssignmentList(){ assignmentList = assignmentDB.getList(courseKey); } publicvoid setAttendance(int weekNumber,int dayNumber,boole an wasThere){ assignmentList.get(weekNumber- 1).setAttendance(dayNumber, wasThere); } publicint getCalculatedAttendance(int weekNumber){ return assignmentList.get(weekNumber- 1).getCalculatedAttendanceScore(); } publicvoid setTDAScore(int weekNumber,int score){ assignmentList.get(weekNumber-1).setTDAScore(score); } publicvoid setLabScore(int weekNumber,int score){ assignmentList.get(weekNumber-1).setLabScore(score); } publicvoid setQuizScore(int weekNumber,int score){ assignmentList.get(weekNumber-1).setQuizScore(score); } publicvoid setTestScore(int weekNumber,int score){
  • 14. assignmentList.get(weekNumber-1).setTestScore(score); } publicString getWeekAssignmentInformation(int weekNumber){ return assignmentList.get(weekNumber-1).toString(); } publicvoid clearScores(int weekNumber){ // TODO: for the given week assignment, clear the score in the assignment object. } } __MACOSX/assignment/source code/src/business/._AssignmentList.java assignment/source code/src/business/Authentication.javaassignment/source code/src/business/Authentication.javapackage business; import helpers.*; import data.AuthenticationIO; import java.io.Serializable; publicclassAuthenticationimplementsSerializable{ privateString userName =""; privateString password =""; privateAuthenticationIO authIO; publicAuthentication(){} publicAuthentication(String userName,String password){ setUserName(userName); setPassword(password);
  • 15. } publicvoid setUserName(String userName){ this.userName =StringHelpers.setStringValue(userName,""); } publicString getUserName(){ return userName; } publicvoid setPassword(String passWord){ this.password =StringHelpers.setStringValue(passWord,""); } publicString getPassword(){ return password; } publicboolean authenticate(){ boolean success =false; authIO =newAuthenticationIO(); Authentication stored = authIO.getAuthentication(); if(stored ==null){ success = authIO.createAuthenticationFile(this); OutputHelpers.showStandardDialog("New User: "+ userName + " created","Create new user"); } else{ if(userName.compareToIgnoreCase(stored.getUserName())==0) { success =true; } else{ OutputHelpers.showStandardDialog("Invalid user name-- please update user name and try again","Invalid User Name"); } if(success){
  • 16. // TODO: write the algorithm to compare the provided passwor d with the //stored password, keeping in mind that character case matters. } } return success; } } __MACOSX/assignment/source code/src/business/._Authentication.java assignment/source code/src/business/ClassAssignments.javaassignment/source code/src/business/ClassAssignments.java package business; import helpers.*; import java.util.ArrayList; publicclassClassAssignments{ privatestaticfinaldouble MAX_PERCENT =1; privatestaticfinaldouble LOW_A =.90; privatestaticfinaldouble LOW_B =.80; privatestaticfinaldouble LOW_C =.70; privatestaticfinaldouble LOW_D =.60; privatestaticfinalint FINAL_EXAM_POINTS =210; publicstaticfinalint MIN_SCORE =0; privatefinalCourse course; privateAssignmentList assignmentList;
  • 17. privateint totalScore =0; privateint totalPoints =0; privateint key =-1; privateint courseKey =-1; privatefinalAuthentication authentication; publicClassAssignments(Course course,Authentication authentic ation){ this.course = course; this.authentication = authentication; initializeAssignmentList(); } publicvoid setKey(int key){ this.key = key; } publicint getKey(){ return key; } publicint getCourseKey(){ return courseKey; } publicvoid setCourseKey(int courseKey){ this.courseKey = courseKey; } privatevoid initializeAssignmentList(){ assignmentList =newAssignmentList(course.getKey(), auth entication); } publicint getNumberWeeks(){ return course.getNumberWeeks(); } /***************** bounds ****************************
  • 18. ***/ publicint getMinScore(){ return MIN_SCORE; } publicint getMAXTDAScore(){ returnWeekAssignment.TDA_POINTS; } publicint getMAXLabScore(){ returnWeekAssignment.LAB_POINTS; } publicint getMaxQuizScore(){ returnWeekAssignment.QUIZ_POINTS; } publicint getMaxTestScore(){ //TODO: write the code to return the maximum vaue of a test sc ore return0; } /************* school information ********************** */ publicvoid setSchool(String school){ course.setSchool(school); } publicvoid setCourseTitle(String title){ course.setTitle(title); } publicvoid setCourseNumber(String courseNumber){ course.setNumber(courseNumber); } /******************** weekly assignment information ***** *******************/ publicvoid setAttendance(int weekNumber,int dayNumber,boole
  • 19. an wasThere){ assignmentList.setAttendance(weekNumber, dayNumber, wasThere); } publicint getCalculatedAttendance(int weekNumber){ return assignmentList.getCalculatedAttendance(weekNumber); } publicvoid setTDAScore(int weekNumber,int score){ assignmentList.setTDAScore(weekNumber, score); } publicvoid setLabScore(int weekNumber,int score){ assignmentList.setLabScore(weekNumber, score); } publicvoid setQuizScore(int weekNumber,int score){ //TODO: write the code to set the quiz score for the given week } publicvoid setTestScore(int weekNumber,int score){ assignmentList.setTestScore(weekNumber, score); } /*************** running totals ************************ ***********/ privatevoid getRunningTotals(){ totalScore =0; totalPoints =0; for(WeekAssignment week:assignmentList.getAssignmentList()) { if(week.IncludeInTotal()){ totalScore += week.getTotalScore(); totalPoints += week.getMaxPoints(); } } } publicint getTotalScore(){ getRunningTotals(); return totalScore;
  • 20. } publicdouble getPercent(){ double percent =0; getRunningTotals(); if(totalPoints >0){ percent =(double) totalScore /(double) totalPoints; } return percent; } publicString getGrade(){ String grade ="U"; double percent = getPercent(); // TODO: write the algorithm to determine the grade return grade; } publicString getWeekAssignmentInformation(int weekNumber){ return assignmentList.getWeekAssignmentInformation(weekNu mber); } publicvoid clearScores(int weekNumber){ assignmentList.clearScores(weekNumber); } @Override publicString toString(){ StringBuilder str =newStringBuilder(); str.append(course.toString()); str.append("n"); for(WeekAssignment week:assignmentList.getAssignmentList()) { str.append("n"); str.append(week.toString()); } str.append("n");
  • 21. return str.toString(); } } __MACOSX/assignment/source code/src/business/._ClassAssignments.java assignment/source code/src/business/Course.javaassignment/source code/src/business/Course.java package business; import helpers.*; publicclassCourse{ privatestaticfinalString DEFAULT_SCHOOL ="Devry Universit y"; privatestaticfinalString DEFAULT_NUMBER ="CIS355A"; privatestaticfinalString DEFAULT_TITLE ="Business Applicati on Programming"; privatestaticfinalint DEFAULT_NUMBER_WEEKS =8; privatestaticfinalint MIN_NUMBER_WEEKS =1; privatestaticfinalint MAX_WEEKS =16; privateString school; privateString number; privateString title; privateint numberWeeks; privateint key =-1; publicCourse(){ this.school = DEFAULT_SCHOOL;
  • 22. this.number = DEFAULT_NUMBER; this.title = DEFAULT_TITLE; this.numberWeeks = DEFAULT_NUMBER_WEEKS; } publicCourse(int key){ this(); setKey(key); } publicCourse(int key,String school,String number,String title,in t numberWeeks){ setKey(key); setSchool(school); setNumber(number); setTitle(title); setNumberWeeks(numberWeeks); } publicint getKey(){ return key; } publicvoid setKey(int key){ this.key = key; } publicvoid setSchool(String school){ this.school =StringHelpers.setStringValue(school, DEFAULT_S CHOOL); } publicString getSchool(){ return school; } publicString getNumber(){ return number; } publicString getTitle(){ return title; } publicvoid setNumber(String number){
  • 23. this.number =StringHelpers.setStringValue(number, DEFAULT _NUMBER); } publicvoid setTitle(String title){ this.title =StringHelpers.setStringValue(title, DEFAULT_TITL E); } publicvoid setNumberWeeks(int numWeeks){ //TODO: write the code to set the number of weeks betwee 1 an d maximum number of weeks allowed } publicint getNumberWeeks(){ return numberWeeks; } @Override publicString toString(){ return getNumber()+": "+ getTitle(); } } __MACOSX/assignment/source code/src/business/._Course.java assignment/source code/src/business/CourseList.javaassignment/source code/src/business/CourseList.java package business; import java.util.ArrayList; import javax.swing.DefaultListModel; import data.CourseDB; import helpers.*; import java.util.Vector; publicclassCourseList{
  • 24. privateArrayList<Course> courseList; privatefinalCourseDB courseDB; privateArrayList<CourseSummary> summaryList; privateAuthentication authentication; publicCourseList(Authentication authentication){ courseList =newArrayList<>(); courseDB =newCourseDB(authentication); retrieveCourseList(); } privatevoid retrieveCourseList(){ courseList.clear(); courseList = courseDB.getList(); retreivedSummaryList(); } publicint displayCourseList(DefaultListModel<Course> listMod el){ int numRecords =0; if(courseList ==null){ retrieveCourseList(); } if(courseList.size()>0){ numRecords = courseList.size(); for(Course course:courseList){ listModel.addElement(course); } } return numRecords; } privatevoid retreivedSummaryList(){ summaryList =newArrayList<>(); CourseSummary aSummary; ClassAssignments assignment; for(Course course:courseList){
  • 25. aSummary =newCourseSummary(); aSummary.setNumber(course.getNumber()); aSummary.setTitle(course.getTitle()); assignment =newClassAssignments(course, authenticati on); aSummary.setGrade(assignment.getGrade()); summaryList.add(aSummary); } } publicArrayList<CourseSummary> summaryList(){ return summaryList; } publicVector<String> getColumnNames(){ Vector<String> columnNames =newVector<>(); // TODO: write the code to set the columns names to logical, us er friendly names return columnNames; } } __MACOSX/assignment/source code/src/business/._CourseList.java assignment/source code/src/business/CourseSummary.javaassignment/source code/src/business/CourseSummary.javapackage business; import helpers.StringHelpers; publicclassCourseSummary{ privateString number ="";
  • 26. privateString title =""; privateString grade =""; // TODO: add code to validate all the input values to ensure the y are not empty publicCourseSummary(){ } publicCourseSummary(String number,String title,String grade){ setNumber(number); setTitle(title); setGrade(grade); } publicString getNumber(){ return number; } // TODO: for all the setters, write the code to ensure the strings are not empty publicvoid setNumber(String courseNumber){ this.number =StringHelpers.setStringValue(courseNumber,"CN" ); } publicString getTitle(){ return title; } publicvoid setTitle(String courseTitle){ // TODO: for all the setters, write the code to ensure the strings are not empty } publicString getGrade(){ return grade; } publicvoid setGrade(String grade){ // TODO: for all the setters, write the code to ensure the strings are not empty
  • 27. } } __MACOSX/assignment/source code/src/business/._CourseSummary.java assignment/source code/src/business/Student.javaassignment/source code/src/business/Student.javapackage business; import helpers.*; publicclassStudent{ privatestaticfinalString DEFAULT_NAME ="Not Given"; String firstName; String lastName; String email; publicStudent() { this.firstName = DEFAULT_NAME; this.lastName = DEFAULT_NAME; this.email = DEFAULT_NAME; } publicStudent(String firstName,String lastName){ setFirstName(firstName); setLastName(lastName); } publicString getFirstName(){ return firstName; } publicfinalvoid setFirstName(String firstName){
  • 28. this.firstName =StringHelpers.setStringValue(firstName, DEFA ULT_NAME); } publicString getLastName(){ return lastName; } publicfinalvoid setLastName(String lastName){ this.lastName =StringHelpers.setStringValue(lastName, DEFAU LT_NAME); } publicvoid setEmail(String email){ if(StringHelpers.validateEmail(email)){ this.email = email; } else{ this.email = DEFAULT_NAME; } } publicString getEmail(){ String str =""; if(isValidEmail()){ str =this.email; } return str; } publicboolean isValidEmail(){ returnStringHelpers.validateEmail(this.email); } publicString getFullName(){ return firstName +" "+ lastName; } @Override publicString toString(){ StringBuilder str =newStringBuilder();
  • 29. str.append(getFullName()); return str.toString(); } } __MACOSX/assignment/source code/src/business/._Student.java assignment/source code/src/business/WeekAssignment.javaassignment/source code/src/business/WeekAssignment.java package business; import helpers.*; publicclassWeekAssignment{ publicstaticfinalint TDA_POINTS =20; publicstaticfinalint LAB_POINTS =55; publicstaticfinalint QUIZ_POINTS =30; publicstaticfinalint TEST_POINTS =210; publicstaticfinalint MIN_DAYS_PARTICIPATION =3; privatestaticfinalint MIN_WEEK =1; privatestaticfinalint MAX_WEEK =8; privateint key =-1; privateint classKey =-1; privateint weekNumber; privatefinalWeekAttendance attendance =newWeekAttendance( TDA_POINTS, MIN_DAYS_PARTICIPATION); privatefinalAssignment tda =newAssignment("Threaded Discuss ion", TDA_POINTS); privatefinalAssignment lab =newAssignment("Programming Lab
  • 30. ", LAB_POINTS); privatefinalAssignment quiz =newAssignment("Quiz", QUIZ_P OINTS); privatefinalAssignment test =newAssignment("Test", TEST_PO INTS); privateboolean includeInTotal =false; publicWeekAssignment(){ weekNumber = MIN_WEEK; } publicWeekAssignment(int classKey,int weekNumber){ setWeekNumber(weekNumber); setClassKey(classKey); } publicint getClassKey(){ return classKey; } publicvoid setClassKey(int classKey){ this.classKey = classKey; } publicint getKey(){ return key; } publicvoid setKey(int key){ this.key = key; } publicvoid setWeekNumber(int weekNumber){ this.weekNumber =NumberHelpers.findRangeValue(weekNumb er, MIN_WEEK, MAX_WEEK); } publicvoid clearScores(){
  • 31. // TODO: write the code to clear all the assignment scores as w ell as the attendance attributes } publicvoid setAttendance(int day,boolean wasThere){ attendance.setAttendance(day, wasThere); setTDAScore(attendance.getScore()); includeInTotal =true; } publicint getCalculatedAttendanceScore(){ return attendance.getScore(); } publicvoid setTDAScore(int score){ tda.setScore(score); includeInTotal =true; } publicvoid setLabScore(int score){ lab.setScore(score); includeInTotal =true; } publicvoid setQuizScore(int score){ // TODO: write the code to set the quiz score and ensure it is in cluded in the total } publicvoid setTestScore(int score){ test.setScore(score); includeInTotal =true; } publicint getTotalScore(){ int total =0; total = tda.getScore(); // TODO: complete the summing of all the assignment scores for the week return total; }
  • 32. publicbooleanIncludeInTotal(){ return includeInTotal; } publicint getMaxPoints(){ return TDA_POINTS + LAB_POINTS + QUIZ_POINTS + TEST _POINTS ; } publicdouble getPercent(){ double percent =0; if(getMaxPoints()>0){ percent =(double)getTotalScore()/(double)getMaxPoints (); } return percent; } publicString weekAssignmentDetails(){ StringBuilder str =newStringBuilder(); str.append("Assignment Week: "); str.append(weekNumber); str.append("Total: "); str.append(getTotalScore()); str.append("/"); str.append(getMaxPoints()); str.append(" = "); str.append(OutputHelpers.formattedPercent(getPercent(),0 )); str.append("n"); str.append(tda.toString()); str.append("n"); str.append(quiz.toString()); str.append("n"); str.append(lab.toString()); str.append("n"); str.append(test.toString()); return str.toString();
  • 33. } @Override publicString toString(){ StringBuilder str =newStringBuilder(); str.append("Week: "); str.append(weekNumber); str.append(" Total: "); str.append(getTotalScore()); str.append("/"); str.append(getMaxPoints()); str.append(" = "); str.append(OutputHelpers.formattedPercent(getPercent(),0 )); return str.toString(); } } __MACOSX/assignment/source code/src/business/._WeekAssignment.java assignment/source code/src/business/WeekAttendance.javaassignment/source code/src/business/WeekAttendance.java package business; import helpers.NumberHelpers; publicclassWeekAttendance{ privatestaticfinalint MIN_DAYS =3; privatestaticfinalint FIRST_DAY =1; privatestaticfinalint LAST_DAY =7; privatestaticfinalint FIRST_WEEK =1; privatestaticfinalint LAST_WEEK =7;
  • 34. privatestaticfinalint MIN_POINTS =0; privatestaticfinalint MAX_POINTS =100; privatestaticfinalint MIN_NUM_DAYS =0; privatestaticfinalint MAX_NUM_DAYS =3; privateint score =0; privateboolean[] attended =newboolean[7]; privateint maxScore =0; privateint minDays = MIN_DAYS; privateint pointsPerDay; publicWeekAttendance(){ initializeAttendance(); } publicWeekAttendance(int maxScore,int minDays){ this(); setMaxScore(maxScore); setMinDays(minDays); } publicvoid clearAttendance(){ initializeAttendance(); } publicvoid setMinDays(int minDays){ this.minDays =NumberHelpers.findRangeValue(minDays, MIN_ NUM_DAYS, MAX_NUM_DAYS); } publicvoid setMaxScore(int maxScore){ this.maxScore =NumberHelpers.findRangeValue(maxScore, MI N_POINTS, MAX_POINTS ); } publicint getMaxScore(){ return maxScore; } privatevoid initializeAttendance(){ for(int i =0; i < attended.length; i++){ attended[i]=false;
  • 35. } } publicvoid setAttendance(int day,boolean wasThere){ if(day >= FIRST_DAY && day <= LAST_DAY){ attended[day -1]= wasThere; } } publicint getNumberDaysAttended(){ int count =0; //TODO: write the code to count how many days of attendance for the week return count; } publicint getScore(){ int count =0; if(minDays >0){ pointsPerDay = maxScore/minDays; } for(int i =0; i < attended.length; i++){ if(attended[i]){ count++; } } if(count >= minDays){ score = maxScore; } else{ score = count * pointsPerDay; } return score; } @Override publicString toString(){ StringBuilder str =newStringBuilder();
  • 36. str.append("n#Days attendended: "); str.append(getNumberDaysAttended()); str.append("nScore: "); str.append(getScore()); return str.toString(); } } __MACOSX/assignment/source code/src/business/._WeekAttendance.java __MACOSX/assignment/source code/src/._business assignment/source code/src/data/.DS_Store __MACOSX/assignment/source code/src/data/._.DS_Store assignment/source code/src/data/AssignmentDB.javaassignment/source code/src/data/AssignmentDB.javapackage data; import business.Authentication; import helpers.*; import business.WeekAssignment; import java.util.ArrayList; publicclassAssignmentDBextendsDataBaseParent{ publicAssignmentDB(){ super(); } publicAssignmentDB(Authentication authentication){ super("Assignment", authentication);
  • 37. } //TODO: write the code to save the weekly assignment publicboolean save(WeekAssignment aAssignment){ boolean success =true; OutputHelpers.showStandardDialog(aAssignment.toString()+" s aved","Save Week Assignment"); return success; } //TODO: write the code to delete the weekly assignment publicboolean delete(WeekAssignment aAssignment){ boolean success =true; OutputHelpers.showStandardDialog(aAssignment.toString()+" d eleted","Delete Week Assignment"); return success; } //TODO: write the code to update the weekly assignment publicboolean update(WeekAssignment aAssignment){ boolean success =true; OutputHelpers.showStandardDialog(aAssignment.toString()+" u pdated","Update Week Assignment"); return success; } // TODO: write the code to pull all the weekly assignments for a course from the database publicArrayList<WeekAssignment> getList(int courseKey){ ArrayList<WeekAssignment> assignmentList =newArrayList<>( ); for(int i =1; i <=8; i++){
  • 38. assignmentList.add(newWeekAssignment(courseKey, i) ); } return assignmentList; } //TODO: write the code to delete all assignments from the datab ase //ensuring that the user is prompted to verify that they want to d elete all the //course assignment information publicboolean deleteAll(){ boolean success =true; OutputHelpers.showStandardDialog("All assignments deleted"," Delete All Assignments"); return success; } } __MACOSX/assignment/source code/src/data/._AssignmentDB.java assignment/source code/src/data/AuthenticationIO.javaassignment/source code/src/data/AuthenticationIO.javapackage data; import business.Authentication; import helpers.FileHelpers; import helpers.OutputHelpers; import helpers.StringHelpers; import java.io.EOFException; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream;
  • 39. import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.ArrayList; publicclassAuthenticationIO{ publicstaticfinalString DEFAULT_FILE_NAME ="studentcred. dat"; privateString fileName; privatestaticfinalString DELIMTER =","; publicAuthenticationIO(){ setFileName(fileName); } publicfinalvoid setFileName(String fileName){ if(StringHelpers.IsNullOrEmpty(fileName)){ fileName = DEFAULT_FILE_NAME; } else{ this.fileName = fileName; } } publicAuthentication getAuthentication(){ Authentication storedAuth =null; ArrayList<String> recordList; String[] fields; if(StringHelpers.IsNullOrEmpty(fileName)){ fileName = DEFAULT_FILE_NAME; } recordList =FileHelpers.readList(fileName); if(recordList !=null&&!recordList.isEmpty()){ fields = recordList.get(0).split(DELIMTER); if(fields.length ==2){ storedAuth =newAuthentication(fields[0], fields[1]); }
  • 40. } return storedAuth; } publicboolean createAuthenticationFile(Authentication newAuth ){ boolean success =false; StringBuilder str =newStringBuilder(); //TODO: write the code to create a comma delimited username, password pair and write //the record to the file return success; } } __MACOSX/assignment/source code/src/data/._AuthenticationIO.java assignment/source code/src/data/CourseDB.javaassignment/source code/src/data/CourseDB.javapackage data; import helpers.*; import business.Course; import business.Authentication; import java.util.ArrayList; publicclassCourseDBextendsDataBaseParent{ publicCourseDB(){ super(); } publicCourseDB(Authentication authentication){ super("Course", authentication); } //TODO: write the code to save the course information to the d
  • 41. atabase publicboolean save(Course aCourse){ boolean success =true; OutputHelpers.showStandardDialog(aCourse.toString()+" saved ","Save Course"); return success; } //TODO: write the code to delete the course information from th e database publicboolean delete(Course aCourse){ boolean success =true; OutputHelpers.showStandardDialog(aCourse.toString()+" delete d","Delete Course"); return success; } //TODO: write the code to update the course information from t he database publicboolean update(Course aCourse){ boolean success =true; OutputHelpers.showStandardDialog(aCourse.toString()+" updat ed","Update Course"); return success; } //TODO: write the code to get the course list from the datbase publicArrayList<Course> getList(){ ArrayList<Course> courseList =newArrayList<>(); courseList.add(newCourse(-1)); courseList.add(newCourse(-1, "DeVry University",
  • 42. "CIS247A", "Object Oriented Programming with C#", 8)); courseList.add(newCourse(-1, "DeVry University", "CIS170a", "Structured Programming with C#", 16)); courseList.add(newCourse(-1, "DeVry University", "CIS363A", "Web Interface Design", 10)); return courseList; } //TODO: write the code to delete all courses from the database //ensuring that the user is prompted to verify that they want to d elete all the //course assignment information //keeping in mind that this will also delete all assignments for t he course as well publicboolean deleteAll(){ boolean success =true; OutputHelpers.showStandardDialog("All courses deleted","Dele te all Assignments"); return success; } } __MACOSX/assignment/source code/src/data/._CourseDB.java
  • 43. assignment/source code/src/data/DataBaseParent.javaassignment/source code/src/data/DataBaseParent.javapackage data; import helpers.*; import business.Authentication; import java.util.ArrayList; publicabstractclassDataBaseParent{ //TODO: set the connection string to point to your MySql serve r and database privatefinalString CONNECTION_STRING ="jdbc:mysql://devr y.edupe.net:4300/CIS355A_1011"; protectedString table; protectedAuthentication authentication; privateConnectionHelper connHelper; publicDataBaseParent(){ connHelper =newConnectionHelper(); } publicDataBaseParent(String table,Authentication authenticatio n){ this(); setTableName(table); this.authentication = authentication; setConnection(); } protectedvoid setConnection(){ if(authentication.authenticate()){ connHelper.setConnection(CONNECTION_STRING, a uthentication.getUserName(), authentication.getPassword()); } else{
  • 44. OutputHelpers.showExceptionDialog("Database credentials inva lid","Invalid Database Credentials"); } } publicvoid setTableName(String table){ this.table =StringHelpers.setStringValue(table,""); } } __MACOSX/assignment/source code/src/data/._DataBaseParent.java __MACOSX/assignment/source code/src/._data assignment/source code/src/presentation/pnlAssignments.form __MACOSX/assignment/source code/src/presentation/._pnlAssignments.form assignment/source code/src/presentation/pnlAssignments.javaassignment/source code/src/presentation/pnlAssignments.java package presentation; import business.Authentication; import helpers.GUIUtilities; import helpers.InputHelpers; import helpers.OutputHelpers; import business.Course; /** * * @author Tevis
  • 45. */ publicclass pnlAssignments extends javax.swing.JPanel{ privateScores_Main mainForm; privateint week; privateCourse course; privateAuthentication authentication; public pnlAssignments(){ initComponents(); } public pnlAssignments(Scores_Main mainForm,Course course,i nt week){ this(); this.mainForm = mainForm; this.week = week; this.course = course; setWeekInformation(); } publicint getWeek(){ return week; } privatevoid setWeekInformation(){ String title ="Enter Week "+ week +" Scores for "+ course.getN umber(); lblDirections.setText(title); txtTDAScore.setText(OutputHelpers.formattedInteger(mai nForm.getTDAMaxScore())); lblTDAMax.setText("/"+ mainForm.getTDAMaxScore()); txtQuizScore.setText(OutputHelpers.formattedInteger(mai nForm.getMaxQuizScore())); lblQuizMax.setText("/"+ mainForm.getMaxQuizScore()); txtLabScore.setText(OutputHelpers.formattedInteger(main
  • 46. Form.getMaxLabScore())); lblLabMax.setText("/"+ mainForm.getMaxLabScore()); txtTestScore.setText(""); lblTestMax.setText("/"+ mainForm.getMaxTestScore()); } privatevoid setAttendance(int dayNum,boolean wasThere){ mainForm.setAttendance(week, dayNum, wasThere); txtTDAScore.setText(OutputHelpers.formattedInteger(mai nForm.getCalculatedAttendance(week))); } publicvoid saveAssignmentInformation(){ //TODO: call back to the main form and save the current week's assignment information OutputHelpers.showStandardDialog(mainForm.getWeekAssign mentDetails(week),"Week Information Saved"); } publicvoid clearAssignmentInformation(){ GUIUtilities.clearInputFields(pnlTDA); GUIUtilities.clearInputFields(pnlQuiz); // TODO: clear the input fields in the lab panel mainForm.clearScores(week); } /** * This method is called from within the constructor to initial ize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor- fold defaultstate="collapsed" desc="Generated Code">//GEN-
  • 47. BEGIN:initComponents privatevoid initComponents(){ lblDirections =new javax.swing.JLabel(); pnlTDA =new javax.swing.JPanel(); chkDay1 =new javax.swing.JCheckBox(); chkDay2 =new javax.swing.JCheckBox(); chkDay3 =new javax.swing.JCheckBox(); chkDay4 =new javax.swing.JCheckBox(); chkDay5 =new javax.swing.JCheckBox(); chkDay6 =new javax.swing.JCheckBox(); chkDay7 =new javax.swing.JCheckBox(); jLabel1 =new javax.swing.JLabel(); txtTDAScore =new javax.swing.JTextField(); lblTDAMax =new javax.swing.JLabel(); pnlQuiz =new javax.swing.JPanel(); txtQuizScore =new javax.swing.JTextField(); jLabel2 =new javax.swing.JLabel(); lblQuizMax =new javax.swing.JLabel(); pnlLab =new javax.swing.JPanel(); txtLabScore =new javax.swing.JTextField(); jLabel3 =new javax.swing.JLabel(); lblLabMax =new javax.swing.JLabel(); btnSave =new javax.swing.JButton(); btnClear =new javax.swing.JButton(); pnlTest =new javax.swing.JPanel(); txtTestScore =new javax.swing.JTextField(); jLabel4 =new javax.swing.JLabel(); lblTestMax =new javax.swing.JLabel(); setBorder(javax.swing.BorderFactory.createLineBorder(ne w java.awt.Color(0,0,0))); lblDirections.setFont(new java.awt.Font("Tahoma",2,12)); // NOI18N lblDirections.setForeground(new java.awt.Color(0,0,80));
  • 48. lblDirections.setText("Enter the attendance and assignmen t information"); lblDirections.setToolTipText(""); pnlTDA.setBorder(javax.swing.BorderFactory.createTitled Border(null,"Daily Attendance/Participation", javax.swing.bord er.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.bord er.TitledBorder.DEFAULT_POSITION,new java.awt.Font("Tah oma",1,11),new java.awt.Color(0,0,80)));// NOI18N chkDay1.setText("Sunday"); chkDay1.addItemListener(new java.awt.event.ItemListener (){ publicvoid itemStateChanged(java.awt.event.ItemEvent evt){ chkDay1ItemStateChanged(evt); } }); chkDay2.setText("Monday"); chkDay2.addItemListener(new java.awt.event.ItemListener (){ publicvoid itemStateChanged(java.awt.event.ItemEvent evt){ chkDay2ItemStateChanged(evt); } }); chkDay3.setText("Tuesday"); chkDay3.setToolTipText(""); chkDay3.addItemListener(new java.awt.event.ItemListener (){ publicvoid itemStateChanged(java.awt.event.ItemEvent evt){ chkDay3ItemStateChanged(evt); } }); chkDay4.setText("Wednesday");
  • 49. chkDay4.addItemListener(new java.awt.event.ItemListener (){ publicvoid itemStateChanged(java.awt.event.ItemEvent evt){ chkDay4ItemStateChanged(evt); } }); chkDay5.setText("Thursday"); chkDay5.addItemListener(new java.awt.event.ItemListener (){ publicvoid itemStateChanged(java.awt.event.ItemEvent evt){ chkDay5ItemStateChanged(evt); } }); chkDay6.setText("Friday"); chkDay6.addItemListener(new java.awt.event.ItemListener (){ publicvoid itemStateChanged(java.awt.event.ItemEvent evt){ chkDay6ItemStateChanged(evt); } }); chkDay7.setText("Saturday"); chkDay7.addItemListener(new java.awt.event.ItemListener (){ publicvoid itemStateChanged(java.awt.event.ItemEvent evt){ chkDay7ItemStateChanged(evt); } }); jLabel1.setForeground(new java.awt.Color(0,0,80)); jLabel1.setText("Score"); txtTDAScore.setToolTipText("Enter the score for the parti cipation/attendance");
  • 50. txtTDAScore.addFocusListener(new java.awt.event.Focus Adapter(){ publicvoid focusLost(java.awt.event.FocusEvent evt){ txtTDAScoreFocusLost(evt); } }); lblTDAMax.setForeground(new java.awt.Color(0,0,80)); lblTDAMax.setText("/30"); javax.swing.GroupLayout pnlTDALayout =new javax.swin g.GroupLayout(pnlTDA); pnlTDA.setLayout(pnlTDALayout); pnlTDALayout.setHorizontalGroup( pnlTDALayout.createParallelGroup(javax.swing.Group Layout.Alignment.LEADING) .addGroup(pnlTDALayout.createSequentialGroup() .addContainerGap() .addGroup(pnlTDALayout.createParallelGroup(javax.swing.Gro upLayout.Alignment.LEADING) .addGroup(pnlTDALayout.createSequentialGroup() .addComponent(chkDay1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.UNRELATED) .addComponent(chkDay2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.UNRELATED) .addComponent(chkDay3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.UNRELATED) .addComponent(chkDay4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.UNRELATED) .addComponent(chkDay5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.UNRELATED)
  • 51. .addComponent(chkDay6) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.UNRELATED) .addComponent(chkDay7)) .addGroup(pnlTDALayout.createSequentialGroup() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.UNRELATED) .addComponent(txtTDAScore, javax.swing.GroupLayout.PREFE RRED_SIZE,50, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen t.RELATED) .addComponent(lblTDAMax))) .addContainerGap(16,Short.MAX_VALUE)) ); pnlTDALayout.setVerticalGroup( pnlTDALayout.createParallelGroup(javax.swing.Group Layout.Alignment.LEADING) .addGroup(pnlTDALayout.createSequentialGroup() .addContainerGap() .addGroup(pnlTDALayout.createParallelGroup(javax.swing.Gro upLayout.Alignment.BASELINE) .addComponent(chkDay1) .addComponent(chkDay2) .addComponent(chkDay3) .addComponent(chkDay4) .addComponent(chkDay5) .addComponent(chkDay6) .addComponent(chkDay7)) .addGap(11,11,11) .addGroup(pnlTDALayout.createParallelGroup(javax.swing.Gro upLayout.Alignment.LEADING) .addComponent(jLabel1) .addGroup(pnlTDALayout.createParallelGroup(javax.swing.Gro upLayout.Alignment.BASELINE)