Skip to content

Stuycs-K/APCS1-LAB02-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

APCS1-LAB02

You must write three methods, and write many tests for each. Do not forget to test empty strings where appropriate.

Methods to write:

  1. myIndexOf()

  2. myCompareTo()

  3. int parseInt(String) : This method will take a string like "123" and return the value 123. You may assume that the String is formatted like a valid integer. The string contains only digits, optionally starting with a '-', and the range of values that work is between -(2^31) + 1 and 2^31 - 1) inclusive. The min value of an int is excluded since you cannot make the positive version and negate it. I will not test this value, but there is an easy workaround for it.

Negative numbers should work for parseInt() but you should worry about that last after you get non negative numbers working.

Commits

For this lab be sure to commit regularly (any time you make meaninful progress or improve your methods) This means multiple (more than 2) commits in class, and multiple (more than 2) commits at home each day until you are done.

Make sure you commit with meaningful messages.

Directions

  1. Write some test cases for myIndexOf using the builtin methods to compare the results to. e.g. Call both "Hello".indexOf("el") and StringMethods.myIndexOf("Hello","el")

  2. Write and test myIndexOf

  3. Write some test cases for myCompareTo using the builtin methods to compare the results to.

  4. Write and test myCompareTo

  5. Now you will write test cases for, and create one more method: int parseInt(String). Place it in the StringMethods.java file.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages