CSE 116 Study Guide - Local Variable

30 views6 pages

Document Summary

Reflections on hw1 - the count_e method. Hw1 reflections, page 1. At the completion of the method the value of the. This returned value becomes the value of the method call expression. The value of the expression count_e( electric ) is 2, since there are two e" characters in electric . A diagram showing the flow of control through this code is given on the next page. S" is the parameter of the method named count_e". It is a local variable whose initial value is given by the argument provided in a method call. For example, electric is the argument in the call. Valid indices for a string range from 0 (zero) to one less than the length of the string. This expression is true if and only if the character in the j- th position of the string s is e". S" is assigned the value of the method call"s argument. Count" is assigned 0 (zero)

Get access

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

Related Documents