A Real Final Exam: Computer Science

Well, since entering K-12 education in the 2004/2005 school year, I have now written and administered my first “real” semester exams!

While I have always given exams at the conclusion of the semesters, I have never really given a genuine exam “experience”. There would be a test. That test usually consisted of 50 questions. 25 of the questions were True/False and 25 were Multiple Choice. The students were given a single sentence review guide of “Always Be True to Yourself”.

Now, with that as the review guide, I think you could safely guess that the answers were “B” and “True”. Your guess would be correct. Sadly, I did have students fail that test.

The test was not a “give-me grade” since there was usually a major end-of-year project that the majority of their semester grade was based upon. This final was created so we could simply check a box that said we gave a paper final.

This year, I opted to write and administer a genuine rigorous exam as I was not using any major end-of-year projects.

Computer Science (EOY) Final Exam – Test

Computer Science (EOY) Final Exam – Answer Key

As you can see, this is a bit more rigorous of a test. In fact, all of the questions require a calculated answer.

Once the tests are completed, I will analyze student performance in another post.

Spring Exam Exemptions

It is that time of the year again. It’s time for spring semester exams and ’tis exemption season! This is the season when students start seeking if they qualify to be exempt from having to take the semester exam in a given class.

Each school I have had the opportunity to work at does this process differently and each school has used different criteria to determine eligibility for exemptions.

Exemptions (Spring 2017 Finals)
Exemptions (Spring 2017 Finals)

Here, you can see that I have a total of 146 students. There are 88 students enrolled in Business Information Management (BIM) across 4 sections. There are 15 students in my single section of Computer Science I. There are 25 students in my single section of Principles of Technology. There are 18 students in my single section of Robotics & Automation.

As you can see in the chart, 51 of the 88 BIM students are eligible to be exempt from their spring semester exam. This means that 57.9% of my BIM students are eligible to be exempt from their exam!

In Computer Science, that percentage rises to 66.7% are exempt and in Robotics and Automation is continued to climb us to 72.2%!

Unfortunately, in my Principles of Technology, the percentage plummets to 48%. This has been due to poor grade performance because many teams elected to not submit required documentation with their projects throughout the semester.

As Computer Science, Robotics & Automation, and Principles of Technology are stand-alone single-section courses, let’s take a quick look at how each of the BIM sections performed individually.

BIM Exemptions (Spring 2017 Finals)
BIM Exemptions (Spring 2017 Finals)

Here is the break-out of the 4 sections of BIM that I teach.

While the average for all 4 sections of BIM was 57.9%, 1 section performed well above that average, 1 section section performed well below that average, and the other 2 held pretty close to that average.

  • 2(B) has 10 of 23 students qualifying for exemptions, which is 43.4%.
  • 3(B) has 14 of 23 students qualifying for exemptions, which is 60.8%.
  • 4(B) has 14 of 19 students qualifying for exemptions, which is 73.6%.
  • 4(A) has 13 of 23 students qualifying for exemptions, which is 56.5%.

Compared to past years, this is close to what I have experienced as far as exam exemption qualification is concerned.

Flipping Stacks

We are now going to look at how to flip a stack. As was discussed previously, a stack is an ideal method for holding items in a queue such as an incoming call center.

Let’s say the following calls come into a call center. They are time-stamped for reference.

Call 5 – (469)382-1285 – 2017-02-13 / 08:02:57
Call 4 – (682)552-3948 – 2017-02-13 / 08:02:45
Call 3 – (214)233-0495 – 2017-02-13 / 08:01:55
Call 2 – (817)927-3849 – 2017-02-13 / 08:01:22
Call 1 – (972)828-1847 – 2017-02-13 / 08:01:13

In this case, the call that has been placed on hold the longest is “Call 1”, which came in at 8:01:13. However, recall that in a stack I can only interact with the item on the TOP of the stack. In this case, that is “Call 5”.

So, we are going to create a system that “flips” this stack over, pulls the new top item off and then returns to stack to its original order so additional calls can go in the place they should.

So, assuming that we have a stack already created for the numbers, we will need to create an empty temporary stack to hold the items. As we move the items over, the temporary stack will look like the following:

Call 1 – (972)828-1847 – 2017-02-13 / 08:01:13
Call 2 – (817)927-3849 – 2017-02-13 / 08:01:22
Call 3 – (214)233-0495 – 2017-02-13 / 08:01:55
Call 4 – (682)552-3948 – 2017-02-13 / 08:02:45
Call 5 – (469)382-1285 – 2017-02-13 / 08:02:57

As you can now see, “Call 1” is at the top of the stack and could be routed to the next available individual. However, if another new call were to come in, the stack would look like the following:

Call 6 – (512)231-1933 – 2017-02-13 / 08:03:19
Call 2 – (817)927-3849 – 2017-02-13 / 08:01:22
Call 3 – (214)233-0495 – 2017-02-13 / 08:01:55
Call 4 – (682)552-3948 – 2017-02-13 / 08:02:45
Call 5 – (469)382-1285 – 2017-02-13 / 08:02:57

To avoid our call queue getting mixed-up, immediately following the retrieval of the top item on the stack, we need to move the items from the temporary stack back to the original stack as follows:

Call 5 – (469)382-1285 – 2017-02-13 / 08:02:57
Call 4 – (682)552-3948 – 2017-02-13 / 08:02:45
Call 3 – (214)233-0495 – 2017-02-13 / 08:01:55
Call 2 – (817)927-3849 – 2017-02-13 / 08:01:22

Now, when “Call 6” comes in, it will go where it is supposed to go (following “Call 5”).

Let’s analyze the code for this problem.

//Program Name: Flipped Stacks
//Programmer Name: Eric Evans, M.Ed.
//Programmer Organization: Ferris High School
//Program Date: Spring 2017
import java.util.*;
public class flippedstacks {
    public static void main(String args[]){
        int count, myStackSize, myTempStackSize;
        Stack myStack = new Stack();
        for (count = 1; count <=10; count++){
            myStack.push(count);
        }
        myStackSize = myStack.size();
        Stack myTempStack = new Stack();
        for (count = 1; count <=myStackSize; count++){
            myTempStack.push(myStack.pop());
        }
        System.out.println("Current Caller is " + myTempStack.pop());
        myTempStackSize = myTempStack.size();
        for (count = 1; count <=myTempStackSize; count++){
            myStack.push(myTempStack.pop());
        }
    }
}

Lines 1 – 4 are the general header information. Lines 5 – 7 are the imports and creation of the class and main object.

Line 8 creates 3 uninitialized integer variables: count, myStackSize, and myTempStackSize.

Line 9 creates a new empty stack named “myStack”.

Lines 10 – 12 push content into the “myStack” stack. It pushes numbers 1, 2, 3, 4, 5, 6, 7, 8, 9, & 10 into the stack.

Line 13 initializes the value of the myStackSize variable as the size of “myStack” using the size function of stacks.

Line 14 is like line 9, but it creates an empty stack named “myTempStack”. This will be the stack that temporarily holds our stack of information so we can get the first record.

Lines 15 – 17 push the content into the “myTempStack” stack by popping each record in the “myStack” stack. The for loop know how many times to do this by using the myStackSize variable that was declared on line 8 and initialized on line 13.

Line 18 displays which caller is the current caller by popping it from the top of the “myTempStack” stack.

Line 19 is like line 13 in that it initializes the value of the myTempStackSize variable as the size of “myTempStack” using the size function of stacks.

Line 19 is also the beginning of the process of reverting the stack back to its original order with the first (oldest) entry removed.

Lines 20 – 22 are similar to lines 15 – 17 but the reverse process. They push content into the “myStack” stack by popping each record in the “myTempStack” stack. The for loop knows how many times to do this by using the myTempStackSize variable that was declared on line 8 and initialized on line 19.

Line 24 & 25 close out lines 7 & 6 respectively.

Arrays with Keyboard Interactivity

Today, we discussed how to create an array with keyboard interactivity. The user will be asked to enter how many numbers they will be entering and then they will be asked to enter numbers separated by a space.

//Program Name: Arrays with Keyboard Input
//Programmer Name: Eric Evans, M.Ed.
//Programmer Organization: Ferris High School
//Program Date: Spring 2017

import java.util.*;
import java.lang.*;
import java.io.*;

public class arrayKeys {
  public static void main(String args[]){
    Scanner count = new Scanner(System.in);
    System.out.print("How Many Numbers Do You Want to Enter?: ");
    int arraySize = count.nextInt();
    int myArray[] = new int[arraySize];
    Scanner nums = new Scanner(System.in);
    System.out.println("Enter Your " + arraySize + " numbers each separated by a space and press enter when done.");
    for(int counter = 0; counter < arraySize; counter++){
      myArray[counter] = nums.nextInt();
    }
  System.out.println(Arrays.toString(myArray));
  }
}

Following the header information (lines 1 through 4) and the imports (lines 6 through 8), we get to the actual application code.

On line 12, we declare a scanner object named “count” which will receive input from the keyboard.

On line 13, we ask the user to enter the number of items they will be entering. Lines 14 assigns the value that is entered as an integer variable named “arraySize”.

Line 15 creates an empty array named “myArray” which is initialized as the size of the “arraySize” variable declared on line 14.

Line 16 declares a second scanner object named “nums” which will receive the integers to the recorded from the keyboard.

On line 17, we ask the user to enter the integers they want recorded separated by a space.

Line 18 opens a for loop. The loop initialization creates an integer variable named “counter” with the value of 0. The loop condition is to run while the variable “counter” is less than the variable “arraySize”, which was declared on line 14. Each pass through the loop increments the value of the variable “counter” by 1.

Each pass through the loop executes line 19, which assigns the next integer in the sequence of numbers from the “nums” scanner to “myArray” in the index (position) declared by the “counter” variable.

Finally, on line 21, we output the contents of “myArray” as a string.

Tangible Introduction to Stacks

After we spend a day getting back into a coding mindset in Computer Science, we’ll be starting a new unit over data structures. The first structure we’ll be looking at are stacks.

I’m reflecting on something that Dr. Sabrina McCullough used to tell us when she was leading our elementary math training sessions about the importance of introducing a new skill or concept using concrete / real-world / tangible examples.

I applied this when I introduced iterative structures such as for loops, while loops, and do while loops. My students can tell you that I had them walking in circles for a while, but they understood the difference between the types of loops before we ever coded anything!

To start, I am going to have the students tear a sheet of paper into 8 semi-equal pieces. They are going to answer the following questions in this order recording an answer on each piece of paper and stacking them one on the other face-down as they record their answers.

  1. What is your favorite breakfast food?
  2. What is your favorite junk food?
  3. What is your favorite school holiday?
  4. How old are you?
  5. What grade are you in?
  6. What month is your birthday?
  7. What year is it now?
  8. What is your favorite color?

Once the last question is answered, I will have them look at their small stack and ask them the following questions:

  1. As you added a new item to your stack, where did you put it? (top, bottom, or middle)
  2. If you needed to search through your stack for something, where would you start? (top, bottom, or middle)

Next, I will give each student a stack of 8 index cards. The cards will be randomly numbered with the exception of the 3rd card in each stack, which will have the number 25.

Before the students are given their cards, they will be given the rules:

  • Do not do anything with the cards until you are told to do so.
  • You can only have one card face-up at a time.
  • You can only take from the top of the stack.
  • If you perform any sort of calculation beyond a search on a card, that card is removed from the stack and “discarded”.

I will then walk them through a series of exercises with their stack of cards:

  1. Write down the cards in the stack in order.
    Return stack to original.
  2. Search for the card with 25. How many cards were above it?
    Return stack to original.
  3. Take top card and multiply it by 10.
    Discard top card from stack.
  4. Search for the card with 25. How many cards were above it?
    Return stack.
  5. Take top card and multiply by 5.
    Discard top card from stack.
  6. Search for the card with 25. How many cards were above it?
    Return stack.
  7. Write down the cards in the stack in order.
    Return stack.

Once this information has been recorded, the following questions will be asked:

  1. How many cards can we interact with at a time?
    (Answer = 1)
  2. What was the pattern each time you searched for the card with 25 on it?
    (Answer = it was getting closer to the top)
  3. Can we do any calculations with cards below the current top of the stack?
    (Answer = No)
  4. When I place an item on a stack, where does it go?
    (Answer = On the top)
  5. When I take an item off of a stack, where does it come from?
    (Answer = On the top)
  6. How does the term LIFO (Last In – First Out) apply to a stack?
    (Answer = The last item added to the stack is the first item to be removed)

Once we go through this, we’ll then move into basic programming that was discussed in the post http://funmultiplies.com/starting-with-stacks

Hopefully, giving them a tangible example of how a stack works will assist them with the abstract reasoning of working with stacks as a Computer Science data structure.

AP or Dual Credit Computer Science

In addition to Robotics, Computer Science, and Principles of Technology, I teach 4 sections of Business Information Management I (BIM) I. The BIM class is offered as a dual credit course through Navarro College in Corsicana, TX.

While I was completing the credentialing process for Navarro, I noticed that they offer several Computer Science courses that are in-line with our 3 proposed courses. This made me wonder for a moment, is Advanced Placement the best option for our students?

The Case For Dual Credit / Against AP

I have spoken with several different administrators and they are excited about the possibility of offering the Computer Science courses as dual credit as opposed to Advanced Placement.

The reasoning for their excitement is that if the course is offered as dual credit, the student must complete the assigned work and assessments satisfactorily and at the conclusion they receive college credit. Under the Advanced Placement option, the student must do this as well and meet a minimum score of a College Board created/administered exam.

The dual credit solution also allows us to offer Computer Science I, Computer Science II, and Computer Science III as college-level courses. Under the Advanced Placement option, only Computer Science I and Computer Science II would be college-level courses.

In a dual credit scenario, the students will know exactly which college-level courses they are receiving credit for at Navarro College. Under the Advanced Placement option, students have an idea of which courses the Advanced Placement credit will cover but there is no guarantee.

The Case for AP / Against Dual Credit

Having worked for a time in higher education, I have had the chance to see what lies on the other side of the fence. In the world of higher education, faculty are many times admonished if their percentage of “A’s” or passing is too high. This is the concept of grade inflation. Institutions of higher education don’t want to appear that “everyone passes and gets an A!” They have an appearance of academic rigor to uphold.

In the world of K-12 education, we have almost the exact opposite. In K-12, faculty are admonished if their failure percentage is too high. For example, where I am at now, a failure rate above 15% is unacceptable.

As such, let’s look at some grades for 15 fictional students:

  • Student A – 90
  • Student B – 88
  • Student C – 57
  • Student D – 65
  • Student E – 97
  • Student F – 73
  • Student G – 94
  • Student H – 82
  • Student I – 76
  • Student J – 79
  • Student K – 82
  • Student L – 88
  • Student M – 94
  • Student N – 45
  • Student O – 85

In this example, the class average is 79.67% with a failure rate of 20%.

To bring that failure rate down to under the 15% threshold, I would have to find some way to bring the grade of “Student D” up to passing as they are the closest to passing.

If we apply a curve based upon the formula of
grade + (square root (grade) X 0.6)
we get the following:

  • Student A – 90 –> 96
  • Student B – 88 –> 94
  • Student C – 57 –> 62
  • Student D – 65 –> 70
  • Student E – 97 –> 100
  • Student F – 73 –> 78
  • Student G – 94 –> 100
  • Student H – 82 –> 87
  • Student I – 76 –> 81
  • Student J – 79 –> 84
  • Student K – 82 –> 87
  • Student L – 88 –> 94
  • Student M – 94 –> 100
  • Student N – 45 –> 49
  • Student O – 85 –> 91

The class average is now 85% with a failure rate of 13.3%.

So, in the world of K-12 education, this class is now clear of any additional scrutiny of its grades. However, “Student D” who did not demonstrate mastery of the skills has passed.

Let’s assume that “Student D” performs the same way for the entire year – just barely passing due to the curves. This student leaves high school receives college-level credit for the class and believes they are ready for the next-level course, when they are not.

In contrast, an Advanced Placement course could also be held to the same grading guidelines and “Student D” would receive their passing grade in the course. However, to have the possibility to receive college credit, “Student D” would have to score high enough on the College Board exam for that course. Given the performance of “Student D” in the class, they would likely not score high enough to receive college-level credit.

Personal Opinion

I have spoken with administrators at both the K-12 and higher education levels and have come to a final decision.

My initial thoughts are that dual credit Computer Science would be a great solution for my students in the short term as they would be all but guaranteed college-level credit. They would get the “feel good” feeling of receive college credit.

However, in the long-term, I feel that Advanced Placement is the best solution because if counteracts the grade inflation inherent in K-12 education with the College Board exam. Here, the “feel good” feeling of receiving college credit would be genuine as they would have passed an effective 3rd party exam.

As the majority of students taking the class will pursue college after high school, the long-term solution of Advanced Placement seems to be the best option at this time.

How to Make It Better

There are a few different options that could be done to make this better for everyone involved all-around and level the attractiveness of both options for the short-term and long-term:

  1. Remove punitive actions for failure rates in excess of 15% in college-credit classes.
  2. Add oversight to monitor failure rates in college-credit classes and transfer students to non-college-credit classes when justified.
    NOTE: This is already done for many Advanced Placement courses but not Dual Credit.
  3. Genuinely align classroom, campus, and district expectations of college-credit participants (teachers & students) to those of the college that the credit is awarded through.

Starting with Stacks

Our next unit in Computer Science is working with data structures. So far, all we have done is take keyboard input or hard-coded input and done immediate calculations with it. We’ve not actually stored or manipulated any data.

We’re going to start with stacks as those are arguably the easiest data structure to understand.

//Program Name: Starting with Stacks
//Programmer Name: Eric Evans, M.Ed.
//Programmer Organization: Ferris High School
//Program Date: Spring 2017

import java.io.*;
import java.util.*;

public class stacks {
    public static void main(String args[]){
        Stack myStack = new Stack();
        myStack.push(1);
        myStack.push(2);
        myStack.push(3);
        myStack.push(4);
        myStack.push(5);
        myStack.push(6);
        myStack.push(7);
        myStack.push(8);
        myStack.push(9);
        myStack.push(0);
        System.out.println("Current Stack: " + myStack);
        System.out.println("Value of 1 is located " + myStack.search(1) + " positions from the top of the stack.");
        System.out.println("");
        System.out.println("First Removed Object is: " + myStack.pop());
        System.out.println("Current Stack: " + myStack);
        System.out.println("Value of 1 is located " + myStack.search(1) + " positions from the top of the stack.");
        System.out.println("");
        System.out.println("Next Removed Object is: " + myStack.pop());
        System.out.println("Current Stack: " + myStack);
        System.out.println("Value of 1 is located " + myStack.search(1) + " positions from the top of the stack.");
        System.out.println("");
        System.out.println("Next Removed Object is: " + myStack.pop());
        System.out.println("Current Stack: " + myStack);
        System.out.println("Value of 1 is located " + myStack.search(1) + " positions from the top of the stack.");
        System.out.println("");
        System.out.println("Next Removed Object is: " + myStack.pop());
        System.out.println("Current Stack: " + myStack);
        System.out.println("Value of 1 is located " + myStack.search(1) + " positions from the top of the stack.");
        System.out.println("");
        System.out.println("Next Removed Object is: " + myStack.pop());
        System.out.println("Current Stack: " + myStack);
        System.out.println("Value of 1 is located " + myStack.search(1) + " positions from the top of the stack.");
    }
}

As you can see here, we created a new stack on line 11 named myStack and then pushed the integer 1, 2, 3, 4, 5, 6, 7, 8, 9, & 0 into that stack on lines 12 through 21.

Line 22 displays the content of the stack, which at this moment is the following:

[1, 2, 3, 4, 5, 6, 7, 8, 9, 0]

Line 23 uses the search method to display the current position of a searched item, in this case, the integer “1”. Remember, the search method of a stack returns the position relative to the top of the stack. At this point in the application, the integer “1” is located at position 10.

At Line 25, we use the pop method to return the value at the top of the stack. Since this object was handled, it has now been removed from the stack.

Line 26 is identical to line 22 in that it displays the content of the stack at that moment. However, since the top item has been removed from the stack, it now looks like the following:

[1,2,3,4,5,6,7,8,9]

Line 27 is identical to line 23 and provides the position of the searched item, in this case the integer “1” in relation to the top of the stack. Since the top item has been removed, the search item is now one position closer to the top of the stack.

Lines 29-31, 33-35, 37-39, and 41-43 all perform the same functions as lines 25-27. Each time, the top item from the stack is removed, the current stack is displayed, and the position of the searched item in relation to the top of the stack is provided.

Interactive Stacks

Additionally, we will look at adding interactivity to the process as opposed to hard-coding the data.

//Program Name: Starting with Stacks
//Programmer Name: Eric Evans, M.Ed.
//Programmer Organization: Ferris High School
//Program Date: Spring 2017

import java.io.*;
import java.util.*;

public class stacks {
    public static void main(String args[]){
        Stack myStack = new Stack();
        Scanner myInput = new Scanner(System.in);
        System.out.print("Enter 10 Integers Separated by a Space and Press Enter: ");
        for(int myCounter=1; myCounter <11; myCounter++){
            myStack.push(myInput.nextInt());
        }
        System.out.println("Current Stack: " + myStack);
        System.out.println("Value of 1 is located " + myStack.search(1) + " positions from the top of the stack.");
        System.out.println("");
        System.out.println("First Removed Object is: " + myStack.pop());
        System.out.println("Current Stack: " + myStack);
        System.out.println("Value of 1 is located " + myStack.search(1) + " positions from the top of the stack.");
        System.out.println("");
        for(int myPopCounter=1; myPopCounter < 5; myPopCounter++){
            System.out.println("Next Removed Object is: " + myStack.pop());
            System.out.println("Current Stack: " + myStack);
            System.out.println("Value of 1 is located " + myStack.search(1) + " positions from the top of the stack.");
            System.out.println("");
        }
    }
}

Here, you can see that we’ve streamlined the code considerably. What was lines 25 through 43 is now lines 24 through 29! We utilized a for loop to execute the segment of code through 5 iterations.

In addition, the keyboard inputs are being processed through a for loop located at lines 14-16. This loop runs 10 iterations of the nextInt() method of the scanner object myInput and using the push method of the stack object myStack places them into the stack.

This code runs identical to the code above but the user can enter their own data as opposed to having to utilize the hard-coded data.

Items to Discuss

Next class, we’ll be discussing how the search handles multiple occurrences of the same item. For example, let’s say that a user entered their data to create the following stack:

[1,2,3,4,5,1,2,3,4,5]

In this case, if we used the search method to locate the integer “1”, which integer “1” would be displayed?

We will also analyze the advantages and the disadvantages of stacks as a data structure. This will take us to the next data structure, 1-dimensional arrays.

Semester Review – Computer Science

When my Computer Science I students return in January, I will be giving them the following assignment:

Create a JAVA application that has users guess a pre-selected number as a game. The application should provide the rules of the game which state a random number between 0 and 100 will be chosen and users will be given a maximum of 20 guesses.

When asking the user for each guess, the application should indicate which guess of the 20 the user is on and whether their guess was too high or too low.

If the user guesses the solution in under 20 guesses, they will be congratulated and given the number of guesses it took for them to arrive at the solution.

If the user exceeds the maximum number of allowed guesses, they will be told they have exceeded the allowed number of guesses and will be provided with what the solution was.

While there are numerous ways this problem could be tackled, here is one possible solution that is similar to what I would expect at this point in the year:

//Program Name: Guess My Number
//Programmer Name: Eric Evans, M.Ed.
//Programmer Organization: Ferris High School
//Program Date: Spring 2016
import java.util.*;
import java.lang.*;
import java.io.*;
public class guessNumber{
    public static void main (String[] args){
        System.out.println("Welcome to the Number Guessing Game");
        System.out.println("");
        System.out.println("I will pick a number at random and your job is to guess the number that I have chosen.");
        System.out.println("The number will be between 0 and 100. I will give you clues after each guess.");
        System.out.println("You will have up to 20 guesses to guess my number.");
        System.out.println("");
        Scanner ready = new Scanner(System.in);
        System.out.print("Are you ready to start? (Y or N)");
        String readyGo = ready.next();
        String readyGoUC = readyGo.toUpperCase();
        if (readyGoUC.equals("Y")){
            double randomNumber = Math.random() * 100;
            int randomNumberInt = (int)randomNumber;
            Scanner myGuessInput = new Scanner(System.in);
            System.out.print("What is your first guess? ");
            int myGuess = myGuessInput.nextInt();
            while(readyGoUC.equals("Y")){
                for (int score = 1; score < 20; score++){
                    if(randomNumberInt > myGuess){
                        System.out.println("Too Low. Try a Higher Number");
                        myGuessInput = new Scanner(System.in);
                        System.out.print("What is your #" + score + " guess? ");
                        myGuess = myGuessInput.nextInt();     
                    }else if(randomNumberInt < myGuess){
                        System.out.println("Too High! Try a Lower Number");
                        myGuessInput = new Scanner(System.in);
                        System.out.print("What is your #" + score + " guess? ");
                        myGuess = myGuessInput.nextInt();
                    }else if(randomNumberInt == myGuess){
                        System.out.println("");
                        System.out.println("Congratulations! You Guessed my Number!");
                        System.out.println("");
                        System.out.println("Number of Guesses = " + score);
                        System.out.println("");
                        System.out.println("Exiting Program");
                        System.exit(0);
                    }
                }
                System.out.println("");
                System.out.println("You have exceeded the maximum number of guesses.");
                System.out.println("");
                System.out.println("The number I picked was " + randomNumberInt);
                System.exit(0);
            }
        } else{
            System.out.println("Thank you for playing.");
            System.out.println("Exiting Program");
            System.exit(0);
        }
    }
}

This solution utilizes several of the skills covered in the first semester of Computer Science I including the use of character, string, integer, double, and scanner variable types. In addition, the toUpperCase and equals methods of the String class are used as is the random method of the Math class.

Also, in this possible solution, if/else, for, and while statements are all utilized along with various Boolean operators.

Computer Science I – Semester Grade Closing

The semester exam in Computer Science I was given today and the final grades for this course are ready for posting.

1st Semester - Computer Science I (Pre-Exam)
1st Semester – Computer Science I (Pre-Exam)
1st Semester - Computer Science I (Post-Exam)
1st Semester – Computer Science I (Post-Exam)

As you can see, the grades in this class did shift to the right.

F’s = 3 < – > 2
C’s = 1 < – > 1
B’s = 6 < – > 3
A’s = 4 < – > 8

The total number of A’s doubled and the number of B’s and F’s decreased and C’s held.

For the semester, this class had a failure rate of 14.28%.

 

Semester Grade Calculator – Take 2

Blue Pelican Java BookFollowing our review from the Thanksgiving break return, we’ll be covering an introduction to object oriented programming.

The first lesson will be a simple lesson almost verbatim from Blue Pelican Java. however, the second lesson will be to take the semester exam grade calculator created earlier in the week and adapt principles of OOP to it.

The code they are starting with is similar to the following:

//Program Name: Unit 1 & 2 Review
//Programmer Name: Eric Evans, M.Ed.
//Programmer Organization: Ferris High School
//Program Date: Fall 2016

import java.util.*;
import java.lang.*;
import java.io.*;

public class gradecalculator{
    public static void main (String[] args){
        int runAgain = 1;
        while (runAgain == 1){
            System.out.println("**Minimum Grade Calculator**");
            Scanner q1 = new Scanner(System.in);
            System.out.print("Enter Your Q1 Report Card Grade_ ");
            double myQ1Grade = q1.nextDouble();
            Scanner pr4 = new Scanner(System.in);
            System.out.print("Enter Your PR4 Report Card Grade_ ");
            double myPR4Grade = pr4.nextDouble();
            double c = ((69.5 - ((myQ1Grade * 0.45) + (myPR4Grade * 0.45)))/0.10);
            double b = ((79.5 - ((myQ1Grade * 0.45) + (myPR4Grade * 0.45)))/0.10);
            double a = ((89.5 - ((myQ1Grade * 0.45) + (myPR4Grade * 0.45)))/0.10);
            System.out.println("With a Q1 grade of " + myQ1Grade + " and PR4 grade of " + myPR4Grade + ":");
            System.out.println("");
            System.out.println("To score a C, you will need a minimum of a " + c + " on the semester exam.");
            System.out.println("To score a B, you will need a minimum of a " + b + " on the semester exam.");
            System.out.println("To score an A, you will need a minimum of a " + a + " on the semester exam.");
            System.out.println("");
            System.out.println("** NOTE: Negative grades indicate the exam could be skipped");
            System.out.println("** NOTE: Grades over 100 indicate this average cannot be achieved");
            System.out.println("");
            Scanner runItAgain = new Scanner(System.in);
            System.out.println("Would You Like to Perform Another Calculation?");
            System.out.print("1 - Yes  /  0 - No : _ ");
            runAgain = runItAgain.nextInt();
        }
        System.out.println("");
        System.out.println("Program Complete - Exiting");
    }
}

They will be breaking the program into two separate parts. The main method will be handling keyboard inputs, screen outputs, and the while loop. The calculation method will be handling the calculations.

Here is a possible solution to the problem:

//Program Name: OOP Concepts (File 1 of 2)
//Programmer Name: Eric Evans, M.Ed.
//Programmer Organization: Ferris High School
//Program Date: Fall 2016

import java.util.*;
import java.lang.*;
import java.io.*;

public class gradecalculator{
    public static void main (String[] args){
        int runAgain = 1;
        while (runAgain == 1){
            System.out.println("**Minimum Grade Calculator**");
            Scanner q1 = new Scanner(System.in);
            System.out.print("Enter Your Q1 Report Card Grade_ ");
            double myQ1Grade = q1.nextDouble();
            Scanner pr4 = new Scanner(System.in);
            System.out.print("Enter Your PR4 Report Card Grade_ ");
            double myPR4Grade = pr4.nextDouble();
            System.out.println("With a Q1 grade of " + myQ1Grade + " and PR4 grade of " + myPR4Grade + ":");
            System.out.println("");
            calculation myGrade = new calculation (myQ1Grade, myPR4Grade);
            System.out.println("To score a C, you will need a minimum of a " + myGrade.c + " on the semester exam.");
            System.out.println("To score a B, you will need a minimum of a " + myGrade.b + " on the semester exam.");
            System.out.println("To score an A, you will need a minimum of a " + myGrade.a + " on the semester exam.");
            System.out.println("");
            System.out.println("** NOTE: Negative grades indicate the exam could be skipped");
            System.out.println("** NOTE: Grades over 100 indicate this average cannot be achieved");
            System.out.println("");
            Scanner runItAgain = new Scanner(System.in);
            System.out.println("Would You Like to Perform Another Calculation?");
            System.out.print("1 - Yes  /  0 - No : _ ");
            runAgain = runItAgain.nextInt();
        }
        System.out.println("");
        System.out.println("Program Complete - Exiting");
    }
}
//Program Name: OOP Concepts (File 2 of 2)
//Programmer Name: Eric Evans, M.Ed.
//Programmer Organization: Ferris High School
//Program Date: Fall 2016

public class calculation{
    public double a;
    public double b;
    public double c;
    public calculation (double myQ1Grade, double myPR4Grade)
    {
        a = ((89.5 - ((myQ1Grade * 0.45) + (myPR4Grade * 0.45)))/0.10);
        b = ((79.5 - ((myQ1Grade * 0.45) + (myPR4Grade * 0.45)))/0.10);
        c = ((69.5 - ((myQ1Grade * 0.45) + (myPR4Grade * 0.45)))/0.10);
    }
}

As you can see, the calculation.java file is responsible for the calculations and the gradecalculator.java file is handling all of the other functions of the application.

In reality, we would not necessarily break-up a program like this, but this allows the students the opportunity to see how OOP concepts work on an existing application they have developed.