West Ranch High School

Skip to main content
Main Menu Toggle

Assignments

Upcoming Assignments RSS Feed

Due:

Programming Project 6.8
  • Using the Card class the common folder or your Card class from project 4.6, Create a class called DeckOfCards that uses an ArrayList to store 52 objects that are instances of the Card class creating a standard deck of playing cards. Include methods to shuffle the deck, deal a card, and report the number of cards left in the deck. The shuffle method should assume you have a full deck. Create a driver class with a main method that deals each card from a shuffled deck, printing each card as it is dealt.

Due:

Fall Final Exam Review Sheet: The linked document contains the topics that may be tested on the Final Exam.  Review the list and ask questions about any topic that you do not understand.

Past Assignments

Due:

Arrays
CodingBat: Array-1 and Array-2: 10 problems from each set

Due:

Array Programming Projects
  • Programming Project 6.1: Design and implement an application that reads a number of integers that are in the range 0 to 50 inclusive and counts how many times each one is entered. After all input has been processed, print all of the values with the number of times each one was entered.
  • Programming Project 6.2: Change the program from 6.1 so that it works for numbers from -25 to 25.

Due:

ArrayList Quickcode- Using the files in the ArraylistQC folder in the common drive, complete the employeeIsEligible() and processRetirements() methods of the Company class. Period 1: Full value if completed by end of class.
You should not need to change any class other than the Company class, but you will need to compile the other classes.
Use the CompanyTester class to check that it works correctly.  An employee is eligible for retirement if (s)he meets at least two of the following requirements.
  • The employee is at least RETIRE_AGE years old.
  • The employee has worked for at least RETIRE_YEARS years.
  • The employee's salary is at least RETIRE_SALARY.
 
Method processRetirements removes all retirement-eligible employees from ArrayList myEmployees and maintains the following conditions: the ArrayList is maintained in order by employee ID and myTotalSalary is the total of all salaries of the remaining employees.

Due:

  • Programming Project 5.2: Change the Rational class from Chapter 4 (available in the Common folder) so it implements the Comparable interface. To do the comparison, computer a floating point value from the numerator and denominator for both Rational objects, then compare them using a tolerance value of 0.0001. Write a main driver to test your changes.
  • Programming Project 5.6: Design a Java interface called Lockable that includes the following methods: setKey, lock, unlock, and locked. The setKey, lock, and unlock methods take an integer parameter that represents the key. The setKey method establishes the key. The lock and unlock methods lock and unlock the object, but only if the key used is correct. The locked method returns a boolean of true for locked and false for unlocked. A Lockable object is an object whose regular methods are protected: if the object is locked, the methods cannot be invoked. Redesign and implement a version of the Coin class so that it is Lockable. A locked coin can be looked at to see if it is heads or tails, but it can not be flipped.

Due:

  • Interface QuickCode:
    • Copy the Interface QuickCode folder from the common folder to your drive (available after instructions are given in class)
    • Compile all of the files in the folder
    • Create and compile class files for the Eggs, Bacon, and Juice classes that implement the edible interface
    • Run the BreakfastTest file to test completion of the project
    • Full Credit if complete by the end of the period

Due:

Programming Project 4.5 - Game of Pig - Using the PairOfDice class, design and implement a class to play a game called Pig.  In this game, the user competes against the computer. On each turn, the player rolls a pair of dice and adds up the points. Whoever reaches 100 points first wins. If a player rolls a 1 on either die, all points for that round are lost and the die pass to the other player. If a player rolls 2 1's on the same roll, all points earned in the game are lost and the player loses control of the dice. The player may voluntarily turn over the dice after each roll, so they have the choice to roll again (be a pig) or turn over the dice and let the other player have a turn. Set up the computer player so that it always gives up the dice after getting 20 or more points in a round.  Modify your PairOfDice class as necessary to add functionality for this game without impacting the ability to use the Boxcars program.

Due:

Chapter 4 Multiple Choice Questions discussion
Programming Project 4.6: Design and implement a class called Card that represents a standard playing card. Each card has a suit and a face and a value. Create a program that displays 20 random cards. You can either have a default constructor that creates a random card or you can send random data as arguments to the constructor.  The 20 cards do not have to be unique.

Due:

Chapter 4 Programming Projects

Programming Project 4.3: Write an application that rolls a die and displays the result. Let the user pick the number of sides on the die. Use the Die class from the common folder to represent the die in your program.

Programming Project 4.4: Design and implement a class called PairOfDice, with two six sided Die objects. Create a driver class called BoxCars with a main method that rolls a PairOfDice 1000 times, counting the number of box cars (two sixes) that occur.

Due:

HW: Read Textbook Chapter 4. Answer Multiple Choice Questions 4.1-4.10 on pp244-247

Due:

  • Read about loops at http://codingbat.com/doc/java-for-while-loops.html
  • Complete 10 Exercises in CodingBat String-2
  • Textbook Programming Project 3.10
    • Design and implement an application that plays the Hi-Lo guessing game with numbers.  The program should pick a random number between 1 and 100(inclusive), then keep asking the user to guess a number. On each guess, report to the user that he or she is correct, guess is high, or guess is low. Keep accepting guesses until the user guesses correctly or quits. Use a zero (0) guess for the user to quit. report the number of guesses made after the user guesses correctly.

Due:

Midterm Exam
  • Midterm on Friday 10/13 (Period 1 will start the Midterm on Thursday 10/12)
  • End of First Quarter Friday 10/13
  • HW: Complete Midterm Study Grid for in class review
    • Page 1 of the grid will be reviewed on Thursday 10/5
    • Page 2 of the grid will be reviewed on Tuesday 10/10 for period 1 and Wednesday 10/11 for period 5.

Due:

 
Recursion Exercises
 
  • CodingBat Recursion-1 (10 problems)
  • AP-Style free response question 8.1 (textbook p. 510). Include a main method to test the three methods. All methods must implement a recursive solution. Change the triple method to return three times the value of a passed int instead of working with an array. You may modify the parameters for the triple method if necessary. Save as MathUtils.java.
public class MathUtils
{
  public static int factorial(int n){
 
  }
  public static int power(int base, int exp) {
 
  }
  public static int triple (int a) {
 
  }
  public static void main (String[ ] args){
 
  }
 
 
}

Due:

NCWIT Award for Aspirations in Computing
The NCWIT is an organization that promotes the role of women in technology. The Aspirations in Computing award opens up opportunities including scholarships for women who are interested in pursuing studies in computer related fields. West Ranch student Sarah Castillo was an affiliate award winner last year. More information at https://www.ncwit.org/
 
For information only.  This is not an assignment for the class

Due:

  • Recursion and Conditionals Quiz: You will be expected to trace recursive code to determine the result and be able to identify the base case and recursive case of a recursive method. You should know the dragon's three rules for recursion. You will be expected to trace and write code using if and else statements. Understanding of methods of the String class will be necessary for this quiz.

Due:

CodingBat
Complete at least 10 problems from each of the following sets:
  • Warmup-1
  • String-1
  • Logic-1

Due:

Magpie Lab Graded Assignment
 
Make a copy of Magpie3 called MagpieFinal and add the following functionality:
 
1. Change the greeting so that Magpie asks for the users name and then stores the name in a variable. The name should then be used randomly in the responses.
 
2. Add code to respond to the phrase "Tell me about..."  Choose two topics with at least two keywords for each topic. Have three responses for each topic. Each time that the user asks about the topic using any associated keyword, it will give a different response. When it runs out of responses for that topic, it should respond "I don't know any more about " with the name of the topic. If the Tell me about phrase is not one of the topics, it should respond "I don't know anything about" with the topic.
 
Make a copy of MagpieRunner3 called MagpieRunnerFinal. Modify it as necessary to make MagpieFinal work.

Due:

HW: Read Chapter 8 in the Textbook. Answer multiple choice questions 8.1 through 8.6 at the end of the chapter (p. 501)

Due:

 
Read Think Java Chapter 4
starting at section 4 by Monday 9/11

Due:

Magpie Chatbot Lab Activity 3.
 

Due:

Introduction to Magpie Chatbot Lab
 
Open the Magpie Lab Student Guide

Activity 1: Getting Acquainted with Chatbots. http://sites.google.com/site/webtoolsbox/bots


Due:

Magpie Chatbot Lab Activity 2
 
Copy Magpie Lab Folder from Common Drive to your G: Drive

Activity 2: Introduction to the Magpie Class. Open the Magpie2.java and MagpieRunner2.java files using jGrasp. Compile both classes. Complete Activity 2.

Due:

Programming Projects 2.2, 2.3, 2.6, 2.7, 2.8, 2.12
 
For each project, name the class and file with the name of the project. For example, Project2_2
 
  • 2.2 Write an application that reads three numbers and prints their average
  • 2.3 Write an application that reads two floating point numbers and prints their sum, difference, and product.
  • 2.6 Write an application that reads values representing a time in hours, minutes, and seconds. Then print the same time in seconds
  • 2.7 Write an application that performs the reverse of 2.6. Read a value representing a number of seconds then print the same amount of time in hours, minutes, and seconds.
  • 2.8 Write an application that reads the x,y coordinates for two points. Compute and print the distance between the two points.
  • 2.12 Write an application that determines the total value of coins in dollars and cents using keyboard input for the number of quarters, dimes, nickels, and pennies. Use the currency formatter to print the output.
 

Due:

Computer History through Advertisements
Examine the advertisements from the 1970s and 1980s on the Time Magazine Website
Working with a partner or in a group of three brainstorm questions that are raised by the ads. Think about the historical context of the ad images.
Rewrite any questions that can be answered with one or two words as open-ended questions.
For Friday, find at least one valid, reliable source that would be part of researching the question.

Due:

Blown to Bits part 2: Select at least 3 of the Koans from Chapter 1 of Blown to Bits. Write an example of what the Koan means. Do not use examples that are directly from the article. Post your examples in the appropriate Google Classroom discussion
 

Due:

Syllabus Verification Form - This form must be returned with parent signature. 20 points by due date. 15 points if late

Due:

Read Chapter 1 of Blown to Bits

Due:

Inside the Computer Project: Describe how a computer works in two different ways. Post your descriptions in Google Classroom
Method 1: Words
Write a description of how a computer works. Do not be literal, but instead
demonstrate an understanding of the processes and logic involved in the internal
operation of the computer in non computer terms. You may not use any of the words on the restricted list below and you may only use the words “computer,” “device,” and
“system” three times each.
Restricted terms list: CPU, Central Processing Unit, Memory, RAM, ROM, Bit, Byte,
Chip, Motherboard, Drive
Method 2: Pictures
Create a pictorial representation of how a computer works. Again, do not be literal, but demonstrate an understanding of the processes and logic. You may not use pictures of actual computer components in your representation.