The SECOND Meeting Or: How I learned exciting new things in CS Club.

Slides:



Advertisements
Similar presentations
Intro to CIT 594
Advertisements

Welcome to CodeWarmers!
Intro to USACO Strategy
Algorithms and Problem Solving
©2004 Brooks/Cole Chapter 3 Interactive Input. Figures ©2004 Brooks/Cole CS 119: Intro to JavaFall 2005 Standard Input and Output System.in Is Used to.
June 1, 2000 Object Oriented Programming in Java (95-707) Java Language Basics 1 Lecture 4 Object Oriented Programming in Java Class Design Process.
Class Decimal Format ► Import package java.text ► Create DecimalFormat object and initialize ► Use method format ► Example: import java.text.DecimalFormat.
1 Scanner objects. 2 Interactive programs We have written programs that print console output. It is also possible to read input from the console.  The.
Announcements Quiz 2 Grades Posted on blackboard.
CS 241 – Computer Programming II Lab Kalpa Gunaratna –
CS 240 – Computer Programming I Lab Kalpa Gunaratna –
Building Java Programs Chapter 5 Program Logic and Indefinite Loops Copyright (c) Pearson All rights reserved.
Moooooo Or: How I learned to stop worrying and love USACO.
1 Java Console I/O Introduction. 2 Java I/O You may have noticed that all the I/O that we have done has been output The reasons –Java I/O is based on.
CS1010E Programming Methodology Tutorial 1 Basic Data Type and Input/output, Characters and Problem Solving C14,A15,D11,C08,C11,A02.
Array Cs212: DataStructures Lab 2. Array Group of contiguous memory locations Each memory location has same name Each memory location has same type a.
Please sign in on the sign up sheet MTH Computer Science Club.
20 Oct - Overview Homework #1 Group-Id rule Notes on Java text file input/output –Scanner class –Printf (like C)
File Input/Output. 2Java Programming: From Problem Analysis to Program Design, 3e File Input/Output File: area in secondary storage used to hold information.
JAVA PROGRAMMING BASICS CHAPTER 2. History of Java Begin with project Green in 1991 founded by Patrick Noughton, Mike Sheridan and James Gosling who worked.
Principles of Computer Science I Honors Section Note Set 1 CSE 1341 – H 1.
Copyright © 2012 Pearson Education, Inc. Chapter 6 More Conditionals and Loops Java Software Solutions Foundations of Program Design Seventh Edition John.
Recursive Problem 1 Write a java class named my_WordReverse using recursion. It takes a sentence and returns the sentence in reverse order. Note: Space.
Advanced Computer Science Lesson 4: Reviewing Loops and Arrays Reading User Input.
Java 1.5 The New Java Mike Orsega Central Carolina CC.
Data Structures and Algorithm Analysis Introduction Lecturer: Ligang Dong, egan Tel: , Office: SIEE Building.
CHAPTER 5 GC 101 Input & Output 1. INTERACTIVE PROGRAMS  We have written programs that print console output, but it is also possible to read input from.
The SECOND Meeting Or: How I learned exciting new things in CS Club.
Intro to CIT 594
Lab 1 Logbook ADT. OVERVIEW A monthly logbook consists of a set of entries, one for each day of the month.
Click to add title Click to add lame programming pun.
CS 240 – Computer Programming I Lab Kalpa Gunaratna –
Not a Math Honor Society meeting. Or: How I learned to do math again, this time with cows.
1 CS 101 Today’s class will begin about 5 minutes late We will discuss the lab scheduling problems once class starts.
CSI 3125, Preliminaries, page 1 Java I/O. CSI 3125, Preliminaries, page 2 Java I/O Java I/O (Input and Output) is used to process the input and produce.
BHCSI Programming Contests. Three contests Mock Contest #1  Friday, July 16 th  2:15 – 4:45pm UCF High School Online Contest  Thursday, July 22 nd.
I/O Basics Java does provide strong, flexible support for I/O related to files and networks. Java’s console based interaction is limited since in real.
CPRG 215 Introduction to Object-Oriented Programming with Java Module 2- Using Java Built-in Classes Topic 2.6 Reading Input with java.io Produced by Harvey.
Java Input/Output. Java Input/output Input is any information that is needed by your program to complete its execution. Output is any information that.
Keyboard and Screen I/O (Input/Output). Screen Output  System.out is an object that is part of the Java language. (Don’t worry yet about why there is.
import java.util.Scanner; class myCode { public static void main(String[] args) { Scanner input= new Scanner(System.in); int num1; System.out.println(“Enter.
Java Input and Output. Java Input  Input is any information needed by your program to complete its execution  So far we have been using InputBox for.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Scanner Review Java Foundations: Introduction to Programming and Data Structures.
Interactive Programs Programs that get input from the user 1 In PowerPoint, click on the speaker icon then click the "Play" button to hear the narration.
Chapter 2: Data and Expressions. Variable Declaration In Java when you declare a variable, you must also declare the type of information it will hold.
Copyright 2008 by Pearson Education Building Java Programs Chapter 3 Lecture 3-3: Interactive Programs w/ Scanner reading: self-check: #16-19.
Introduction to programming in java
IAS 1313: OBJECT ORIENTED PROGRAMMING Week 3: Data Type, Control Structure and Array Prepared by: Mrs Sivabalan1.
COMP Review of Chapter 1 & 2
Input/Output.
CSC1401 Input and Output (and we’ll do a bit more on class creation)
Interactive Standard Input/output
Peer Instruction 9 File Input/Output.
I/O Basics.
Java Programming: From Problem Analysis to Program Design, 4e
Michele Weigle - COMP 14 - Spr 04
Building Java Programs Chapter 6
IFS410 Advanced Analysis and Design
Introduction to Computing Using Java
File Handling in Java January 19
Programming in JavaScript
Programming in JavaScript
Lecture Notes - Week 2 Lecture-1. Lecture Notes - Week 2 Lecture-1.
I/O and Applet from Chapter 12
CSC1401 Input and Output (with Files)
មជ្ឈមណ្ឌលកូរ៉េ សហ្វវែរ អេច អ ឌី
Lecture 8 – Practice Exam
MyRegistrar and Data reporting
Optional Topic: User Input with Scanner
Presentation transcript:

The SECOND Meeting Or: How I learned exciting new things in CS Club

As you all know… The best way to learn is to do. o It’s true! Thus we will be giving you awesome problems to do o They’re awesome! o There’ll be one each week! o Thus they’re called Problems of the Week! (PotW) Concepts and tricks for USACO and other contests! Prizes!

The PotW Process* Problem presented at meeting o Will be posted online Submit solutions to by 11:59PM the day before the next o Feel free to give any feedback about difficulty o Or suggest your own problems Solution presented at next meeting o Will be posted online after it’s presented See how you and others are doing at lynbrookcs.com! lynbrookcs.com Prizes at end of semester! *subject to change

The Problems Any programming language accepted Graded based on guidelines specified in problem o Officers reserve the right to grade as they please :] Console input/output (System.in, System.out) unless otherwise specified Java input: Use Scanner (easier) or BufferedReader (faster)

Reading Input in JAVA import java.io.*; import java.util.*; Scanner s = new Scanner(System.in); int n = s.nextInt(); BufferedReader r = new BufferedReader( new InputStreamReader(System.in)); int n = Integer.parseInt(r.readLine());

PotW #1: The Ninja Cow Farmer John (get used to the cow theme) has quite a few cows, "conveniently" numbered 1 to N, inclusive. Except, one day, one cow became a ninja and "disappeared" from the herd. Your job is to figure out which cow became a ninja. To avoid arousing the suspicions of the ninja cow, you cannot use arrays, you cannot use longs, and you cannot allow integer overflow. For 10 points, implement your solution for N = 3 For 15 points, implement your solution for 2 ≤ N ≤ 1000 For 20 points, implement your solution for 2 ≤ N ≤ 10 6 Sample Input: Sample Output: 4 (number of cows) 2 (ID of ninja cow) 3 (1st visible cow) 4 (2nd) 1 (etc.)