1 Page

StringAss

Course: CS 55, Spring 2010
School: Santa Monica
Rating:
 
 
 
 
 

Word Count: 152

Document Preview

java.util.regex.Pattern; import import javax.swing.JOptionPane; // end of file signal is "end" public class StringAss { public static void main(String[] args){ String s; int v = 0 , ban = 0, inv = 0; do{ s = JOptionPane.showInputDialog("Input the code:"); if (!s.equals("end")){ // System.out.println(s); switch (check(s)){ case 1: ban++; case 0: v++; break; case...

Register Now

Unformatted Document Excerpt

Coursehero >> California >> Santa Monica >> CS 55

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
java.util.regex.Pattern; import import javax.swing.JOptionPane; // end of file signal is "end" public class StringAss { public static void main(String[] args){ String s; int v = 0 , ban = 0, inv = 0; do{ s = JOptionPane.showInputDialog("Input the code:"); if (!s.equals("end")){ // System.out.println(s); switch (check(s)){ case 1: ban++; case 0: v++; break; case 2: inv++;break; default: ; } } else break; }while (true); JOptionPane.showMessageDialog(null , "Vailed code entered: " + v + "\nBanned code entered: " + ban + "\nInvailed code entered:" + inv + "\n*Note:Banned is code still count as Vailed code."); } private static int check(String s) { String temp = null; char tc; s = s.trim(); if (s.length() != 13) return 2; else { temp = s.substring(3, 7); System.out.println(temp); try{ Integer.parseInt(temp); }catch (NumberFormatException e) { System.out.println("returned @ line 44"); return 2; } tc = s.charAt(9); Pattern.compile("^[A-Z]").matcher(tc).find(); if (!Character.isLetter(tc)){ System.out.println("returned @ line 50"); return 2;} if ((tc == 'R')&&(Integer.parseInt(temp) >= 2000)){ return 1; } return 0; // // // // } } }
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Santa Monica - ECON - 1
Problem Set #3Bruce Brown, Economics 1 (Microeconomic Principles), SMCStudents should understand how to calculate and interpret elasticities. The formula on the bottom of page96 of the textbook may be used, but I find it easier to remember Price Elasti
Santa Monica - ECON - 1
PS # 4 Outlines of Suggested AnswersBruce Brown, Econ. 1 (Micro-Principles) SMC1. True or False?i. F; ii. T; iii. F; iv. T; v. T; vi. F; vii. F; viii. T;2) The below graph shows the market for good X, initially with equilibrium quantity, QX* = 20 and
Santa Monica - ECON - 1
Problem Set #5Bruce Brown, Economics 1 (Microeconomic Principles), SMC1) What characteristic of a good causes, or is responsible for, the free rider problem (see Fig. 1-1 on page 227)?2) Describe how the properties of excludability and rivalry define d
Santa Monica - ECON - 1
Ch. 9 Study Guide AD AND AS 2007, BK Publishing, Inc.Q1) The goal(s)s of any national economy is (is are) to have:a) optimum output.b) low rates of employment.c) steady economic growth.d) a and c.243Ch. 9 Study Guide AD AND AS 2007, BK Publishing,
Santa Monica - ECON - 1
Ch. 10 Study Guide - DETERMINING NATIONAL INCOME 2007, BK Publishing, Inc.1Q1. When an economy comes to an equilibrium point below the full employment level, aphenomenon is known as:a) a recessionary gap.b) an inflation gap.c) full employment level.
Santa Monica - ECON - 1
Ch. 11 Study Guide Fiscal Policy 2007, BK Publishing, Inc.Q1) Marginal propensity to consume isa) change in consumption / change in real incomeb) change in savings / change in incomec) total consumption / total incomed) total savings / total income3
Santa Monica - ECON - 15
The Development of TransportationTheInfrastructure in 19th Century AmericaInfrastructure1Public vs. Private: The Internal ImprovementsPublicDebateDebate In 1800, the United States was geographicallyInlarge but with a small population.largeOth
Santa Monica - ECON - 15
The Transportation Revolution inAmerica, 1790-1860 The consequence was a unified nationaleconomy before the Civil War It involved: Turnpikes and Roads Canals Steamboats RailroadsThe Transportation Revolution wasthe Result of Federal and State G
Santa Monica - MATH - 07
Math 7 TestMr. GarciaNameInstructions.Show all your work.1. Uselimn!1thenaXbf (x) dx=anbZformula:fba+ani=1Zto evaluate:3(x2 + 2x3)dx22. Evauate:Z3. Evaluate:iZ3dx2=3=4(5x23)1 + sin xdxcos2 x4. Evaluate:Z=61
Santa Monica - MATH - 07
Math 7 Test 2Mr. GarciaNameInstructions.Show all your work. No partial credit will be given for stating answers. Box your answers.1. Discuss the dierentiability of f (x) at x = 0; x = 182x if x < 0<x x2 if 0 x 1f (x) =:x 1 if x 12. Use the den
Santa Monica - MATH - 07
Tuesday, March 31, 20092:22 PMm7t2f06Inserted from: <file:/C:\Users\Eddy \Documents\m7t2f06.pdf>New Section 1 Page 1New Section 1 Page 2New Section 1 Page 3New Section 1 Page 4New Section 1 Page 5
Santa Monica - MATH - 07
More on Approximating area with rectangles.consider the function: f (x) = 16 x2 ; suppose we want to approximate thearea under the curve with rectangles on the interval [0; 4] with a partition ofwidth 0:5y16141210864200.51.01.52.02.53.0
University of Texas at Dallas - PHYSICS - 303
Instructor: Dr. Matthew T. Haley TA: Rex Lundgren LAs: Noor Momin Evelyn Powell Gunjan SinghPHY303K-MI, MechanicsUniversity of Texas at Austin Department of Physics, Austin, TX23Interactive Quiz4Internal Forces, Internal WorkCenter of Mass5Inter
LSU - BLAW - 1000
Chapter 8 SyntaxSyntaxIt's the branch of linguistics that describes and explains the arrangement of ordering words within phrases and sentences.Syntax: structure and ordering of components within a sentence.Remember Word Order is important for Engli
LSU - BLAW - 1000
Chapter 10 Pragmaticshttp:/www.youtube.com/watch?v=c7O5a0s2sqM&feature=rela Pragmatics Pragmatics: the study of intended meaning (Study of Social Language) when there is something more to or something different from the literal meaning is conveyed, an
LSU - BLAW - 1000
COMD 2050CHAPTER 1: THE ORIGINS OF LANGUAGEAccording to Darwin, early humans had already developed musical ability prior to language; were using it to "charm each other" Is this human language? Does a language have to be audible?theories regarding huma
LSU - BLAW - 1000
Chapter 2Animals and human language Do animals really "understand" human words? or Do animals produce a particular behavior in response to a stimulus? Are vocalizations the same as speech? Is Communication and Language the same thing? http:/www.youtube.
LSU - BLAW - 1000
Chapter 3: Sounds of LanguagePhonetics: the study of the characteristics of speech sounds. Articulatory phonetics: how speech sounds are made (articulated). - What the articulators like the teeth, tongue, lips, hard and soft palate etc.are doing in the m
LSU - BLAW - 1000
The Sound Patterns of LanguageChapter 4:Bilabial Labiodental Dental/interdental Alveolar Palatal Velar Glottal Stops Fricatives Glides and liquids Affricates Nasals Voiced Voiceless http:/www.youtube.com/watch?v=YOPnBz6ctU&feature=relmfu Phonetics
LSU - BLAW - 1000
COMD 2050: Chapter 5New wordsEtymology: the study of the origin and history of a word How are new words created? We create new words because there may not be another way to express ourselves we don't know or cant remember the word to use. *this relates
LSU - BLAW - 1000
Chapter 6: MorphologyMorphology is the study of the forms or structure of words and their parts. Understanding the basic forms in a language, not just understanding words"I have two truck" "I have two trucks" "I swimmed home" "I swam home"Jump Jumps Ju
LSU - BLAW - 1000
Chapter 7http:/www.youtube.com/watch?v=ODGGrammarGrammarA way of describing the structure of phrases and sentences Words can only be combined in a limited number patterns.Ex: book, the, in _ Boys, the lucky _Grammar: Grammatical or Not?Chapter perp
LSU - BLAW - 1000
Chapter 9SemanticsThe epic semantic question:"So really, what do you mean?"SemanticsSemantics: the study of meaning. What kind of meaning? Linguistic semantics deals with the conventional meaning conveyed by the use of words, phrases and sentences.C
LSU - BLAW - 1000
Study Guide for Test 1: chapters 1-6 -This test will consist of 50 questions, a mixture of multiple choice and true/false -Read each chapter, the power points should be used as a guide for interpreting the material. -know key terminology in each chapter -
LSU - BLAW - 1000
Study Guide for Exam 2: Chapters 7- 11 -This test will consist of 50 questions, a mixture of multiple choice and true/false -Read each chapter, the power points should be used as a guide for interpreting the material. -know key terminology in each chapter
LSU - BLAW - 1000
Study questions for Value Line case 1. What do the financial ratios in case Exhibit 7 tell you about the operating performance of Home Depot? What additional information do the different ratios provide? Complete and compare a similar analysis for Lowe's.
LSU - BLAW - 1000
Class meeting time: Tuesday & Thursday, 3:10-4:30 pm Location: Instructor: 6 Lockett Janet Bradshaw M.C.D, CCC/L-SLP: jbrads2@tigers.lsu.edu Office Number: 225.578.1711 Office hours: Tuesday 1:00 pm 3:00 pm or by appointment Office location: 32 Hatcher Ha
LSU - BLAW - 1000
Exam 2: December 4th What are the four categories of products: 1) convenience 2) shopping- little more involvement 3) specialty- more of a niche group- products are a little bit more brand oriented 4) unsought- whenever you never knew you had to look at t
LSU - BLAW - 1000
Final will be Tuesday MAY 3 all multiple choice!3 Types of Presenters: -Show runner -Neophyte -Artists 3 Pricing Strategies: 1.) Price Skimming: set the price for high as you can for as long as you con, until your competition catches up. 2.) Penetration
LSU - BLAW - 1000
Doug Jackson Business Law Section 8 Chapter 5 March 22, 2006 Chapter 5 Study Questions 1.) An intentional tort requires intent. The tortfeasor must intend to commit an act, the consequences of which interfere with the personal or business interest of anot
LSU - BLAW - 1000
Doug Jackson Business Law Section 8 Chapter 9 Study Questions April 17, 2006 Chapter 9 Study Questions 1.) Not by the personal or subjective intent, or belief of a party. The theory is that a party's intention to enter into a legally binding agreement, or
LSU - BLAW - 1000
Doug Jackson Business Law Section 8 Chapter 10 Study Questions April 17, 2006 Chapter 10 Study Questions 1.) The first requirement for an effective offer is a serious intent on part of the offeror. Serious intent is not determined by the subjective intent
LSU - BLAW - 1000
Doug Jackson Business Law section 8 Chapter 12 questions May 2, 2006 Chapter 12 Study Questions 1.) The general rule is that a minor can enter into any contract that an adult can, provided that the contracts is not one prohibited by law for minors (for ex
LSU - BLAW - 1000
Doug Jackson Business Law section 8 Chapter 13 study questions May 2, 2006 Chapter 13 Study Questions 1.) Mistakes of fact occur in two forms-mutual (bilateral) and unilateral. A mutual or bilateral mistake is made by both of contracting parties. A unilat
LSU - BLAW - 1000
Logan Cooper BLAW 3201-10Chapter 12 STUDY QUESTIONS1) What is consideration? The value given in exchange for a promise i) What are the elements of consideration? a. something of legally significant value must be given in exchange for the promise b. usua
LSU - BLAW - 1000
Logan Cooper BLAW 3201-10Chapter 1 STUDY QUESTIONS1) If justice is defined as the fair, impartial consideration of opposing interests, are law and justice the same thing? No, law is a set of enforceable rules between individuals and society, justice is
LSU - BLAW - 1000
Logan Cooper BLAW 3201-10 Fall 2006Chapter 2 STUDY QUESTIONS1. If a corporation is incorporated in Delaware, has its main office in New York, and does busi ness in California, but its president lives in Connecticut, in which state(s) can it be sued? In
LSU - BLAW - 1000
Logan Cooper BLAW 3201-10Chapter 4 STUDY QUESTIONS1) What is the basic structure of the American national government? The basic structure is a federal form. 2) What is the national government's relation to the states? The national government and state g
LSU - BLAW - 1000
Chapter 7 STUDY QUESTIONSLogan Cooper BLAW 3201101) What are the four elements of negligence? 1. Defendant owed Plaintiff duty of care 2. Defendant breached that duty 3. Plaintiff suffered legal injury 4. Defendant's breach caused that injury 2) In a ne
LSU - BLAW - 1000
Logan Cooper BLAW 3201-10Chapter 11 STUDY QUESTIONS1) In the context of an offer, how is intent and its seriousness determined? Intent and seriousness is what a reasonable person offeree would assume the offeror meant. i) Why must a contract have "reaso
LSU - BLAW - 1000
Chapter 12 STUDY QUESTIONS1) What is consideration? i) What are the elements of consideration?2) What is "adequacy of consideration"?3) Can a preexisting duty satisfy the requirements of consideration?4) What are some of the exceptions to the preexist
LSU - BLAW - 1000
Logan Cooper BLAW 3201 10Chapter 13 STUDY QUESTIONS1) What is the minor's right to disaffirm a contract? A minor can disaffirm a contract just by expressing that intent. The conract can be disaffirmed at anytime while a minor or a reasonable time after
LSU - BLAW - 1000
Doug Jackson Business Law section 8 Chapter 11 April 25, 2006 Chapter 11 Study Questions 1.) Consideration is usually defined as the value (such as money) given in return for a promise (such as the promise to sell a stamp collection on receipt of payment)
LSU - BLAW - 1000
Andrew Heacock 3/23/06 BLAW 3201 Sec. 8 Crews v. Hollenbach Facts: On March 23, 1996, an employee of Honcho & Sons named John Hollenbach was digging a hole at an excavation site when he struck and severed a natural gas line owned by Washington Gas. The po
LSU - BLAW - 1000
Supreme Court No. 2003-371-Appeal. (PC 01-4821) Russell Gorman, Jr. et al. v. St. Raphael Academy. : : :NOTICE: This opinion is subject to formal revision before publication in the Rhode Island Reporter. Readers are requested to notify the Opinion Analys
LSU - BLAW - 1000
Logan Cooper BLAW 3201-10 Chapter 13 Case Brief Gorman v. St. Raphael Academy Rohde Island Supreme Court, 2004. 853 A.2d 28.Facts: Russell Gorman III was an honor student at St. Raphael Academy, a private coeducational catholic high school in Pawtucket,
LSU - BLAW - 1000
Andrew Heacock 4/25/06 BLAW 3201 Sec. 8 Hamer v. Sidway Court of Appeals of New York, Second Division 1981. 124 N.Y. 538, 27 N.E. 256. Facts: In 1869, at the 50th Anniversary of Samuel Story, William E. Story Sr. offered his nephew $5,000 if he would refr
LSU - BLAW - 1000
Andrew Heacock BLAW 3201, Sec. 8 4/18/06 Homer v. Burman Indiana Court of Appeals, 2001 743 N.E.2d 1144 Facts: Dave and Annette Homer (the Homers) owned a house at 432 North Boots in Marion, Indiana that they rented out. In August of 1999, their tenant co
LSU - BLAW - 1000
LexisNexisTM AcademicRIO PROPERTIES, INC., Plaintiff-Appellee, v. RIO INTERNATIONAL INTERLINK, Defendant-Appellant. RIO PROPERTIES, INC., Plaintiff-Appellee, v. RIO INTERNATIONAL INTERLINK, Defendant-Appellant. No. 01-15466, No. 01-15784 UNITED STATES CO
LSU - BLAW - 1000
Logan Cooper BLAW 3201-10Chapter 10 STUDY QUESTIONS1) What is the objective theory of contracts? That the intent to form a contract is judged by outward facts in the view of a "reasonable person" 2) What distinguishes a bilateral contract from a unilate
LSU - BLAW - 1000
Logan Cooper BLAW 3201-10 Chapter 11 Case BriefOsprey L.L.C. v. Kelly-Moore Paint Co. Supreme Court of Oklahoma, 1999. 984 P.2d 194.Facts: Osprey leased a store to Kelly-Moore Paint Company in Edmond, Oklahoma. The lease was for 15 years with two five-y
LSU - BLAW - 1000
Osprey v. Kelly-Moore Paint Co.1999 OK 50 984 P.2d 194 70 OBJ 1809 Case Number: 90206 Decided: 05/25/1999 Mandate Issued: 06/24/1999 Supreme Court of Oklahoma OSPREY L.L.C., a limited liability company, Plaintiff/Appellant, v. KELLY-MOORE PAINT CO. INC.,
LSU - BLAW - 1000
Logan Cooper BLAW 3201-10 Chapter 3 Case Brief Rio Properties, Inc. v. Rio International Interlink United States Court of Appeals, Ninth Circuit, 2002, 284 F.3d 1007. Facts: Rio Properties, Inc. owns the Las Vegas hotel, RIO All Suite Casino Resort, as we
LSU - BLAW - 1000
Logan Cooper BLAW 3201-10Chapter 15 STUDY QUESTIONS1) What is the Statute of Frauds? The statue of frauds are statutes in individual states that require certain contracts to be put in writing in order to be enforceable. 2) Why do certain contracts have
LSU - BLAW - 1000
UNITED STATES DISTRICT COURT DISTRICT OF MINNESOTA _ Vonage Holdings Corporation, Plaintiff, v. MEMORANDUM AND ORDER Civil No. 03-5287 (MJD/JGL)The Minnesota Public Utilities Commission, and Leroy Koppendrayer, Gregory Scott, Phyllis Reha, and R. Marshal
LSU - BLAW - 1000
Logan Cooper BLAW 3201-10 Chapter 43 Case Brief Vonage Holdings Corp. v. Minnesota Public Utilities Commission United States District Court, District of Minnesota, 2004, 290 F.Supp.2d 993. Facts: This case is an example of technology growing faster than t
Vermont Tech - ENGINEERIM - 1000
function [a,b] = calc_sides(c,theta) % given the hypotenuse and angle of a right % triangle, calculate other two sides of % triangle a = c * cos(theta); b = c * sin(theta); end function print_values(a,b,c,theta) % given the three sides and one angle of a
Vermont Tech - ENGINEERIM - 1000
clc clear all f=[10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 0 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 0 0 0 100 0 0 0 0 0 0 0 0 0 0 0 0; 0 0 0 0 0 0 0 0 0 0; 0 0 0 0 0 250 0 0 0 0 0 0 0 0 0 0; 0 0 0 0 0 0 300 0 0; 0 0 0 0 0 0 0 320 0 0 0 0 0 0 0 0; 0 0
Vermont Tech - ENGINEERIM - 1000
clc clear all f=[10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 0 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 0 0 0 100 0 0 0 0 0 0 0 0 0 0 0 0; 0 0 0 0 0 0 0 0 0 0; 0 0 0 0 0 250 0 0 0 0 0 0 0 0 0 0; 0 0 0 0 0 0 300 0 0; 0 0 0 0 0 0 0 320 0 0 0 0 0 0 0 0; 0 0
Vermont Tech - ENGINEERIM - 1000
function [vout] = Untitled2( R1,R2,w,C1 ) vout=(R2/R1)*(1/(1+(w*R2*C1)^2)^.5); end
Vermont Tech - ENGINEERIM - 1000
function [vout] = Untitled2( R1,R2,w,C1 ) f=[10 20 50 100 200 250 300 320 340 360 400 450 500 1000 2000 10000]; R2=46500; R1= 4600; w=[2*pi*f]; C1=.01*10^-6; vout=(R2/R1)*(1/(1+(w*R2*C1)^2)^.5); end