CS 0401 Lecture Notes - Lecture 5: Traffic Ticket
82 views2 pages
Document Summary
Anytime you are using a scanner to read from keyboard or file: you must use . 1/19/17 lecture 5 project emulating getting a traffic ticket review of last week: throws exception after the method example: public static voic main( string[] args) throws exception. Using kbd. next(); will take the next token. If the user enters more than one token, the next time kbd. next() is called, it will take the second word the user inputs. Using kbd. nextline(); - it will clear the buffer, but it will return the entire string the user inputs, so the user can use a phrase, first and last name, etc. The user must enter either true or false or it will throw a user input mismatch error can be any combination of case. If you want to use yes or no use an if statement. If you want to include more than yes (like yea) flag. touppercase(); - will just create a temporary copy of the string.
Get access
Grade+
$40 USD/m
Billed monthly
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers