Project 1 - Battleship Game
|
|
- Hilary Riley
- 5 years ago
- Views:
Transcription
1 Project 1 - Battleship Game Minimal Submission Due: Friday, December 22 th, 2006 Revision History Final Project Due: Sunday, January 21 th, 2007 Dec 7th, 2006, v1.0: Initial revision for faculty review. Dec 11th, 2006, v1.6: Final revision released to students. Jan 8th, 2006, v1.7: The output format for the board was changed to match the try submission. To clarify, there should be no space at the end of each row. Overview In this project, you will be required to write a simple one sided battleship game. Your program will start by specifying a board size, and then reading an input file with ships placements. From there you will have a chance to fire missiles to try to sink the ships. You will also be able to view the board, view the ship placement (cheat mode) and get the game statistics. Objectives Gain further experience using two dimensional arrays Practice using Scanner with System.in Obtain additional experience writing programs in Java Gain more experience designing classes Getting Help You may get help from your instructor(s) and the teaching assistants. Anything else is not allowed and is subject to the penalties listed in the DCS Policy on Academic Dishonesty. This includes but is not limited to: Obtaining detailed help from any other people Providing detailed help to other people Sharing source code with anyone, by any means or medium. We certainly do not expect there to be absolutely no communication between the students of this class; we know that people tend to learn very well that way. However, we expect that you will limit your discussion of this project to determining the specification of the problem. If you have any doubt if what you would like to do might violate our rules, please see your lecture instructor for clarification. Don't forget that the CS tutoring center is available to you. Program Requirements
2 Battleship is a popular game played on a board representing a rectangular portion of the sea. It is broken up into a grid of square cells, each one having a unique pair of coordinates. Battleships are placed on the board in a straight horizontal or vertical line. The opponent does not know where the battleships are; he or she fires missiles into the sea, specifying coordinates, and is only told if it was a hit or a miss. The player who fired the missile uses this information to guess the locations of the battleships. A battleship is sunk when all of its sections have been hit by a missile. The goal is to sink all the battleships. Usually it is a two-player game, each one having his/her own board. You will create a one-player game, where the program places battleships on a board and the user is the opponent trying to sink them. Your program must be able to create a new board, place the ships as specified in a file, be able to fire missiles at the user-specified the locations, and keep track of the game's state. The ships cannot be placed off the board or on top of each other. Game statistics must be kept throughout the game, including keeping track of the number of hits and misses, the total number of missiles fired, and the number of ships sunk. Command Line The game shall be started as follows: java Battleship N filename The value N represents the dimensions of the board. Since a board is always square, there are N columns and N rows. (For a board of size N, the legal row and column coordinates are 0 to N-1.) Because single letters will be used to label the rows and columns of the board, the maximum size allowed will be 26. For example, with N=10, the range of letters will be A-J. Input Format The filename is the name of a file whose first line contains the number of ships, followed by one line each for each ship position, in the following format: startrow startcolumn endrow endcolumn startrow and startcol are each single letters which specify the starting position of the ship. endrow and endcol are each single letters which specify the ending position of the ship. For this project, you are guaranteed that the orientation of the ships will be either horizontal or vertical (no diagonals). You will also be guaranteed that the file will contain no more than 26 ships, for output purposes. An example input file can be found here. Example If a board size of 10 has been specified and the input file contains the following:
3 2 C C C E D E H E then the initial board setup would be as follows: A C - - A A A D B E B F B G B H B (More on output format later.) If any errors occur in the data used by the game upon startup, an error message must be printed on standard error and the program halted. Here is a table of possible error situations and the messages displayed as a consequence. error Illegal number of arguments* message to be displayed (all terminate with a new line) Usage: java Battleship N config-file 1 st command line argument is not an integer* Usage: java Battleship N config-file 1 st command line argument < 5* Board must be at least 5 by 5. 1 st command line argument > 26* Board must be at most 26 by 26. File named by second argument cannot be opened. Specifications of ships cause them to overlap. Specifications of ships extend beyond the boundaries of the board. Cannot open file filename. Fig. 1: Error Situations and Messages *required for minimum submission Overlapping or out-of-bounds ships in file filename. Overlapping or out-of-bounds ships in file filename. The first thing that happens after the program is started is that the board layout is displayed as if the user had typed "board". The user will then be prompted for a command by displaying "> " on a new line. The commands are as follows: Command Description Print out the placement of the water and missiles on the board. Water must be marked with a hyphen: -
4 Each previous fired missile destination must be marked with either an X or an O signifying a hit or a miss, respectively. board This printout must not show the placement of the ships. For the precise format of the output, see the Output Format section later in this document. Note that you must allow for a single letter for the row and column, separated by a single space. Print out the placement of the ships on the board. Water must be marked with a hyphen: - ships Each ship must be represented by a letter corresponding to its position in the input file. For example, the first ship should be marked as A, the second ship as B, and so on. This printout must not show the placement of the missiles. For the precise format of the output, see the Output Format section later in this document. Note that you must allow for a single letter for the row and column, separated by a single space. Fire a missile at the square at the given row and column. Both coordinates will be given as single letters separated by a single space. The status of the missile must be changed depending on if it is a hit or a miss at the current spot on the board. If there is a missile already there, the user will get the error message "Coordinates previously fired upon." on standard output. If the coordinates are out of range, the user will get the error message "Illegal coordinates." on standard output. fire row col If the missile hits a part of the sea, the user will get the message "Miss!" on standard output. If the missile hits a part of a ship, the user will get the message "Hit!" on standard output. If the missile hits a part of a ship, causing it to sink, the user will get the message "Sunk!" on standard output. If the wrong number of arguments is provided, or the row and columns specified are not letters in the valid range, the user will get the error message "Illegal coordinates." Afterwards the program will behave as if "board" had been entered by the user. If, after a "fire" command, all the battleships are sunk, the game will display, on a separate line: You win!
5 After a win has been determined, the program will behave as if the commands "stats" and "quit" have been entered. stats help quit garbage Print the number of missiles fired, the number of hits, the number of misses, the hit ratio percentage, and the number of ships sunk. When computing the percentage for the hit ratio, perform the operation as: percentage = * numberofhits / totalmissilesfired Displays the following usage message: Possible commands: board - displays the user's board ships - displays the placement of the ships fire r c - fires a missile at the cell at [r,c] stats - prints out the game statistics quit - exits the game Exit the program. A blank command, or a command with just whitespace, should quietly cause a reprompting. If any other command is entered, the user will get the error message "Illegal command." on standard output. Fig. 2: User Command Input Semantics Output Format When the board is printed, it will be printed as a grid. Rows are horizontal, increasing in coordinates downward, and columns are vertical, increasing in coordinates to the right. Column letters are displayed above the first row starting with "A" as the first column and incrementing thereafter. Row letters are displayed to the left of the first column, starting with "A" as the first column and incrementing thereafter. Un-fired-upon water is indicated with a hyphen. Water that has been fired upon is indicated with the letter "O". Un-fired-upon ship locations are indicated by their position in the input file, "A" for the first, "B" for second, and so on. Ship locations that have been hit by a missile are marked with an "X". All items displayed are placed in a 2-space field, left-justified. rev1.7 - For the last column, you should not print an extra space after it. An example output with correct spacing can be found here. Project Design You are required to use three technologies when designing this project: inheritance, exceptions, and file input. Uses of Inheritance 1. [Required] You shall use several different classes to represent the current contents of a cell on the board. For example, the board can be be composed of abstract Cell references, which is then populated with instances of concerete subclasses such as Water, ShipSection (OK or damaged), or MissedMissile.
6 2. [Optional] Use several different classes to represent the actions of the six user commands. Populate a container with associations between instances of these new classes and the string name of the first word in each command listed in Figure 2. When the user types something in, a command is looked up and executed. Use of Exceptions Should an error occur that cannot be handled at the point of detection in the code, an exception should be raised and caught somewhere where the program can gracefully handle it or terminate. For example, you will likely want to use exceptions to deal with file input errors. You may define your own exception classes. Use of System.exit( int ) for any purpose is forbidden in this project. Sample Run As you follow the sample run below, assume that the file input-2.2 contains the following data: 5 D H H H C B F B C D C F H D I D F C F D Any text that the user types in is shown in this way. %java Battleship 10 input-2.2 A C D E F G H > ships A C - B - C C C D - B A - - E - B A - - F - B E E A - - G A - - H D A - - I D > fire Illegal coordinates. > fire A Z Illegal coordinates.
7 > fire A A Miss! A O C D E F G H > fire F C Hit! A O C D E F - - X G H > fire F D Hit! Sunk! A O C D E F - - X X G H > ships A C - B - C C C D - B A - - E - B A - - F - B E E A - - G A - - H D A - - I D > stats Number of missiles fired: 3 Number of hits: 2 Number of misses: 1 Hit ratio: % Number of ships sunk: 1 > help Possible commands:
8 board - displays the user's board ships - displays the placement of the ships fire r c - fires a missile at the cell at [r,c] stats - prints out the game statistics quit - exits the game > abacab Illegal command. > > quit Project Submission Minimal Submission In order to meet minimum submission qualifications you must submit the following: Your Battleship class: It must contain a main program that error-checks the command line arguments. The board size must be correct, and the user must specify some input file. You do not need to verify the existence of the input file for this part. In order to verify the board size, you will have to use exceptions so that you can guarantee the argument is a number. Your abstract class or interface for the objects that will be placed on the board. Your concrete class that represents empty water in a board Code that creates the board and populates all the cells with water. Code that responds to a "board" command and displays the board with the water cells. Code that responds to a "quit" command and terminates the program. Code that reprompts correctly, and can handle blank user commands. When you have these classes working to the standard set by your professor, submit all your source code using the following command: try 232-grd project1-min Battleship.java... The ellipsis ("...") means that you may submit as many other java files as your design requires. Final Submission When you are satisfied and confident that your project meets final submission standards, submit all your source code using the following command: try 232-grd project1 Battleship.java... $Id: writeup.html,v /01/08 16:57:56 vcss232 Exp vcss232 $
CIT 590 Homework 10 Battleship
CIT 590 Homework 10 Battleship Purposes of this assignment: To give you more experience with classes and inheritance General Idea of the Assignment Once again, this assignment is based on a game, since
More informationCMSC 201 Spring 2018 Project 2 Battleship
CMSC 201 Spring 2018 Project 2 Battleship Assignment: Project 2 Battleship Due Date: Design Document: Friday, April 13th, 2018 by 8:59:59 PM Project: Friday, April 20th, 2018 by 8:59:59 PM Value: 80 points
More informationMobile Application Programming: ios
Mobile Application Programming: ios CS4962 Fall 2014 Project 4 - Network MVC Battleship Due: 11:59PM Monday, Nov 17 Abstract Build a Model-View-Controller implementation of the game Battleship on Android.
More informationDecision Logic: if, if else, switch, Boolean conditions and variables
CS 1044 roject 4 Summer I 2007 Decision Logic: if, if else, switch, Boolean conditions and variables This programming assignment uses many of the ideas presented in sections 3 through 5 of the course notes,
More information4. Use a loop to print the first 25 Fibonacci numbers. Do you need to store these values in a data structure such as an array or list?
1 Practice problems Here is a collection of some relatively straightforward problems that let you practice simple nuts and bolts of programming. Each problem is intended to be a separate program. 1. Write
More informationMobile Application Programming: Android
Mobile Application Programming: Android CS4530 Fall 2016 Project 4 - Networked Battleship Due: 11:59PM Monday, Nov 7th Abstract Extend your Model-View-Controller implementation of the game Battleship on
More informationCS61B Lecture #35. [The Lecture #32 notes covered lectures #33 and #34.] Today: Enumerated types, backtracking searches, game trees.
CS61B Lecture #35 [The Lecture #32 notes covered lectures #33 and #34.] Today: Enumerated types, backtracking searches, game trees. Coming Up: Graph Structures: DSIJ, Chapter 12 Last modified: Mon Nov
More informationCSci 1113: Introduction to C/C++ Programming for Scientists and Engineers Homework 10 Spring 2018
CSci 1113: Introduction to C/C++ Programming for Scientists and Engineers Homework 10 Spring 2018 Due Date: Thursday, May 3, 2018 before 11:55pm. Instructions: This is an individual homework assignment.
More informationProject #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently.
Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently. User Request: Create a simple magazine data system. Milestones:
More informationProgramming assignment A
Programming assignment A ASCII Minesweeper Official release on Feb 14 th at 1pm (Document may change before then without notice) Due 5pm Feb 25 th Minesweeper is computer game that was first written in
More informationEvil Hangman Project
Evil Hangman Project Program Description: Evil Hangman is a program that actively cheats at Hangman. Instead of choosing a single word that the player tries to guess, the program maintains a set of words
More informationCSCI 204 Introduction to Computer Science II
CSCI 204 Project 2 Maze Assigned: Wednesday 09/27/2017 First Phase (Recursion) Due Friday, 10/06/2017 Second Phase (Stack) Due Monday, 10/16/2017 1 Objective The purpose of this assignment is to give you
More informationLab 1: Silver Dollar Game 1 CSCI 2101B Fall 2018
Lab 1: Silver Dollar Game 1 CSCI 2101B Fall 2018 Due: Tuesday, September 18, 11:59 pm Collaboration Policy: Level 1 (review full policy for details) Group Policy: Individual This lab will give you experience
More informationProject 1 Computer Science 2334 Spring 2016 This project is individual work. Each student must complete this assignment independently.
Project 1 Computer Science 2334 Spring 2016 This project is individual work. Each student must complete this assignment independently. User Request: Create a simple movie data system. Milestones: 1. Use
More informationProgramming Project 1
Programming Project 1 Handout 6 CSCI 134: Fall, 2016 Guidelines A programming project is a laboratory that you complete on your own, without the help of others. It is a form of take-home exam. You may
More informationThis homework has an opportunity for substantial extra credit, which is described at the end of this document.
CS 2316 Pair Homework Box Packer Due: Tuesday, June 17th, before 11:55 PM Out of 100 points Files to submit: 1. boxpacker.py For Help: - TA Helpdesk Schedule posted on class website. - Email TA's or use
More informationFall CSEE W4119 Computer Networks Programming Assignment 1 - Simple Online Bidding System
Fall 2012 - CSEE W4119 Computer Networks Programming Assignment 1 - Simple Online Bidding System Prof. Gil Zussman due: Wed. 10/24/2012, 23:55 EST 1 Introduction In this programming assignment, you are
More informationa f b e c d Figure 1 Figure 2 Figure 3
CS2604 Fall 2001 PROGRAMMING ASSIGNMENT #4: Maze Generator Due Wednesday, December 5 @ 11:00 PM for 125 points Early bonus date: Tuesday, December 4 @ 11:00 PM for 13 point bonus Late date: Thursday, December
More informationProject 2 - MapQuest Routing Problem
Project 2 - Shortest Path Problem http://www.cs.rit.edu/~vcss233/projects/02.20063/index.html Page 1 of 2 5/23/2007 Overview Project 2 - MapQuest Routing Problem Initial submission due: Sunday, April 29th
More informationBe sure check the official clarification thread for corrections or updates to this document or to the distributed code.
Com S 228 Spring 2011 Programming Assignment 1 Part 1 (75 points): Due at 11:59 pm, Friday, January 28 Part 2 (225 points): Due at 11:59 pm, Monday, February 7 This assignment is to be done on your own.
More informationCS 201 Advanced Object-Oriented Programming Lab 6 - Sudoku, Part 2 Due: March 10/11, 11:30 PM
CS 201 Advanced Object-Oriented Programming Lab 6 - Sudoku, Part 2 Due: March 10/11, 11:30 PM Introduction to the Assignment In this lab, you will finish the program to allow a user to solve Sudoku puzzles.
More informationToday in CS161. Lecture #12 Arrays. Learning about arrays. Examples. Graphical. Being able to store more than one item using a variable
Today in CS161 Lecture #12 Arrays Learning about arrays Being able to store more than one item using a variable Examples Tic Tac Toe board as an array Graphical User interaction for the tic tac toe program
More information3. A Periodic Alarm: intdate.c & sigsend.c
p6: Signal Handling 1. Logistics 1. This project must be done individually. It is academic misconduct to share your work with others in any form including posting it on publicly accessible web sites, such
More informationIn either case, remember to delete each array that you allocate.
CS 103 Path-so-logical 1 Introduction In this programming assignment you will write a program to read a given maze (provided as an ASCII text file) and find the shortest path from start to finish. 2 Techniques
More informationActivity: page 1/10 Introduction to Excel. Getting Started
Activity: page 1/10 Introduction to Excel Excel is a computer spreadsheet program. Spreadsheets are convenient to use for entering and analyzing data. Although Excel has many capabilities for analyzing
More informationLab 4: Super Sudoku Solver CSCI 2101 Fall 2017
Due: Wednesday, October 18, 11:59 pm Collaboration Policy: Level 1 Group Policy: Pair-Optional Lab 4: Super Sudoku Solver CSCI 2101 Fall 2017 In this week s lab, you will write a program that can solve
More informationCS 100 Programming I Project 2
CS 100 Programming I Project 2 Revision Date: January 8, 2017 Preamble This is your third Python assignment. You may develop your code on your USB-stick (or anywhere else), but you must ensure it runs
More informationSenet. Language Reference Manual. 26 th October Lilia Nikolova Maxim Sigalov Dhruvkumar Motwani Srihari Sridhar Richard Muñoz
Senet Language Reference Manual 26 th October 2015 Lilia Nikolova Maxim Sigalov Dhruvkumar Motwani Srihari Sridhar Richard Muñoz 1. Overview Past projects for Programming Languages and Translators have
More informationAssignment #4 Minesweeper
Assignment #4 Minesweeper Date assigned: Friday, January 9, 2015 Date due: Java Minesweeper, Tuesday, January 13, 2015 Android Minesweeper, Friday, January 17, 2015 Points: 100 Java Minesweeper The game
More informationLesson 12: Preparing for Post Processing
12 Lesson 12: Preparing for Post Processing Learning Objectives In this lesson you will: Rename reference designators on the board design Backannotate changes made in the OrCAD and Allegro PCB Editor to
More informationYou must pass the final exam to pass the course.
Computer Science Technology Department Houston Community College System Department Website: http://csci.hccs.cc.tx.us CRN: 46876 978-1-4239-0146-4 1-4239-0146-0 Semester: Fall 2010 Campus and Room: Stafford
More informationCE151 ASSIGNMENT
Set by: Mike Sanderson Credit: 20% of total module mark Deadline: 11.59.59, Monday 8 December Submission of this assignment will be via the online submission system; your programs may be tested during
More informationCS 3360 Design and Implementation of Programming Languages. Exam 1
1 Spring 2017 (Thursday, March 9) Name: CS 3360 Design and Implementation of Programming Languages Exam 1 This test has 8 questions and pages numbered 1 through 7. Reminders This test is closed-notes and
More informationCMPSC 111 Introduction to Computer Science I Fall 2016 Lab 8 Assigned: October 26, 2016 Due: November 2, 2016 by 2:30pm
1 CMPSC 111 Introduction to Computer Science I Fall 2016 Lab 8 Assigned: October 26, 2016 Due: November 2, 2016 by 2:30pm Objectives To enhance your experience with designing and implementing your own
More information2005 Stanford Local Programming Contest
2005 Stanford Local Programming Contest Saturday, October 8, 2005 Rules Read these guidelines carefully! 1. You may use resource materials such as books, manuals, and program listings. You may not search
More informationMajor Assignment: Pacman Game
Major Assignment: Pacman Game 300580 Programming Fundamentals Week 10 Assignment The major assignment involves producing a Pacman style game with Clara using the Greenfoot files that are given to you.
More informationAssignment Checklist. Prelab Activities. Lab Exercises. Labs Provided by Instructor. Postlab Activities. Section:
7 Arrays Now go, write it before them in a table, and note it in a book. Isaiah 30:8 To go beyond is as wrong as to fall short. Confucius Begin at the beginning, and go on till you come to the end: then
More informationCS 116. Lab Assignment # 1 1
Points: 2 Submission CS 116 Lab Assignment # 1 1 o Deadline: Friday 02/05 11:59 PM o Submit on Blackboard under assignment Lab1. Please make sure that you click the Submit button and not just Save. Late
More informationInformatics 2D. Coursework 1: Search and Games
Informatics 2D. Coursework 1: Search and Games Stefanie Speichert, Vaishak Belle January 30, 2019 1 Introduction The objective of this assignment is to help you understand the various search algorithms
More informationChapter 4 Determining Cell Size
Chapter 4 Determining Cell Size Chapter 4 Determining Cell Size The third tutorial is designed to give you a demonstration in using the Cell Size Calculator to obtain the optimal cell size for your circuit
More informationPOFT 2301 INTERMEDIATE KEYBOARDING LECTURE NOTES
INTERMEDIATE KEYBOARDING LECTURE NOTES Be sure that you are reading the textbook information and the notes on the screen as you complete each part of the lessons in this Gregg Keyboarding Program (GDP).
More informationComputer Science E-50a: Introduction to Computer Science Using Java, I Handout #7 part 2
Computer Science E-50a: Introduction to Computer Science Using Java, I Handout #7 part 2 part 2 These problems are due prior to the start of lecture on Monday night, March 31. Part A The Reading You may
More informationCSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Project 1 (document version 1.3) Process Simulation Framework
CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Project 1 (document version 1.3) Process Simulation Framework Overview This project is due by 11:59:59 PM on Thursday, October 20, 2016.
More informationEE355 Lab 5 - The Files Are *In* the Computer
1 Introduction In this lab you will modify a working word scramble game that selects a word from a predefined word bank to support a user-defined word bank that is read in from a file. This is a peer evaluated
More informationCMPSCI 187 / Spring 2015 Hangman
CMPSCI 187 / Spring 2015 Hangman Due on February 12, 2015, 8:30 a.m. Marc Liberatore and John Ridgway Morrill I N375 Section 01 @ 10:00 Section 02 @ 08:30 1 CMPSCI 187 / Spring 2015 Hangman Contents Overview
More informationCS1132 Spring 2016 Assignment 2 Due Apr 20th
CS1132 Spring 2016 Assignment 2 Due Apr 20th Adhere to the Code of Academic Integrity. You may discuss background issues and general strategies with others and seek help from course staff, but the implementations
More informationECSE 321 Assignment 2
ECSE 321 Assignment 2 Instructions: This assignment is worth a total of 40 marks. The assignment is due by noon (12pm) on Friday, April 5th 2013. The preferred method of submission is to submit a written
More informationOur second exam is Thursday, November 10. Note that it will not be possible to get all the homework submissions graded before the exam.
Com S 227 Fall 2016 Assignment 3 300 points Due Date: Wednesday, November 2, 11:59 pm (midnight) Late deadline (25% penalty): Thursday, November 2, 11:59 pm General information This assignment is to be
More informationCS 103 Lab The Files are *In* the Computer
CS 103 Lab The Files are *In* the Computer 1 Introduction In this lab you will modify a word scramble game so that instead of using a hardcoded word list, it selects a word from a file. You will learn
More informationG5-20 Introduction to Slides
WORKBOOK 5:2 PAGE 317 G5-20 Introduction to Slides GOALS Students will slide a dot on a grid. PRIOR KNOWLEDGE REQUIRED Ability to count Distinguish between right and left VOCABULARY slide For this lesson,
More informationCmpSci 187: Programming with Data Structures Spring 2015
CmpSci 187: Programming with Data Structures Spring 2015 Lecture #9 John Ridgway February 26, 2015 1 Recursive Definitions, Algorithms, and Programs Recursion in General In mathematics and computer science
More informationECE15: Lab #4. Problem 1. University of California San Diego
University of California San Diego ECE15: Lab #4 This lab is a cumulative wrap-up assignment for the entire course. As such, it relates to the material covered in Lecture Units 1 5 and 7 9 in class. Here
More informationCS 134 Programming Exercise 9:
CS 134 Programming Exercise 9: Nibbles Objective: To gain experience working with 2 dimensional arrays. The Problem Nibbles is a snake. Nibbles moves around a field, looking for food. Unfortunately, Nibbles
More informationIntegers and the Coordinate Plane
Name Date Class 9A Dear Family, A Family Letter: Understanding Integers The student will begin the study of an important set of numbers called integers. Integers are the set of numbers that include all
More informationCS 210 Fundamentals of Programming I Spring 2015 Programming Assignment 4
CS 210 Fundamentals of Programming I Spring 2015 Programming Assignment 4 20 points Out: February 18/19, 2015 Due: February 25/26, 2015 Reminder: This is a programming assignment, and work on this assignment
More informationCS1 Studio Project: Connect Four
CS1 Studio Project: Connect Four Due date: November 8, 2006 In this project, we will implementing a GUI version of the two-player game Connect Four. The goal of this project is to give you experience in
More informationCS3 Midterm 1 Fall 2006
Overall, you did good job on this exam. CS3 Midterm 1 Fall 2006 Standards and Solutions 20 10 0 8.0 30.0 28.0 26.0 24.0 22.0 20.0 18.0 16.0 14.0 12.0 10.0 Std. Dev = 5.34 Mean = 21.6 N = 133.00 MT1_SCL
More informationReview! * follows a pointer to its value! & gets the address of a variable! Pearce, Summer 2010 UCB! ! int x = 1000; Pearce, Summer 2010 UCB!
CS61C L03 Introduction to C (pt 2) (1)! inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 3 Introduction to C (pt 2) 2010-06-23!!!Instructor Paul Pearce! The typical! development cycle!
More informationProject 2 - A Simple Chat Program
Project 2 - A Simple Chat Program Minimum Effort Due: (Part 1) 2/11/2007 (Sunday) Complete Project Due: (Part 2) 2/23/2007 (Friday) Late Project Due: (Last Chance) 2/24/2007 (Saturday) Overview In this
More informationCS61C Machine Structures. Lecture 4 C Pointers and Arrays. 1/25/2006 John Wawrzynek. www-inst.eecs.berkeley.edu/~cs61c/
CS61C Machine Structures Lecture 4 C Pointers and Arrays 1/25/2006 John Wawrzynek (www.cs.berkeley.edu/~johnw) www-inst.eecs.berkeley.edu/~cs61c/ CS 61C L04 C Pointers (1) Common C Error There is a difference
More informationCS100M November 30, 2000
CS00M November 30, 2000 Makeup Solutions 7:30 PM 9:30 PM (Print last name, first name, middle initial/name) (Student ID) Statement of integrity: I did not, and will not, break the rules of academic integrity
More informationProgramming Assignment 2 (PA2) - DraggingEmoji & ShortLongWords
Programming Assignment 2 (PA2) - DraggingEmoji & ShortLongWords Due Date: Wednesday, October 10 @ 11:59 pm Assignment Overview Grading Gathering Starter Files Program 1: DraggingEmoji Program 2: ShortLongWords
More informationPractical 2: Using Minitab (not assessed, for practice only!)
Practical 2: Using Minitab (not assessed, for practice only!) Instructions 1. Read through the instructions below for Accessing Minitab. 2. Work through all of the exercises on this handout. If you need
More informationUsing Scantron ParLAN 6.5 for the First Time:
Page 1 of 19 Using Scantron ParLAN 6.5 for the First Time: Last updated: Monday, December 02, 2013 Nine Basic Steps To request a Scantron Account, please contact the Academic Technology Center. Step One:
More informationCS 2704 Project 3 Spring 2000
Maze Crawler For this project, you will be designing and then implementing a prototype for a simple game. The moves in the game will be specified by a list of commands given in a text input file. There
More informationCS 106A, Lecture 27 Final Exam Review 1
CS 106A, Lecture 27 Final Exam Review 1 This document is copyright (C) Stanford Computer Science and Marty Stepp, licensed under Creative Commons Attribution 2.5 License. All rights reserved. Based on
More informationCheck out how to use the random number generator (introduced in section 4.11 of the text) to get a number between 1 and 6 to create the simulation.
Chapter 4 Lab Loops and Files Lab Objectives Be able to convert an algorithm using control structures into Java Be able to write a while loop Be able to write an do-while loop Be able to write a for loop
More informationIntroduction to Java Applications
2 Introduction to Java Applications OBJECTIVES In this chapter you will learn: To write simple Java applications. To use input and output statements. Java s primitive types. Basic memory concepts. To use
More informationTURN IT IN
TURN IT IN http://www.turnitin.com/ 1 plagiarism TURN IT IN PLAGIARISM PREVENTION 1. a piece of writing that has been copied from someone else and is presented as being your own work 2. the act of plagiarizing;
More informationCS164: Programming Assignment 5 Decaf Semantic Analysis and Code Generation
CS164: Programming Assignment 5 Decaf Semantic Analysis and Code Generation Assigned: Sunday, November 14, 2004 Due: Thursday, Dec 9, 2004, at 11:59pm No solution will be accepted after Sunday, Dec 12,
More informationHomework 8: Matrices Due: 11:59 PM, Oct 30, 2018
CS17 Integrated Introduction to Computer Science Klein Homework 8: Matrices Due: 11:59 PM, Oct 30, 2018 Contents 1 Reverse (Practice) 4 2 Main Diagonal (Practice) 5 3 Horizontal Flip 6 4 Vertical Flip
More informationIT115: Introduction to Java Programming 1. IT115: Introduction to Java Programming. Tic Tac Toe Application. Trina VanderLouw
IT115: Introduction to Java Programming 1 IT115: Introduction to Java Programming Tic Tac Toe Application Trina VanderLouw Professor Derek Peterson Colorado Technical University Online October 28, 2011
More informationCS159 Midterm #1 Review
Name: CS159 Midterm #1 Review 1. Choose the best answer for each of the following multiple choice questions. (a) What is the effect of declaring a class member to be static? It means that the member cannot
More informationCS : Programming for Non-majors, Fall 2018 Programming Project #2: Census Due by 10:20am Wednesday September
CS 1313 010: Programming for Non-majors, Fall 2018 Programming Project #2: Census Due by 10:20am Wednesday September 19 2018 This second assignment will introduce you to designing, developing, testing
More informationCPSC 217 Assignment 3
CPSC 217 Assignment 3 Due: Monday November 23, 2015 at 12:00 noon Weight: 7% Sample Solution Length: 135 lines, including some comments (not including the provided code) Individual Work: All assignments
More informationCS61C : Machine Structures
inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 4 C Pointers 2004-09-08 Lecturer PSOE Dan Garcia www.cs.berkeley.edu/~ddgarcia Cal flies over Air Force We re ranked 13 th in the US and
More informationLecture 14 CSE11 Fall 2013 For loops, Do While, Break, Continue
Lecture 14 CSE11 Fall 2013 For loops, Do While, Break, Continue General Loops in Java Look at other loop constructions Very common while loop: do a loop a fixed number of times (MAX in the example) int
More informationMICROSOFT OFFICE APPLICATIONS
MICROSOFT OFFICE APPLICATIONS EXCEL 2016 : LOOKUP, VLOOKUP and HLOOKUP Instructor: Terry Nolan terry.nolan@outlook.com Friday, April 6, 2018 1 LOOKUP FUNCTIONS WHAT ARE LOOKUP FUNCTIONS USUALLY USED FOR?
More informationTwelfth Annual Ohio Wesleyan University Programming Contest April 7, 2018 Rules: 1. There are six questions to be completed in four hours. 2.
Twelfth Annual Ohio Wesleyan University Programming Contest April 7, 2018 Rules: 1. There are six questions to be completed in four hours. 2. All questions require you to read the test data from standard
More informationLAB 5: SELECTION STATEMENTS
Statement Purpose: The purpose of this lab is to familiarize students with Conditional statements and explain how to control the sequence of statement execution, depending on the value of an expression
More informationRemaining Enhanced Labs
Here are some announcements regarding the end of the semester, and the specifications for the last Enhanced Labs. Don t forget that you need to take the Common Final Examination on Saturday, May 5, from
More informationCom S 227 Spring 2018 Assignment points Due Date: Thursday, September 27, 11:59 pm (midnight) "Late" deadline: Friday, September 28, 11:59 pm
Com S 227 Spring 2018 Assignment 2 200 points Due Date: Thursday, September 27, 11:59 pm (midnight) "Late" deadline: Friday, September 28, 11:59 pm (Remember that Exam 1 is MONDAY, October 1.) General
More informationCMSC 201 Spring 2018 Project 3 Minesweeper
CMSC 201 Spring 2018 Project 3 Minesweeper Assignment: Project 3 Minesweeper Due Date: Design Document: Friday, May 4th, 2018 by 8:59:59 PM Project: Friday, May 11th, 2018 by 8:59:59 PM Value: 80 points
More informationCS 1044 Program 6 Summer I dimension ??????
Managing a simple array: Validating Array Indices Most interesting programs deal with considerable amounts of data, and must store much, or all, of that data on one time. The simplest effective means for
More informationSchool of Computer Science CPS109 Course Notes Set 7 Alexander Ferworn Updated Fall 15 CPS109 Course Notes 7
CPS109 Course Notes 7 Alexander Ferworn Unrelated Facts Worth Remembering The most successful people in any business are usually the most interesting. Don t confuse extensive documentation of a situation
More informationLearning objec-ves. Declaring and ini-alizing 2D arrays. Prin-ng 2D arrays. Using 2D arrays Decomposi-on of a solu-on into objects and methods
Learning objec-ves 2D Arrays (Savitch, Chapter 7.5) TOPICS Using 2D arrays Decomposi-on of a solu-on into objects and methods Multidimensional Arrays 2D Array Allocation 2D Array Initialization TicTacToe
More informationCSE 142 Su01 Final Exam Sample Solution page 1 of 7
CSE 142 Su01 Final Exam Sample Solution page 1 of 7 Answer all of the following questions. READ EACH QUESTION CAREFULLY. Answer each question in the space provided on these pages. Budget your time so you
More informationECE15: Lab #3. Problem 1. University of California San Diego ( 1) + x4. + x8 + (1)
University of California San Diego ECE15: Lab #3 This lab relates specifically to the material covered in Lecture Units 6 and 7 in class, although it assumes knowledge of the previous Lecture Units as
More informationCMPSCI 187 / Spring 2015 Sorting Kata
Due on Thursday, April 30, 8:30 a.m Marc Liberatore and John Ridgway Morrill I N375 Section 01 @ 10:00 Section 02 @ 08:30 1 Contents Overview 3 Learning Goals.................................................
More informationProgramming Project 5: NYPD Motor Vehicle Collisions Analysis
: NYPD Motor Vehicle Collisions Analysis Due date: Dec. 7, 11:55PM EST. You may discuss any of the assignments with your classmates and tutors (or anyone else) but all work for all assignments must be
More informationAP Computer Science A 2013 Free-Response Questions
AP Computer Science A 2013 Free-Response Questions About the College Board The College Board is a mission-driven not-for-profit organization that connects students to college success and opportunity. Founded
More informationHomework 1. Notes. What To Turn In. Unix Accounts. Reading. Handout 3 CSCI 334: Spring, 2017
Homework 1 Due 14 February Handout 3 CSCI 334: Spring, 2017 Notes This homework has three types of problems: Self Check: You are strongly encouraged to think about and work through these questions, but
More informationCS 1803 Pair Homework 3 Calculator Pair Fun Due: Wednesday, September 15th, before 6 PM Out of 100 points
CS 1803 Pair Homework 3 Calculator Pair Fun Due: Wednesday, September 15th, before 6 PM Out of 100 points Files to submit: 1. HW3.py This is a PAIR PROGRAMMING Assignment: Work with your partner! For pair
More informationMobile Computing Professor Pushpendra Singh Indraprastha Institute of Information Technology Delhi Java Basics Lecture 02
Mobile Computing Professor Pushpendra Singh Indraprastha Institute of Information Technology Delhi Java Basics Lecture 02 Hello, in this lecture we will learn about some fundamentals concepts of java.
More informationAccount Settings. Private Messages. Reporting Abuse. Create a Ladder. Ladder Admin Guide. Ladd Admin Guide - Quick Challenge / Result
User Manual 1 2 3 General 1.1 Sign Up 5 1.2 Set HomePage 11 1.3 Profile 15 1.4 Account Settings 21 1.5 Private Messages 26 1.6 Reporting Abuse 31 1.7 Privacy 33 Ladders 2.1 Create a Ladder 36 2.2 Ladder
More informationIntroduction to computer science C language Homework 4 Due Date: Save the confirmation code that will be received from the system
Introduction to computer science C language Homework 4 Due Date: 20.12.2017 Save the confirmation code that will be received from the system Submission Instructions : Electronic submission is individual.
More informationCSC148 Summer 2018: Assignment 1
CSC148 Summer 2018: Assignment 1 Due: Sunday, June 17th @ 11PM Overview In this assignment, you'll be implementing a Battle Game. This game consists of two types of characters which can perform various
More informationInitial Coding Guidelines
Initial Coding Guidelines ITK 168 (Lim) This handout specifies coding guidelines for programs in ITK 168. You are expected to follow these guidelines precisely for all lecture programs, and for lab programs.
More informationCS61C : Machine Structures
inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 3 Introduction to C (pt 2) 2010-06-23! C help session: Tonight 7:00-9:00pm @ 306 Soda!!!Instructor Paul Pearce! The typical! development
More informationDATA STRUCTURES USING C
DATA STRUCTURES USING C Lecture-7 Data Structures Lecture Objectives After studying this chapter, the student should be able to: Define a data structure. Define an array as a data structure and how it
More information