Westminster College 2016 High School Programming Contest. March 7, 2016

Size: px
Start display at page:

Download "Westminster College 2016 High School Programming Contest. March 7, 2016"

Transcription

1 Westminster College 2016 High School Programming Contest March 7, 2016 Rules: 1. There are six questions to be completed in two and 1/2 hours. 2. All questions require you to read the test data from standard input and write results to standard output. You should not use files for input or output. 3. The allowed programming languages are C++ and Java. 4. All programs will be re-compiled prior to testing with the judges data. 5. Programming style is not considered in this contest. You are free to code in whatever style you prefer. Documentation is not required. 6. from your solutions should follow the format used in the section for each problem. Unless stated otherwise, single blanks are used to seperate all output, and no blanks should appear at the end of any line. 7. Cheating is allowed and encouraged. 8. The previous statement is a lie!!! No cheating will be tolerated, and those caught cheating will be disqualified from the competition. 9. All judges decisions are final.

2 2016 Westminster High School Programming Contest 1 Problem A: Dinoscan Sarah Tops is a paleontologist who specializes in the reconstruction of dinosaur skeletons. One problem which she faces is determining whether two bones mesh together correctly. She has taken scans of all the bones in her collection, so instead of physically trying to put bones together she plans to use the scans to determine the appropriate connections between bones. Below on the left are scans of the ends of two different bones: Scan Scan 2 Combined In each scan, a 1 indicates bone and a 0 indicates empty space. Two bones mesh together if the two scans can be put together to form a solid rectangle of 1 s with no overlap. Scan 1 above can mesh with Scan 2 (as shown above on the right), but Scan 1 cannot mesh with either scans 3 or 4 shown below: Scan Scan 4 The input file contains multiple test cases. Each case starts with a line containing three positive integers r c 1 c 2, indicating the number of rows in both scans and the number of columns in the first and second scans. Following this are r lines each containing c 1 characters this is the first scan. All characters in the scan are either a 0 or a 1. Following this are r lines each with c 2 characters specifying the second scan. The maximum value for r, c 1 and c 2 is 20. In all test cases, the first column of scan 1 and the last column of scan 2 contain all 1 s. A line containing three zeros terminates input. For each test case, output the case number followed by Yes if the two scans can be meshed together, or No otherwise. When combining two scans, always try to connect the right hand side of the first scan with the left hand side of the second scan.

3 2016 Westminster High School Programming Contest 2 Note: the first uses scans 1 and 2 above, and the second uses scans 1 and Case 1: Yes Case 2: No

4 2016 Westminster High School Programming Contest 3 Problem B: Getting in Line with Art Mike and Angelo are arguing about a recent sculpture exhibit they attended (I m sure you get into these types of arguments all the time). Both of them are aspiring artists, and as soon as they got to the exhibit they each set up an easel and starting sketching the various sculptures they could see. Their argument involves the number of sculptures in the exhibit. Mike insists there were only three while Angelo swears there were five. After examining the layout of the sculpture from a map in the exhibition brochure they realized the problem: from where Mike had set up his easel, one of the statues (A) blocked his view of two others (C and E), as shown in the diagram below. Both Mike and Angelo wonder how likely something like this can happen, so they ve turned to you to run some simulations. For simplicity you decide to represent each sculpture by a point on the x-y plane. In this model, one sculpture can block the view of other sculptures only when they lie on the same line. All you have to do now is write code which when given a set of points determines the maximum number of those points that lie on a single line. Well...what are you waiting for? The input file contains multiple test cases. Each test case starts with a line containing a single integer n indicating the number of points, where n 100. After this are n pairs of integers x i y i indicating the location of the points. These pairs of numbers are across one or more input lines. All coordinate values lie in the range and no two points are the same. A line containing a single zero terminates input For each test case, output the case number followed by the maximum number of points on any one line.

5 2016 Westminster High School Programming Contest Case 1: 3 Case 2: 6

6 2016 Westminster High School Programming Contest 5 Problem C: Hidden Words Danny is a partial paranoid he thinks only half the world is out to get him! He s convinced that this vast anti-danny conspiracy is sending secret messages to each other via on-line media, so he scours websites looking for clues to their evil plan. So for example, the other day he found the words omega and theta in the following snippet from a restaurant review site:... feeling at home, Gary ate the taco he bought... and later found the word pascal in another line in the same article:... after you dip a scallop in the sauce... Notice how devilish Danny s enemies are, hiding these words by splitting them over multiple words while ignoring punctuation and capitalization. The fiends! Now, what omega, theta, and pascal actually mean Danny has no idea, but he s sure it can t be good. The problem for Danny is that there are just too many articles in too many websites for him to handle on his own. He s asked you to write a program that will scan a given sentence to see if a specific word is hidden in it somewhere. And he knows they re there! The input file contains multiple test cases. The first line contains a single integer n indicating the number of test cases. Each test case consists of two lines. The first line contains a single non-empty word in lowercase letters this is the word to search for. The second line contains the sentence to search. (NOTE: instructions on how to read in an entire line from a file are given at the end of this problem.) This line will contain only lower and upper case letters, blanks and punctuation. The maximum length of both the word and the line will be 80 characters each. For each test case, output the case number followed by the index of where the word starts in the sentence, or the phrase not found if the word is not in the sentence. The index of the first character in the sentence is 0, and you should count all characters in the sentence including blanks and punctuation when calculating the index. If there is more than one occurrence, output the first location. 3 omega feeling at home, Gary ate the taco he bought pascal... after you dip a scallop in the sauce... java... after you dip a scallop in the sauce... Case 1: 12 Case 2: 16 Case 3: not found

7 2016 Westminster High School Programming Contest 6 Reading in Lines C++: To read in an entire line into a string variable s use the global function getline() found in the string library. using namespace std;... string s;... getline(cin,s); Java: To read in an entire line into a String variable s, use the nextline method of a Scanner object. import java.util.scanner;... Scanner in = new Scanner(System.in); String s;... s = in.nextline(); WARNING: Suppose you want to read in an integer on one line and then read in the entire second line of input. In this case you must perform one getline or in.nextline call before reading in the second line of input. This is because after reading in the integer using cin >> n or n = in.nextint(), there is still an empty string remaining on that line which will be read in by the next getline or in.nextline. So to read in an integer and then read in the entire next line, you must do something like the following: C++ Java int n; int n; string s; String s; cin >> n; n = in.nextint(); getline(cin, s); reads in blank line s = in.nextline(); getline(cin, s); reads in next line s = in.nextline();

8 2016 Westminster High School Programming Contest 7 Problem D: Hoop Yourself Kathy is a basketball player on a mission. Her school uses basketballs from three different manufacturers and she s convinced that one of these companies produces a better product than the other two. To test this theory, she has amassed a wealth of data from various practices and hopes that she can use this data to convince the athletic department to only use one type of ball. The data she has is the following: For each jump shot taken at practice she knows the type of ball used and whether or not the shot was successful. For example, if the three types of balls are identified with the letters A, B and C, then the data (A,yes), (C,no), C(yes), B(no) indicates that one successful shot was take with ball type A, one unsuccessful shot was take with ball type B and two shots were take with ball type C, one successful and one not. Based on this (very small) sample Kathy would say that type A has a 100% rate of success, type C has a 50% rate and type B has a 0% rate. If that was all the data Kathy had, then she would say that type A is the ball to go with, but she has much more data than this data from 100 s of practices where in each practice 100 s of shots are taken. She has come to you to help automate the ranking process. The input file contains multiple test cases. Each test case starts with a line containing a single integer n 1000 indicating the number of data points in the sample. After this are n pairs t i s i where each pair represents one data point. In each pair t i is either the character A, B or C, and s i is either 1 (for a successful shot) or 0 (for an unsuccessful shot). These pairs are given across one or more input lines and there is at least one data point for each basketball type. A line containing a single zero terminates input For each test case, output each of the data types and their success rates, one pair per line. the pairs in sorted order, from most successful to least successful (there will never be a tie). the success rate as a percentage, using the standard floating point output in your language of choice. 4 A 1 C 0 C 1 B 0 17 C 1 A 0 A 1 B 1 B 1 B 0 C 1 C 0 B 1 C 1 B 1 A 0 C 0 C 1 B 0 B 1 A 0 0 Using C++ Using Java Case 1: Case 1: A 100 A 100 C 50 C 50 B 0 B 0 Case 2: Case 2: B B C C A 25 A 25.0

9 2016 Westminster High School Programming Contest 8 Problem E: Prime Driving Conditions Gabby has just bought a new car and needs license plates. In Pennsylvania license plates consists of three uppercase letters followed by four digits. License plates are given out in lexicographic order, meaning that plate AAA 0000 is first, followed by AAA 0001, AAA 0002, etc,. After AAA 9999 comes plates AAB 0000, AAB 0001, etc., and after plate AZZ 9999 comes plate BAA The very last plate is ZZZ For most people, any old license plate will do, but not for Gabby. She insists that the 4 digit number on the plate must be a prime number. Recall that a prime number is a number > 1 whose only factors are 1 and the number itself. The first few prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23,... So if Gabby goes to the DMV to get a set of plates, and the next available plate is JPB 1285, she ll wait until plate JPB 1289 becomes available, since 1289 is the first prime greater than or equal to If the plate had been JPB 9999, she would have waited for the plate JPC Perhaps you see what we re driving at here. Starting at a given license plate, find the first plate lexicographically equal or greater that contains a prime number. As a side note, this past January the largest prime number known to date was discovered. It is equal to 2 74,207,281 1 and contains 22,338,618 digits. A little too large to fit on a license plate. The input file contains multiple test cases. Each test cases is on a single line and contains a three character string followed by a 4 digit number. The three character string consists solely of uppercase letters other than the string ZZZ. A line containing END 0000 terminates input. For each test case, output the case number followed by the license plate Gabby will accept. JPB 1285 JPB 9999 END 0000 Case 1: JPB 1289 Case 2: JPC 0002

10 2016 Westminster High School Programming Contest 9 Problem F: Time is of the Essence Do you know how long one million seconds is? How about one billion seconds? Well, the answer to the first one is 11 days, 13 hours, 46 minutes and 40 seconds Accurate, but a little over-precise. A more reasonable answer might be 11 days, 14 hours or just 12 days (after rounding). As another example, if I asked how large three million inches were, you could approximate it by saying either 47 miles or 47 miles, 613 yards. This sort of imprecision is what we re looking for in this problem! The input file contains multiple test cases. The first line of each test case is of the following form: n name 1 c 1 name 2 c 2... name n 1 c n 1 name n Each name i is a unit of measurement and each c i is a conversion rate, telling you how many units of type name i+1 are in a unit of type name i. For example, in the first sample input, this line tells you that there are 24 hours in one day, 60 minutes in each hour and 60 seconds in each minute. The value n indicates the total number of unit names and satisfies 2 n 10. All names are alphabetic strings with no blanks and always specify the plural form of the unit (which you should use for output no matter the value is associated with the unit). All conversion values are positive integers. Following this line is a single positive integer m 2, 000, 000, 000 indicating an amount of the last unit (i.e., name n ). A line containing a single zero terminates input. For each test case output the case number followed by two lines. The first line should give the closest conversion of the input amount to units specified by name 1, rounded to the nearest integer. The second line should do the same, but be a bit more precise using the two largest units name 1 and name 2. When rounding, always round up when the fraction is 0.5. Note that there are no commas in the output.

