Skip to content

Instantly share code, notes, and snippets.

@EddyLuten
Last active November 4, 2016 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EddyLuten/95c5dd446ba35d22c93b007f240bcebf to your computer and use it in GitHub Desktop.
Save EddyLuten/95c5dd446ba35d22c93b007f240bcebf to your computer and use it in GitHub Desktop.
public static void main(String args[]) {
{
Scanner input = new Scanner (System.in);
int purchases = 0; // init purchases
char firstLetter;
do
{
// TODO: print some shit on the screen here
// all the things all at once
firstLetter = Character.toLowerCase( input.nextLine().charAt(0) );
if (firstLetter == 'p') {
// process the purchase
++purchases; // or whatever you're supposed to do.
}
} while (firstLetter != 's'); // let's go do the next thing!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment