CS 0401 Lecture Notes - Lecture 5: Traffic Ticket

81 views2 pages
19 Jan 2017
School
Course
Professor

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+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

Related Questions