CS Problem Solving and Object-Oriented Programming

Similar documents
CS Problem Solving and Object-Oriented Programming Lab 2 - Methods, Variables and Functions in Alice Due: September 23/24

GHSA Swimming/Diving POP School User s Guide

Energy Skate Park - Conservation of Energy. Skate Park Energy Simulation - Conservation of Energy

Mapping a course for Pocket Caddy

Club s Homepage Welcome Club Calendar Logout Add a Request Play Date Requested Time Hole Selection # of Tee Times Break Link

Player, Coach, Manager, and Team Account Creation

American Thoroughbred Handicapping Program

Dive Sheets & Running Events Meet Management Software Tutorial for EZMeet Version 3.1 revised 2/4/2006

Alice in Wonderland Tea Party Coding Animation

Empire State Winter Games Figure Skating Events SC of Lake Placid February 2-4, 2018

Club s Homepage Use this feature to return the club s website.

Get Crazy!!! (1 stopwatch, 1 basketball, 1 deck ring)

ITF SCORER ONLINE TRAINING SETUP

A GUIDE TO THE LOOSE ENDS HOCKEY LEAGUE WEBSITE PAGE

Activity 5.1B Dragster Assembly Drawing

Chapter : Linear Motion 2

INTERNATIONAL INTERCLUB A-COMPETITION REGULATIONS SEASON

1 st /2 nd Grade Youth Basketball Program Description

Table of Content IMPORTANT NOTE: Before using this guide, please make sure you have already set up your settings in

MoLE Gas Laws Activities

Lets Play Catch! Keeping Score in Alice. Overview. Set Up. Position the ball 20 feet away: Orienting the ball 7/19/2010

INSTRUCTION FOR FILLING OUT THE JUDGES SPREADSHEET

ROYA BOWLING TEAM REGISTRATION INSTRUCTIONS

How to Use TDM for a 10 and Under Tournament

TOURNAMENT TEAM REGISTRATION INSTRUCTIONS:

BVIS Beach Volleyball Information System

THE WHIRLING STAFF OF CHOY LAY FUT KUNG FU BY KOON-HUNG MASTER LEE

MoLE Gas Laws Activities

Single Skating A class

Air Ball! Evaluation copy

Software Manual for FITstep Pro Version 2

Microsoft Windows Software Manual for FITstep Stream Version 4

Table of Contents Diagnosis ICD9 to ICD10 GEM Report... 1 Diagnosis Form... 5 Helpful Hints on Correcting Issues... 8 Disclaimer...

Using Moodle. Poramin Bheganan Krittaya Bunchongchit

EAST HANOVER BOYS BASKETBALL ASSOCIATION RULES OF PLAY Version 2.3

Full-Time People and Registrations Version 5.0

REGISTRATION OPEN: JULY 15, 2017 REGISTRATION DEADLINE: SEPTEMBER 1, 2017

Start - All Programs - Class Software - Scratch - Scratch move move move Sound play drum move move move play drum Control forever forever forever

Requesting Team Activation

Axis Camera with VaxALPR On Camera software: License key

Mac Software Manual for FITstep Pro Version 2

DIVE MEET SCORING INSTRUCTIONS. Day before meet

TECHNICAL NOTE HOW TO USE LOOPERS. Kalipso_TechDocs_Loopers. Revision: 1.0. Kalipso version: Date: 16/02/2017.

English. Golf NAVI. User Guide V1.0.0

Rules Meeting Attendance - Coaches

What does FORCE do? FP 6: 2 ways to submit Forms C Excel sheets (as before) Highly recommended to use as from now FORCE

Assignment A7 BREAKOUT CS1110 Fall 2011 Due Sat 3 December 1

NATIONAL B-COMPETITIONS REGULATIONS SEASON

Sport Event Management System (SEMS) Club Entry Guide SLST 2018 Carnivals

Mechatronic System Design (ENT473)

Introduction. Introduction to Computers CGS Resources. Textbook. Assignments and Grading. Overall Learning Goal

2017 Census Reporting To access the SOI s Census Reporting web site go to:

Orion National Air Pistol League 2018 League Program

Horse Farm Management s Report Writer. User Guide Version 1.1.xx

Skater World: Part Two. By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 2009

Grade 7/8 Physical Education Basketball Assignment History/Origins & Rules

MEMBER TRAINING PLAN. Shadowing a review

Version 3.1.0: New Features/Improvements: Improved Bluetooth connection on Windows 10

The ICC Duckworth-Lewis-Stern calculator. DLS Edition 2016

PE 261 COURSE SYLLABUS

Welcome to the ABGC Basketball House League

EAST HANOVER BOYS BASKETBALL ASSOCIATION RULES OF PLAY Version 2.4

Tournament Manager: Running a VEX IQ Event - Beginner

Ganon Baker. 1) Finishing lay ups

University of Pennsylvania Institutional Review Board. Reliance Agreement Guidance: How to Apply for External IRB Review

Nucula. Nucula User Guide to Work Records

User Guide. Two-Wheeled Add-on. Created By: A-Lab Software Limited. Date Created: Feb Date Modified: Feb Revision: 1.

CPS 4 Test 1 Oct. 6, 2005

Skate Milwaukee 2015 Announcement Wisconsin Figure Skating Club July 8 12, 2015

DIGITAL PRODUCT SUITE

Fastball Baseball Manager 2.5 for Joomla 2.5x

North Star Open. March 23-24, 2018 Hosted by North Star Figure Skating Club Sanctioned by U.S. Figure Skating

N E W J U D G I N G S Y S T E M F O R A R T I S T I C R O L L E R S K A T I N G C O M P E T I T I O N S THE SYSTEM.

Roster Maintenance. How-to Access Your Club Roster

Here are some youth ball-handling drills provided by Mike MacKay, Manager of Coach Education and Development for Canada Basketball.

2nd Annual Harvestfest

Registering for ICC Competitions

Page 1 GM-FAQ Club Profile FAQs. Page

UNITED CHURCH ATHLETIC LEAGUE RULES OF BASKETBALL. Updated 12/2/2016

104: USING "STREAM DOWNLOADER" IN "REPLAY MEDIA CATCHER" FOR "MEDIA CAPTURE"

Ganon Baker Drills. CB s C oaching Education and Development

Investigating Natural Gas Production and Consumption with Web GIS

Iteration: while, for, do while, Reading Input with Sentinels and User-defined Functions

A GUIDE TO USING MYNETBALL (CLUBS)

Using the GHIN Handicap Allocation Utility with GHP Golfer

Oracle ebusiness CCTM Supplier: Rate Card

HOW TO SUBMIT YOUR RACE RESULTS ONLINE?

SafeSeaNet Norway PEC Administration Guide

Timberline FSC Schofield, WI March 17, 2019

Previous Release Notes

Procedures for Applying Bonus Points and Falls SINGLES

Welcome. Youth Diving: Responsibility and Risks Flipchart. Appendix GENERAL STANDARDS AND PROCEDURES A-45

How-to Edit/Delete a Score

Air Ball! LabQuest Vernier Gas Pressure Sensor Vernier Motion Detector basketball stopper with needle, stopper stem and tubing attached meter stick

(SWI) Swiss Volley. Scoring Service. using. Data Volley 2007 Professional

APB and ATB Setup Guide.

Quintic Automatic Putting Report

M e y e r m i d d l e s c h o o l

The Gory Details. How to actually DO the judging

UNITED STATES OLYMPIC COMMITTEE. USOC ATHLETE ADVERTISING WAIVER SYSTEM User Guide October 25, 2017

Transcription:

CS 101 - Problem Solving and Object-Oriented Programming Test Program 1 Due: October 8, 1:15 PM Note: Both lab sections have the same due date. This is a FIRM due date. This assignment is a take-home test. As such, the honor code rules are different for this assignment than for labs we have done up to this point. Here are the rules: The only person you may consult with is Professor Lerner. You may not consult with each other, with our TA or lab instructor, or with anyone outside of this class. You may consult your notes, your book, your previous assignments, and the course website. You may download and examine all examples available on the course website. You may not otherwise use the Internet to help complete this test. If you have any questions about whether a particular activity is in violation of the honor code, please do not hesitate to ask. Also, please do not hesitate to ask me questions about the exam. It will never hurt! I reserve the right to not answer a question, but, in general, you should expect asking questions to be helpful. By submitting your solution to this exam via Ella, you are asserting that you have adhered to these honor code rules. This exam contains 2 questions. Therefore, you should submit 2 separate Alice worlds. In your submission, please pay attention to laying out the world as shown and getting the behavior requested. Remember that it is often easier to set up your world by right-clicking on the objects and executing one of their methods rather than using the mouse to do positioning. When considering the functionality, do a little bit at a time. Think about how to do it, write the code and test it. Save your files often! Finally, be sure to include comments. QuickTime movies of the animations are available on the schedule page of the course website at http://www.mtholyoke.edu/~blerner/cs101/lectures.html. (50 points) Animation 1: Dribbling contest Two people have a contest to see who can dribble a basketball for longer. Before beginning the contest, about ½ the time, one of the contestants will say something. The other times, the 2 nd contestant will speak. They should dribble the ball at the same time. One player should lose by dribbling the ball off of his/her foot. The winning player should make one extra dribble and then say some wise comment. 1