11 2016 Westminster High School Programming Contest 10 4 days 24 hours 60 minutes 60 seconds years 365 days 24 hours 60 minutes 60 seconds feet 12 inches 11 0 Case 1: 12 days 11 days 14 hours Case 2: 32 years 31 years 259 days Case 3: 1 feet 0 feet 11 inches

Westminster College 2017 High School Programming Contest. March 13, 2017

Westminster College 2017 High School Programming Contest. March 13, 2017 Westminster College 2017 High School Programming Contest March 13, 2017 Rules: 1. There are six questions to be completed in two and 1/2 hours. 2. All questions require you to read the test data from standard

More information

Example Program. public class ComputeArea {

Example Program. public class ComputeArea { COMMENTS While most people think of computer programs as a tool for telling computers what to do, programs are actually much more than that. Computer programs are written in human readable language for

More information

//If target was found, then //found == true and a[index] == target.

//If target was found, then //found == true and a[index] == target. 230 CHAPTER 5 Arrays //If target was found, then //found == true and a[index] == target. } if (found) where = index; return found; 20. 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 21. int a[4][5]; int index1, index2;

More information

Lesson 2 Variables and I/O

Lesson 2 Variables and I/O Lesson 2 Variables and I/O Pic 10A Ricardo Salazar Free form layout C++ lets you use spaces and returns (enter key) wherever you see fit. cout

More information

You may use a calculator for these practice questions. You may

You may use a calculator for these practice questions. You may 660 Math Smart Practice Questions You may use a calculator for these practice questions. You may not know all the math to complete these practice questions yet, but try to think them through! 1. Eric lives

More information

Twelfth 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. 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 information

4. 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?

4. 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 information

Length, Width, and Depth

Length, Width, and Depth Length, Width, and Depth Deepening Understanding of Volume 1 WARM UP Determine the least common multiple of the numbers in each pair. 1., 10. 3, 8 3. 6, 1 LEARNING GOALS Determine the volume of right rectangular

More information

Full file at

Full file at Java Programming: From Problem Analysis to Program Design, 3 rd Edition 2-1 Chapter 2 Basic Elements of Java At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class

More information

UNIT 11 VOLUME AND THE PYTHAGOREAN THEOREM

UNIT 11 VOLUME AND THE PYTHAGOREAN THEOREM UNIT 11 VOLUME AND THE PYTHAGOREAN THEOREM INTRODUCTION In this Unit, we will use the idea of measuring volume that we studied to find the volume of various 3 dimensional figures. We will also learn about

More information

Discussion 1H Notes (Week 2, 4/8) TA: Brian Choi Section Webpage:

Discussion 1H Notes (Week 2, 4/8) TA: Brian Choi Section Webpage: Discussion 1H Notes (Week 2, 4/8) TA: Brian Choi (schoi@cs.ucla.edu) Section Webpage: http://www.cs.ucla.edu/~schoi/cs31 Variables You have to instruct your computer every little thing it needs to do even

More information

CS31 Discussion 1E. Jie(Jay) Wang Week3 Oct.12

CS31 Discussion 1E. Jie(Jay) Wang Week3 Oct.12 CS31 Discussion 1E Jie(Jay) Wang Week3 Oct.12 Outline Problems from Project 1 Review of lecture String, char, stream If-else statements Switch statements loops Programming challenge Problems from Project

More information

Computer Programming, I. Laboratory Manual. Experiment #2. Elementary Programming

Computer Programming, I. Laboratory Manual. Experiment #2. Elementary Programming Think Twice Code Once The Islamic University of Gaza Engineering Faculty Department of Computer Engineering Fall 2017 ECOM 2005 Khaleel I. Shaheen Computer Programming, I Laboratory Manual Experiment #2

More information

Problem A - EPIC. Line Width of Letters (# characters) EEEEEEEEEE EEEEEEEEEE EE EE EEEEEEEEEE EEEEEEEEEE EE EE EEEEEEEEEE EEEEEEEEEE

Problem A - EPIC. Line Width of Letters (# characters) EEEEEEEEEE EEEEEEEEEE EE EE EEEEEEEEEE EEEEEEEEEE EE EE EEEEEEEEEE EEEEEEEEEE Problem A - EPIC Professor Plum likes the idea of visiting EPIC for MICS 4. He wants you to write a program to generate ASC art printing EPIC vertically for a sign to tape to the back of the van on the

More information

AP Computer Science Unit 1. Writing Programs Using BlueJ

AP Computer Science Unit 1. Writing Programs Using BlueJ AP Computer Science Unit 1. Writing Programs Using BlueJ 1. Open up BlueJ. Click on the Project menu and select New Project. You should see the window on the right. Navigate to wherever you plan to save

More information

Tips & Tricks for Microsoft Word

Tips & Tricks for Microsoft Word T 330 / 1 Discover Useful Hidden Features to Speed-up Your Work in Word For what should be a straightforward wordprocessing program, Microsoft Word has a staggering number of features. Many of these you

More information

MITOCW watch?v=4dj1oguwtem

MITOCW watch?v=4dj1oguwtem MITOCW watch?v=4dj1oguwtem PROFESSOR: So it's time to examine uncountable sets. And that's what we're going to do in this segment. So Cantor's question was, are all sets the same size? And he gives a definitive

More information

Summer Math Learning Packet for Students Entering. Grade 6. SFTitle I

Summer Math Learning Packet for Students Entering. Grade 6. SFTitle I Summer Math Learning Packet for Students Entering Grade 6 Dear Parents, The attached packet provides a range of activities that review the skills and concepts that your child explored this year in their

More information

REVIEW. The C++ Programming Language. CS 151 Review #2

REVIEW. The C++ Programming Language. CS 151 Review #2 REVIEW The C++ Programming Language Computer programming courses generally concentrate on program design that can be applied to any number of programming languages on the market. It is imperative, however,

More information

Variables and Constants

Variables and Constants HOUR 3 Variables and Constants Programs need a way to store the data they use. Variables and constants offer various ways to work with numbers and other values. In this hour you learn: How to declare and

More information

IAE Professional s (02)

IAE Professional  s (02) IAE Professional Emails (02) TASK ONE: There are three different styles of writing when it comes to communication via email: Formal This is the style of an old-fashioned letter. Ideas are presented politely

More information

CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals

CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals 1 Recall From Last Time: Java Program import java.util.scanner; public class EggBasketEnhanced { public static void main(string[]

More information

CONTENTS. Functional Maths and Numeracy study guide Name 1) THE FOUR RULES OF ARITHMETIC 6) ROUNDING 2) MEASURES, SHAPE AND SPACE 8) NEGATIVE NUMBERS

CONTENTS. Functional Maths and Numeracy study guide Name 1) THE FOUR RULES OF ARITHMETIC 6) ROUNDING 2) MEASURES, SHAPE AND SPACE 8) NEGATIVE NUMBERS Name CONTENTS 1) THE FOUR RULES OF ARITHMETIC Addition (page 2) Addition of decimals (page 4) Subtraction (page 5) Subtraction of decimals (page 8) Subtraction other methods (page 9) Multiplication (page

More information

Slide 1 CS 170 Java Programming 1 The Switch Duration: 00:00:46 Advance mode: Auto

Slide 1 CS 170 Java Programming 1 The Switch Duration: 00:00:46 Advance mode: Auto CS 170 Java Programming 1 The Switch Slide 1 CS 170 Java Programming 1 The Switch Duration: 00:00:46 Menu-Style Code With ladder-style if-else else-if, you might sometimes find yourself writing menu-style

More information

Spring 2017 CS 1110/1111 Exam 1

Spring 2017 CS 1110/1111 Exam 1 CS 1110/1111 Spring 2017 Exam 1 page 1 of 6 Spring 2017 CS 1110/1111 Exam 1 Bubble in your computing ID in the footer of this page. We use an optical scanner to read it, so fill in the bubbles darkly.

More information

Chapter 2 Basic Elements of C++

Chapter 2 Basic Elements of C++ C++ Programming: From Problem Analysis to Program Design, Fifth Edition 2-1 Chapter 2 Basic Elements of C++ At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class Discussion

More information

Outlook is easier to use than you might think; it also does a lot more than. Fundamental Features: How Did You Ever Do without Outlook?

Outlook is easier to use than you might think; it also does a lot more than. Fundamental Features: How Did You Ever Do without Outlook? 04 537598 Ch01.qxd 9/2/03 9:46 AM Page 11 Chapter 1 Fundamental Features: How Did You Ever Do without Outlook? In This Chapter Reading e-mail Answering e-mail Creating new e-mail Entering an appointment

More information

Intermediate Mathematics League of Eastern Massachusetts

Intermediate Mathematics League of Eastern Massachusetts Meet # January 010 Intermediate Mathematics League of Eastern Massachusetts Meet # January 010 Category 1 - Mystery Meet #, January 010 1. Of all the number pairs whose sum equals their product, what is

More information

Preprocessor Directives

Preprocessor Directives C++ By 6 EXAMPLE Preprocessor Directives As you might recall from Chapter 2, What Is a Program?, the C++ compiler routes your programs through a preprocessor before it compiles them. The preprocessor can

More information

A A B U n i v e r s i t y

A A B U n i v e r s i t y A A B U n i v e r s i t y Faculty of Computer Sciences O b j e c t O r i e n t e d P r o g r a m m i n g Week 4: Introduction to Classes and Objects Asst. Prof. Dr. M entor Hamiti mentor.hamiti@universitetiaab.com

More information

Excel Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts. 6. You can use a table s sizing handle to add columns or rows to a table.

Excel Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts. 6. You can use a table s sizing handle to add columns or rows to a table. Excel Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts TRUE/FALSE 1. The header row must be row 1. ANS: F PTS: 1 REF: EX 234 2. If you freeze the top row in a worksheet and press Ctrl+Home,

More information

Solium Capital. Darko Aleksic Dr. Peter Høyer Sean McIntyre. Darko Aleksic Sean McIntyre John Zhang. Sonny Chan Alex Fink Brett Shikaze

Solium Capital. Darko Aleksic Dr. Peter Høyer Sean McIntyre. Darko Aleksic Sean McIntyre John Zhang. Sonny Chan Alex Fink Brett Shikaze University of Calgary September 18, 008 E V E N T S P O N S O R Solium Capital C O N T E S T O R G A N I Z E R S Darko Aleksic Dr. Peter Høyer Sean McIntyre P R O B L E M A U T H O R S Darko Aleksic Sean

More information

Language Basics. /* The NUMBER GAME - User tries to guess a number between 1 and 10 */ /* Generate a random number between 1 and 10 */

Language Basics. /* The NUMBER GAME - User tries to guess a number between 1 and 10 */ /* Generate a random number between 1 and 10 */ Overview Language Basics This chapter describes the basic elements of Rexx. It discusses the simple components that make up the language. These include script structure, elements of the language, operators,

More information

School of Computer Science CPS109 Course Notes 5 Alexander Ferworn Updated Fall 15

School of Computer Science CPS109 Course Notes 5 Alexander Ferworn Updated Fall 15 Table of Contents 1 INTRODUCTION... 1 2 IF... 1 2.1 BOOLEAN EXPRESSIONS... 3 2.2 BLOCKS... 3 2.3 IF-ELSE... 4 2.4 NESTING... 5 3 SWITCH (SOMETIMES KNOWN AS CASE )... 6 3.1 A BIT ABOUT BREAK... 7 4 CONDITIONAL

More information

2007 Canadian Computing Competition: Senior Division. Sponsor:

2007 Canadian Computing Competition: Senior Division. Sponsor: 2007 Canadian Computing Competition: Senior Division Sponsor: Canadian Computing Competition Student Instructions for the Senior Problems 1. You may only compete in one competition. If you wish to write

More information

Millionaire. Input. Output. Problem limit seconds

Millionaire. Input. Output. Problem limit seconds Millionaire Congratulations! You were selected to take part in the TV game show Who Wants to Be a Millionaire! Like most people, you are somewhat risk-averse, so you might rather take $250,000 than a 50%

More information

Structures of Expressions

Structures of Expressions SECONDARY MATH TWO An Integrated Approach MODULE 2 Structures of Expressions The Scott Hendrickson, Joleigh Honey, Barbara Kuehl, Travis Lemon, Janet Sutorius 2017 Original work 2013 in partnership with

More information

Applications. 72 Variables and Patterns

Applications. 72 Variables and Patterns Applications. Sean bought a DVD player and a receiver. The store offered him an interest-free payment plan with weekly installments. Sean figured out that after n weeks of payments, he would still owe

More information

Chapter 1 is where you get your feet wet. Don t be shy. Walk right to the

Chapter 1 is where you get your feet wet. Don t be shy. Walk right to the 04 Bk01Ch01.qxd 9/3/03 9:19 AM Page 7 Chapter 1: Entering, Editing, and Formatting Text In This Chapter Creating new documents Opening documents Saving versions of documents Changing text fonts and the

More information

Milestones Review 2016 Math

Milestones Review 2016 Math Milestones Review 2016 Math CCGPS Day 1 Write an expression that shows subtract 5 from 9 and then multiply the result by 6. Write an expression that shows the quotient of 72 and 9 multiplied by 3 Interpret

More information

Pacific Northwest Region Programming Contest Division 2

Pacific Northwest Region Programming Contest Division 2 Pacific Northwest Region Programming Contest Division 2 November 14th, 2015 Reminders For all problems, read the input data from standard input and write the results to standard output. In general, when

More information

Continental Mathematics League

Continental Mathematics League Continental Mathematics League 2015-2016 Computer Science Contest Grades 3-5 The contest consists of three meets. Each meet has six questions for 30 minutes. Note: Some questions have multiple answers.

More information

ACM ICPC2009 Latin American Regionals 1. Problem A Pangram. File code name: pangram

ACM ICPC2009 Latin American Regionals 1. Problem A Pangram. File code name: pangram ACM ICPC29 Latin American Regionals Problem A Pangram File code name: pangram Pangram Show is an exciting new television quiz show which offers very large cash prizes for correctly detecting if a sentence

More information

Name Date Class F 63 H 0.63 B 2.5 D G 6.3 I A 18 C F 60 H 0.6 B 1.8 D 0.018

Name Date Class F 63 H 0.63 B 2.5 D G 6.3 I A 18 C F 60 H 0.6 B 1.8 D 0.018 Name Date Class 3-4 Practice A Multiplying Decimals Multiply. Choose the letter for the best answer. 1. 5 0.05 A 25 C 0.25 2. 9 0.7 F 63 H 0.63 B 2.5 D 0.025 G 6.3 I 0.063 3. 6 0.003 A 18 C 0.18 4. 5 1.2

More information

COMPS258 Computer Programming and Problem Solving

COMPS258 Computer Programming and Problem Solving COMPS258 Computer Programming and Problem Solving Autumn 2017 Presentation Tutor Marked Assignment 3 (TMA03) Please submit this TMA by 21 st March 2018 Preamble I hope you have learned a lot in this course

More information

CS 051 Homework Laboratory #2

CS 051 Homework Laboratory #2 CS 051 Homework Laboratory #2 Dirty Laundry Objective: To gain experience using conditionals. The Scenario. One thing many students have to figure out for the first time when they come to college is how

More information

Practice Midterm Examination #2

Practice Midterm Examination #2 Eric Roberts Handout #34 CS 106A February, 2016 Practice Midterm Examination #2 Review session: Monday, February 8, 6:30 8:00 P.M., NVIDIA Auditorium Midterm exams: Tuesday, February 9, 9:00 11:00 A.M.,

More information

LESSON 5 - DECIMALS INTRODUCTION

LESSON 5 - DECIMALS INTRODUCTION LESSON 5 - DECIMALS INTRODUCTION Now that we know something about whole numbers and fractions, we will begin working with types of numbers that are extensions of whole numbers and related to fractions.

More information

Fast Scout. Desktop User Guide

Fast Scout. Desktop User Guide Fast Scout Desktop User Guide Contents Getting Started - FastScout Video Resources..3 Getting Started - FastScout Terminology...3 Getting Started - Setting Up a Report...3 The Preview Tab...3 Reports.5

More information

Distributions of Continuous Data

Distributions of Continuous Data C H A P T ER Distributions of Continuous Data New cars and trucks sold in the United States average about 28 highway miles per gallon (mpg) in 2010, up from about 24 mpg in 2004. Some of the improvement

More information

CS490: Problem Solving in Computer Science Lecture 3: Input/Output

CS490: Problem Solving in Computer Science Lecture 3: Input/Output CS490: Problem Solving in Computer Science Lecture 3: Input/Output Dustin Tseng Mike Li Wednesday January 4, 2006 Dustin Tseng Mike Li: CS490: Problem Solving in Computer Science, Lecture 3: Input/Output

More information

ASSIGNMENT 2. COMP-202A, Fall 2011, All Sections. Due: Monday, October 17th, 2011 (23:30)

ASSIGNMENT 2. COMP-202A, Fall 2011, All Sections. Due: Monday, October 17th, 2011 (23:30) ASSIGNMENT 2 COMP-202A, Fall 2011, All Sections Due: Monday, October 17th, 2011 (23:30) Please read the entire pdf before starting. The bottom has important instructions for how to test your code before

More information

Objectives. In this chapter, you will:

Objectives. In this chapter, you will: Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates arithmetic expressions Learn about

More information

Difference Between Dates Case Study 2002 M. J. Clancy and M. C. Linn

Difference Between Dates Case Study 2002 M. J. Clancy and M. C. Linn Difference Between Dates Case Study 2002 M. J. Clancy and M. C. Linn Problem Write and test a Scheme program to compute how many days are spanned by two given days. The program will include a procedure

More information

CS 152: Data Structures with Java Hello World with the IntelliJ IDE

CS 152: Data Structures with Java Hello World with the IntelliJ IDE CS 152: Data Structures with Java Hello World with the IntelliJ IDE Instructor: Joel Castellanos e-mail: joel.unm.edu Web: http://cs.unm.edu/~joel/ Office: Electrical and Computer Engineering building

More information

2SKILL. Variables Lesson 6. Remembering numbers (and other stuff)...

2SKILL. Variables Lesson 6. Remembering numbers (and other stuff)... Remembering numbers (and other stuff)... Let s talk about one of the most important things in any programming language. It s called a variable. Don t let the name scare you. What it does is really simple.

More information

2015 ICPC. Northeast North America Preliminary

2015 ICPC. Northeast North America Preliminary 2015 ICPC Northeast North America Preliminary sponsored by the Clarkson Student Chapter of the ACM Saturday, October 17, 2015 11:00 am 5:00 pm Applied CS Labs, Clarkson University Science Center 334-336

More information

What did we talk about last time? Examples switch statements

What did we talk about last time? Examples switch statements Week 4 - Friday What did we talk about last time? Examples switch statements History of computers Hardware Software development Basic Java syntax Output with System.out.print() Mechanical Calculation

More information

Chapter 4 Lab. Loops and Files. Objectives. Introduction

Chapter 4 Lab. Loops and Files. Objectives. Introduction Chapter 4 Lab Loops and Files Objectives Be able to convert an algorithm using control structures into Java Be able to write a while loop Be able to write a do-while loop Be able to write a for loop Be

More information

Switched-On Schoolhouse 2014 User Guide Resource Center & Messaging System

Switched-On Schoolhouse 2014 User Guide Resource Center & Messaging System Switched-On Schoolhouse 2014 User Guide Resource Center & Messaging System MMVI Alpha Omega Publications, Inc. Switched-On Schoolhouse 2014, Switched-On Schoolhouse. Switched-On, and their logos are registered

More information

Detailed instructions for video analysis using Logger Pro.

Detailed instructions for video analysis using Logger Pro. Detailed instructions for video analysis using Logger Pro. 1. Begin by locating or creating a video of a projectile (or any moving object). Save it to your computer. Most video file types are accepted,

More information

The C++ Language. Arizona State University 1

The C++ Language. Arizona State University 1 The C++ Language CSE100 Principles of Programming with C++ (based off Chapter 2 slides by Pearson) Ryan Dougherty Arizona State University http://www.public.asu.edu/~redoughe/ Arizona State University

More information

Registration and Login

Registration and Login Registration and Login When a parent accesses txconnect, the following Login page is displayed. The parent needs to register as a new user. How to Register as a New User The registration process is self-administered,

More information

Define a method vs. calling a method. Chapter Goals. Contents 1/21/13

Define a method vs. calling a method. Chapter Goals. Contents 1/21/13 CHAPTER 2 Define a method vs. calling a method Line 3 defines a method called main Line 5 calls a method called println, which is defined in the Java library You will learn later how to define your own

More information

Using Java Classes Fall 2018 Margaret Reid-Miller

Using Java Classes Fall 2018 Margaret Reid-Miller Using Java Classes 15-121 Fall 2018 Margaret Reid-Miller Today Strings I/O (using Scanner) Loops, Conditionals, Scope Math Class (random) Fall 2018 15-121 (Reid-Miller) 2 The Math Class The Math class

More information

12/22/11. Java How to Program, 9/e. public must be stored in a file that has the same name as the class and ends with the.java file-name extension.

12/22/11. Java How to Program, 9/e. public must be stored in a file that has the same name as the class and ends with the.java file-name extension. Java How to Program, 9/e Education, Inc. All Rights Reserved. } Covered in this chapter Classes Objects Methods Parameters double primitive type } Create a new class (GradeBook) } Use it to create an object.

More information

Berkeley Practice Contest Fall P. N. Hilfinger

Berkeley Practice Contest Fall P. N. Hilfinger Berkeley Practice Contest Fall 2017 P. N. Hilfinger Please make sure your electronic registration is up to date, and that it contains the correct account you are going to be using to submit solutions (we

More information

NMC Sample Problems: Grade 8

NMC Sample Problems: Grade 8 NM Sample Problems: Grade 8. right triangle has lengths of and 8 in sides. What is the length of hypotenuse (the longest side)? (b) 0 5. n isosceles triangle has the base length of 6 and each side of length.

More information

Exam 1. CSI 201: Computer Science 1 Fall 2018 Professors: Shaun Ramsey

Exam 1. CSI 201: Computer Science 1 Fall 2018 Professors: Shaun Ramsey Exam 1 CSI 201: Computer Science 1 Fall 2018 Professors: Shaun Ramsey I understand that this exam is closed books and closed notes and is to be completed without a calculator, phone, or other computer.

More information

Working with Objects. Overview. This chapter covers. ! Overview! Properties and Fields! Initialization! Constructors! Assignment

Working with Objects. Overview. This chapter covers. ! Overview! Properties and Fields! Initialization! Constructors! Assignment 4 Working with Objects 41 This chapter covers! Overview! Properties and Fields! Initialization! Constructors! Assignment Overview When you look around yourself, in your office; your city; or even the world,

More information

C++ Programming: From Problem Analysis to Program Design, Third Edition

C++ Programming: From Problem Analysis to Program Design, Third Edition C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 2: Basic Elements of C++ Objectives (continued) Become familiar with the use of increment and decrement operators Examine

More information

Full file at Excel Chapter 2 - Formulas, Functions, Formatting, and Web Queries

Full file at   Excel Chapter 2 - Formulas, Functions, Formatting, and Web Queries Excel Chapter 2 - Formulas, Functions, Formatting, and Web Queries MULTIPLE CHOICE 1. To start a new line in a cell, press after each line, except for the last line, which is completed by clicking the

More information

POWERONE TEMPLATES A DOCUMENT DESCRIBING HOW TO CREATE TEMPLATES.

POWERONE TEMPLATES A DOCUMENT DESCRIBING HOW TO CREATE TEMPLATES. I N F I N I T Y S O F T W O R K S POWERONE TEMPLATES A DOCUMENT DESCRIBING HOW TO CREATE TEMPLATES www.infinitysw.com/help/create Templates What is a template? powerone uses templates as its primary medium

More information

Copyright 2003 Pearson Education, Inc. Slide 1

Copyright 2003 Pearson Education, Inc. Slide 1 Copyright 2003 Pearson Education, Inc. Slide 1 Chapter 11 Strings and Vectors Created by David Mann, North Idaho College Copyright 2003 Pearson Education, Inc. Slide 2 Overview An Array Type for Strings

More information

Baldwin-Wallace College. 6 th Annual High School Programming Contest. Do not open until instructed

Baldwin-Wallace College. 6 th Annual High School Programming Contest. Do not open until instructed Baldwin-Wallace College 6 th Annual High School Programming Contest Do not open until instructed 2009 High School Programming Contest Merging Shapes A lot of graphical applications render overlapping shapes

More information

ROCK PAPER SCISSORS Rock Paper Scissors Lab Project Using C or C++

ROCK PAPER SCISSORS Rock Paper Scissors Lab Project Using C or C++ ROCK PAPER SCISSORS Rock Paper Scissors Lab Project Using C or C++ Copyright 2014 Dan McElroy Project Definition Truth Tables Topics Covered Keyboard Character Input (C and C++) Converting Characters to

More information

Text Input and Conditionals

Text Input and Conditionals Text Input and Conditionals Text Input Many programs allow the user to enter information, like a username and password. Python makes taking input from the user seamless with a single line of code: input()

More information

Hello World. n Variables store information. n You can think of them like boxes. n They hold values. n The value of a variable is its current contents

Hello World. n Variables store information. n You can think of them like boxes. n They hold values. n The value of a variable is its current contents Variables in a programming language Basic Computation (Savitch, Chapter 2) TOPICS Variables and Data Types Expressions and Operators Integers and Real Numbers Characters and Strings Input and Output Variables

More information

Resource Center & Messaging System

Resource Center & Messaging System SOS 2012 User Manual Resource Center & Messaging System Alpha Omega Publications MMVI Alpha Omega Publications, Inc. Switched-On Schoolhouse 2012, Switched-On Schoolhouse. Switched-On, and their logos

More information

(Refer Slide Time: 00:23)

(Refer Slide Time: 00:23) In this session, we will learn about one more fundamental data type in C. So, far we have seen ints and floats. Ints are supposed to represent integers and floats are supposed to represent real numbers.

More information

Part II Composition of Functions

Part II Composition of Functions Part II Composition of Functions The big idea in this part of the book is deceptively simple. It s that we can take the value returned by one function and use it as an argument to another function. By

More information

ASSIGNMENT 2. COMP-202A, Fall 2013, All Sections. Due: October 20 th, 2013 (23:59)

ASSIGNMENT 2. COMP-202A, Fall 2013, All Sections. Due: October 20 th, 2013 (23:59) ASSIGNMENT 2 COMP-202A, Fall 2013, All Sections Due: October 20 th, 2013 (23:59) Please read the entire PDF before starting. You must do this assignment individually and, unless otherwise specified, you

More information

A Bullseye. Problem. Output. For each dataset, print a line of the form: SCORE: N to M, PLAYER P WINS. Or: SCORE: N to M, TIE.

A Bullseye. Problem. Output. For each dataset, print a line of the form: SCORE: N to M, PLAYER P WINS. Or: SCORE: N to M, TIE. A Bullseye A simple dartboard consists of a flat, circular piece of cork with concentric rings drawn on it. Darts are thrown at the board by players in an attempt to hit the center of the dartboard (the

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security Outline ZKIP Other IP CPSC 467b: Cryptography and Computer Security Lecture 19 Michael J. Fischer Department of Computer Science Yale University March 31, 2010 Michael J. Fischer CPSC 467b, Lecture 19

More information

Endless Monetization

Endless Monetization Hey Guys, So, today we want to bring you a few topics that we feel compliment's the recent traffic, niches and keyword discussions. Today, we want to talk about a few different things actually, ranging

More information

such a manner that we are able to understand, grasp and grapple with the problem at hand in a more organized fashion.

such a manner that we are able to understand, grasp and grapple with the problem at hand in a more organized fashion. Programming and Data Structure Dr.P.P.Chakraborty Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture 32 Conclusions Hello everybody. Today, we come to the

More information

Fractions and their Equivalent Forms

Fractions and their Equivalent Forms Fractions Fractions and their Equivalent Forms Little kids use the concept of a fraction long before we ever formalize their knowledge in school. Watching little kids share a candy bar or a bottle of soda

More information

Oct Decision Structures cont d

Oct Decision Structures cont d Oct. 29 - Decision Structures cont d Programming Style and the if Statement Even though an if statement usually spans more than one line, it is really one statement. For instance, the following if statements

More information

Homework. GRADE 5 MODULE 5 Addition and Multiplication with Volume and Area

Homework. GRADE 5 MODULE 5 Addition and Multiplication with Volume and Area GRADE 5 MODULE 5 Addition and Multiplication with Volume and Area Homework Video tutorials: http://bit.ly/eurekapusd Info for parents: http://bit.ly/pusdmath 5 GRADE Mathematics Curriculum GRADE 5 MODULE

More information

Official Competition Manual March 2, 2005

Official Competition Manual March 2, 2005 Official Competition Manual March 2, 2005 Competition Instructions Logging In to the Competition Arena Log in to the competition arena using the handle and password that you chose during the competition

More information

TJ IOI Practice Programming Round. Thomas Jefferson High School for Science and Technology

TJ IOI Practice Programming Round. Thomas Jefferson High School for Science and Technology TJ IOI 2017 Practice Programming Round Thomas Jefferson High School for Science and Technology Saturday, May 13, 2017 Instructions 1. The following section consists of 3 problems, which will not count

More information

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics COMP-202 Unit 1: Introduction Announcements Did you miss the first lecture? Come talk to me after class. If you want

More information

Excel Basics: Working with Spreadsheets

Excel Basics: Working with Spreadsheets Excel Basics: Working with Spreadsheets E 890 / 1 Unravel the Mysteries of Cells, Rows, Ranges, Formulas and More Spreadsheets are all about numbers: they help us keep track of figures and make calculations.

More information

Late Penalty: Late assignments will not be accepted.

Late Penalty: Late assignments will not be accepted. CPSC 449 Assignment 1 Due: Monday, October 16, 2017 Sample Solution Length: Less than 100 lines to reach the A- level, including some comments Approximately 130 lines with the fill color being influenced

More information

MadCap Software. Index Guide. Flare 2017 r2

MadCap Software. Index Guide. Flare 2017 r2 MadCap Software Index Guide Flare 2017 r2 Copyright 2017 MadCap Software. All rights reserved. Information in this document is subject to change without notice. The software described in this document

More information

Slide 1 CS 170 Java Programming 1 Real Numbers Duration: 00:00:54 Advance mode: Auto

Slide 1 CS 170 Java Programming 1 Real Numbers Duration: 00:00:54 Advance mode: Auto CS 170 Java Programming 1 Real Numbers Understanding Java's Floating Point Primitive Types Slide 1 CS 170 Java Programming 1 Real Numbers Duration: 00:00:54 Floating-point types Can hold a fractional amount

More information

Chapter 3 Syntax, Errors, and Debugging. Fundamentals of Java

Chapter 3 Syntax, Errors, and Debugging. Fundamentals of Java Chapter 3 Syntax, Errors, and Debugging Objectives Construct and use numeric and string literals. Name and use variables and constants. Create arithmetic expressions. Understand the precedence of different

More information

CSCE314: Programming Languages Final Examination

CSCE314: Programming Languages Final Examination DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING CSCE314: Programming Languages Final Examination Name: UIN: Section: May 5/6, 2016 (501 Shell/500 Keyser) Total time: 120 minutes Total marks: 100, where 100

More information

The Turing Environment

The Turing Environment 43 Chapter 2 The Turing Environment 2.1 Introduction 2.2 The Editor Window 2.3 Saving Programs on Disk 2.4 Running Programs 2.5 Indenting Programs and Syntax Coloring 2.6 Starting and Stopping the Environment

More information

Word 97: Increasing Efficiency

Word 97: Increasing Efficiency Windows 95 Word 97: Increasing Efficiency Increasing Your Efficiency Word for Windows has a number of features that can help you perform word processing tasks more quickly or to increase efficiency by

More information