CSE 142 Lecture Notes - Lecture 15: Abracadabra

31 views8 pages
Verified Note

Document Summary

October (cid:800)(cid:807)th, (cid:800)(cid:798)(cid:799)(cid:806) - more boolea(cid:290)s, assertio(cid:290)s, & midter(cid:289) re(cid:362)ie(cid:363) 1 // this file contains some sample methods that are similar to. 37 // write a static method called containsseven that takes a single. 39 // and returns a true if the value passed contains a 7 as one of. You may assume the value passed is non-negative. 55 // write a static5 method called digitsum that takes an integer n. 57 // returns the sum of the digits of n. you may assume n is. 59 public static int sumdigits( int num) { 69 // write a static method called rollseven that simulates the. 71 // their sum is equal to 7. 73 // the number of rolls it took to get to 7. 75 // roll #1: 3 + 5 = 8. 76 // roll #2: 2 + 1 = 3. 77 // roll #3: 1 + 4 = 5.

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