CSE 142 Lecture Notes - Lecture 12: Gold Base

38 views6 pages
Verified Note

Document Summary

October (cid:800)(cid:800)nd, (cid:800)(cid:798)(cid:799)8 - string and char, while loops, fencepost loops, & // if you count the letters in washington , n is actually the. However in java, the first letter counts as 0, then moves forward from there. // the first character you would like to include, and then the first character you would like to not include. Fencepost loops in looppractice. java for ( int i = 0; 1 < word. lenth(); i++) { // make hello h-e-l-l-o public static void spellout(string word) { // wrong because we do not want the dash after the word! ---jgrasp: operation complete. for ( int i = 0; 1 < word. lenth() - 1; i++) { // note: there are dashes around the space in happy birthday. There are ways to avoid that, however for this problem, the prompt was to put a dash in between every two characters, and a space counts so therefore, it is not a problem.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents