15-121 FALL 2020 (Reid-Miller)

HOMEWORK 1 - due Tuesday, 8 September 2020 by 11:55PM

For this assignment you will do some coding practice problems on the CodingBat website to build up your skills solving and writing code in Java. The problems are typical of a first or second Computer Science course. Each problem has a simple description and some sample input with expected output. You type code in the method body and click the Go button to save, compile, and run. The results of the CodingBat tests appear on the right side of the page. Your aim is pass all the test cases that CodingBat runs for you.

CodingBat has some warmup problems that you might want to try first. Since these problems have solutions, you can use them as a model for other Java coding problems. CodingBat also has help pages and videos on various topics.

Assignment

Go to the CodingBat website and complete the problems listed below. Each time you solve a problem (all the tests pass), cut and paste your solution (including the method header) into in a plain-text (ASCII) file that has most 80 characters per line. Do not use Word (.doc or docx) or Rich Text Format (.rtf). At the top of the file put your name and andrew id. There are 20 problems and each problem is worth 1 point.
Logic-1:
  more20
  redTicket
  fizzString2

Logic-2:
  makeChocolate

String-1:
  theEnd
  makeOutWord
  without2

Array-1:
  swapEnds
  makeLast
  unlucky1

Array-2:
  matchUp
  only14
  has12
  twoTwo

String-2:
  bobThere
  xyBalance
  xyzThere
  mixString

String-3:
  mirrorEnds

Array-3:
  seriesUp

PIAZZA

You can use Piazza to ask general questions about the assignment or about Java for the course staff or for other students to answer. Please make your questions public so the course staff only need answer the question once. If your question is of general interest, we reserve the right to make a private post public, after anonymizing your name. You should, however, treat Piazza with the same academic integrity policies outlined above and in the academic integrity policy statement on the course website. If your question may reveal a solution to a problem make your question private. Please use appropriate etiquette when writing to Piazza.

Hand-In Instructions & Late Submissions

Submit your answers to the problems in a .txt plain text file (no .doc, .docx, .rtf, or .rar files) to autolab. Since, you may submit as many times as you like, be sure to submit whatever you have done at least one day early and again an hour before the deadline. Hardware and networking problems can occur at any time. We will grade you last submission before the deadline.

You may use up to 2 late days (no partial late days) with no penalty. Recall, you can use at most 4 lates total for all your assignments. Save your late days for when something unexpected arises or when things get really busy.