Below are some screen shots to help you understand the animation. The starting world. Randomly choose one player to make a comment. The balls when they are near the ground. 2

After several successful dribbles by both players, the ball hits the lunch lady s foot. The ball bounces off her foot and moves quickly out of the scene. The winning player makes a wise remark. 3

Hints The objects used in this scene are: Gym: Found in Environment category of the Web gallery. Basketball: Found in Sports category of the Web gallery. 2 people: You can use any people you like. I used LunchLady and Nerd from the Web gallery. To get to the Web Gallery, do the following. 1. Click on Add Objects. You should see something familiar like the image on the top right. 2. Click on Home 3. You should now see the image on the bottom. 4. Click on Web Gallery to connect to the Internet and see a gallery similar to the Local Gallery but with many more choices available. Here are some hints to help with the animation: Use dummy objects to determine where the ball should move to when it is at the player s hand and when bouncing off the player s foot. Use the Random.nextBoolean function defined in the World object to randomly select which player should speak at the beginning of the game. Define a dribble method. Initially, the method should just get a single player to dribble. Once that works add 2 parameters to the dribble method: which basketball to move where to move the basketball to when at a player s hand (50 points) Animation 2: Ice Skating Routine Four ice skaters are practicing their single Axel jump while a coach looks on from behind them. One at a time they take 2 skating steps, jump, making 1½ revolutions while in the air and landing backwards on one skate. Here are scenes from this animation. The starting world. The skaters are lined up with the coach behind them. They should all be facing the same direction. 4

The first skater begins skating. The skater has jumped and completed ½ revolution in the air. The skater has completed ¾ revolution. 5

The skater has completed 1¼ revolutions. After landing, the skater has is on one foot and skates backwards. When the skater stops moving, she puts her foot down and resumes the usual pose, but now facing the other skaters. 6

This is the final view of the world after all the skaters have gone. Hints The objects used in this scene are: Lake: Found in Environment category of the Local gallery. My version shown above has a lot of the trees removed. It is not necessary for you to remove trees. IceSkater and Coach from the People category. You can use anybody for the coach. If you like, you can use the ice skating world that we used in class as the starting point for this lab, including the skate method that we did in class. You can download that from the course schedule page located at http://www.mtholyoke.edu/~blerner/cs101/lectures.html. Here are some hints for creating this animation: Define a jump method to make a skater jump. Initially, just get an individual skater to jump. After that is working, add a parameter to the method that indicates which skater should jump. When the skater is in the air, she should continue to move in the same direction she was moving before jumping. If you just have her move FORWARD while she is turning, what forward means will change during the turn. (Remember the penguin diving into the hole.) To solve this problem do the following: Make sure all the skaters and the coach are facing exactly the same direction. The easiest way to do this is to right-select each skater but the first and the coach (one at a time) and select methods, orient to, ice skater, the entire ice skater When the ice skater is in the air, instead of just saying move FORWARD add the as- SeenBy argument and select the coach. This will cause the ice skater to move in the direction that is forward with respect to the coach, that is, the direction the coach is facing. If the skaters and coach are all facing the same direction, this will have the desired effect. 7

Grading Animation 1 10 Creating the world 5 Randomly speaking at start 10 One player able to dribble 10 Both players able to dribble 5 Winning and losing actions 10 Comments Animation 2 5 Creating the world 10 One skater doing the jump 10 One skater landing the jump 5 One skater doing the entire routine 10 All skaters doing the entire routine 10 Comments Turning in Your Work Go to ella. Click on COMSC 101 in the toolbar menu across the top. Then click on Assignments in the left column. Click the submit link for this assignment. Click the Add Attachment button. Use the Browse button to upload a local file. Click Continue. Then click the Submit button. Once you have submitted a solution to an assignment, Ella does not allow you to resubmit your assignment. In order to allow you to submit a revision, I will create extra assignments. So, in Ella, you should see assignments something like this: Test Program 1, Question 1 Test Program 1, Question 1, revision 1 Test Program 1, Question 1, revision 2 Test Program 1, Question 2 Test Program 1, Question 2, revision 1 Test Program 1, Question 2, revision 2 You only need to submit a revision if you would like to change your solution after submitting it. Please ask if you are confused about this. 8