ITEC 1620 Lecture 18: 1620_lecture_18

26 views2 pages

Document Summary

The api for the digitcode class is given below. Each instance of this class represents a two-digit code. The default code is 1,2 1 is the first digit of the code, and 2 is the second digit of the code. This class performs no error checking other than that specified in the api below. Constructs a new two-digit code set to the default 1,2. If the two parameters represent a valid code, then the code is set to first,second. Otherwise, the code will be set to the default 1,2. Method summary boolean changecode (int old1, int old2, int new1, int new2) To do so, old1,old2 must match the current code, and new1,new2 must represent a valid code. Returns true if the code is changed, and false otherwise. Example: if the current code is 1,2, then changecode(1,2,3,4) will change the code to 3,4 and return true.

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