AP Java String Review Learning Objectives

Slides:



Advertisements
Similar presentations
1.A computer game is an example of A.system software; B.a compiler; C.application software; D.hardware; E.none of the above. 2.JVM stands for: A.Java Virtual.
Advertisements

1 Chapter Ten Modular Development. 2 Stepwise Refinement At first, simple programs consist of only one source file and one function (the function main.
Array_strcpy void array_strcpy(char dest[], char src[]) { int i = 0; while (src[i] != '\0') { dest[i] = src[i]; i++; } dest[i] = '\0'; }
Noun. Noun - verb noun Noun - verb article- adj. - adj. - Noun - verb.
Nouns Verbs Adjectives adverbs Prepositional phrase.
HW 1: Problems 3 & 4 EC 1 & 2.
“To be” and linking Verbs
Methods in Java Selim Aksoy Bilkent University Department of Computer Engineering
The Eight Parts of Speech
Index Spiral Items # B Topics This PowerPoint will let you know the information that I expect to see on each card. REQUIRED: Each card should include.
Chapter 10 Applications of Arrays and Strings. Chapter Objectives Learn how to implement the sequential search algorithm Explore how to sort an array.
Chapter 10 Strings, Searches, Sorts, and Modifications Midterm Review By Ben Razon AP Computer Science Period 3.
Applications of Arrays (Searching and Sorting) and Strings
EXAM 1 REVIEW. days until the AP Computer Science test.
String Manipulation. Java String class  The String class represents character strings “Tammy Bailey”  All strings (arrays of characters) in Java programs.
Chapter 14: Searching and Sorting
1 Lesson: Applets with User Input and Output with GUI ICS4M.
Georgia Institute of Technology More on Creating Classes part 2 Barb Ericson Georgia Institute of Technology Oct 2005.
LANGUAGE ARTS LA WORKS UNIT 3 REVIEW STUDY GUIDE.
 Problems  Rock-Paper-Scissors (fair game)  Functions Frenzy  Extra Problems  Pig Latin  Scoring Paper.
© 2006 Pearson Education C4 D6 Obj: section 4.4, to learn to divide complicated methods into simpler, supporting methods HW: p. 246 #4.7 – 4.10 Do Now:
Program Options: 10 Minutes online Write a program that will display your home address as it would on an envelope. –First Name Last Name –Address –City,
1 Project 3 String Methods. Project 3: String Methods Write a program to do the following string manipulations: Prompt the user to enter a phrase and.
Think of a sentence to go with this picture. Can you use any of these words? then if so while though since when Try to use interesting adjectives, powerful.
Parts of Speech By: Miaya Nischelle Sample. NOUN A noun is a person place or thing.
More String Manipulation. Programming Challenge Define a function that accepts two arguments: a string literal and a single character. Have the function.
Grammar and Sentence Writing ENG 111 Al-Huqail, Eman.
Midterm 2 Review Notes on the CS 5 midterm Take-home exam due by 5:00 pm Sunday evening (11/14) Hand in your solutions under the door of my office, Olin.
Simple Present Be am, is, are. Using Be verbs: The basics  What is your name?  My name is Ed.  Where are you from?  I am from Japan.  We are in the.
TRUE or FALSE? Syntax= the order of words in a sentence.
Guess who I am !. I'm an adjective I'm related to a curve I'm meaningful for Hyperbolas but meaningless for Parabolas Limits define me.
DEVRY CIS 170 C I L AB 5 OF 7 A RRAYS AND S TRINGS Check this A+ tutorial guideline at
Sorts, CompareTo Method and Strings
Grammar.
Strings CSE 1310 – Introduction to Computers and Programming
Unit 5 Lesson 6: User Input and Strings
Jerry Cain and Eric Roberts
The present tense of the verb ser
Goals Understand how to create and compare Strings.
Open AvgLoop. It should provide SOME guidance for today’s assignment, but don’t just copy-paste….THINK.
Nouns Nouns not noun noun noun not not
Program Options: 10 Minutes online
Review.
Los sustantivos (Nouns)
Hello World 2 What does all that mean?.
Goals Understand how to create and compare Strings.
Lesson 6: User Input and Strings
Goals Understand how to create and compare Strings.
Review Dry Run Taking Names Online time Math is Good
Computer Science 1 Get out your notebook
CS 350 — Fall 2018 gilray.org/classes/fall2018/cs350/
Spring 2010 EECS 110: Homework I.
Program Options: 10 Minutes online
String What it is Why it’s useful
slides courtesy of Eric Roberts and Jerry Cain
Goals Understand how to create and compare Strings.
Ready.
String Processing 1 MIS 3406 Department of MIS Fox School of Business
Latin: The Written Language
Agenda Warmup Lesson 1.4 (double precision, String methods, etc)
JavaScript Frameworks Lab
Introduction to Computer Science
Using Ss in English Rules.
Programming Strings.
Random Numbers while loop
int [] scores = new int [10];
Characters and Strings Functions
Computer Science 1 Get out your notebook
Computer Science 1 Get out your notebook
Vowels and Consonants.
Presentation transcript:

AP Java String Review Learning Objectives Review String Methods with Sample Mult Choice Problems Write programs incorporating String methods.

Part 1 4.) int v = x.compareTo ("apple"); a. v = positive 1 b. v = 0 c. v = negative 1 d .none of the above 5.) int k = x.compareTo("Hello"); a. k = 0 b. k = negative 1 c. k = positive 1 d. none of the above 6.) String t = x.substring ("Hell"); a. Error b. 0 c. 1 d. 2 7.) String t = x.substring(2); a. t is "lo" b. t is "ello" c. t is "Hello" d. t is "llo" String x = "Hello"; 1.) int y = x.length(); a. x = 3 b. x = 2 c. x = 5 d. x = 6 2.) int z = x.indexOf ("ll"); a. z = 3 b. z = 2 c. z = 4 d. z = 1 3.) int w = x.indexOf("he"); a. w = 1 b. w = -1 c. w = 2 d. w = 0 8.) String b = x.substring(2, 4); a. b is "llo" b. b is "ell" c. b is "ll" d. b is "el" 9.) int c = x.length; a. 2 b.3 c.4 d. Error 10.) String u = x.substring (2, 3); a. error b. u is " l " c. u is "el " d. u is " ell " 11.) int w = x.equals("ELLO"); a.True b.False 12.) int a = x.substring(3); a. a is "lo" b. a is "llo" c. a is "ello" d. error

7. ) String c = x. substring(4). substring(5); a. c= LIAM_COUNTY b 7.) String c = x.substring(4).substring(5); a. c= LIAM_COUNTY b. c= CEWILLIAM_COUNTY c. c = _COUNTY d. c = ILLIAM_COUNTY 8.) int j = x.indexOf ("WILLIaM"); a. j = 6 b. j = 5 c. j = 4 d. j = -1 9.) int y = x.equals("PRINCEWILLIAM_COUNTY"); a.True b.False c. error 10.) int z = x.indexOf ("PRIN"); a. z = 0 b. z = 1 c. z = -1 d. z = 2 11.) String a = x.substring("2,8"); a. INCEWI b. RINCEWI c. INCEWIL d. error Part 2 String x = "PRINCEWILLIAM_COUNTY" 1.) int y = x. length (); a. 20 b. 21 c. 19 d. 22 2.) int t = x.indexOf (PRIN); a. t = 0 b. t = 1 c. t = 2 d. Error 3.) String k = x.substring (2); a. k = RINCEWILLIAMCOUNTY b.k = RINCEWILLIAM_COUNTY c. k = INCEWILLIAM_COUNTY d.none of the above 4.) String q = x.substring(5, 17); a. q = CEWILLIAM_COUNT b. q = EWILLIAMCOUN c. q = EWILLIAM_COU d. q = CEWILLIAM_COUN 5.) int u = x.compareTo ("STRINGS"); a. negative 1 b. positive 1 c. 0 d. none of the above 6.) String g = x.substring("COUN"); a. g = 14 b. g = 13 c. Error d. g = 13

String Program Options Complete any Two of the following. String Program Options Find last name Input first and last name into one String Output only the last name. Push: Support middle names Write a mad-lib program Have the user enter at least 4 pieces of information. Noun, Adverb (honestly), Adjective (messy), Verb, Geographical location, … The computer will generate the mad-lib English to Pig-Latin translation program. The rules of Pig Latin are If the word begins with a consonant -- such as ``string,'' ``Latin'' -- divide the word at the first vowel, swapping the front and back halves and append ``ay'' to the word -- ``ingstray,'' ``atinLay.'' If the word begins with a vowel -- such as ``am,'' ``are,'' ``i'' -- append ``yay'' to the word -- ``amyay,'' ``areyay,'' ``iyay.'' If the word has no vowels (other than 'y') -- such as ``my,'' ``thy'' -- append ``yay'' to it -- ``myyay,'' ``thyyay.'' Level 1, Translate a single word Level 2: Translate a sentence. Input a word, output whether or not it is a palindrome.