Letter Input

  • Uploaded by: david johnson
  • 0
  • 0
  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Letter Input as PDF for free.

More details

  • Words: 150
  • Pages: 2
Letter Input /* * Main.java * * Created on September 25, 2007, 4:35 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package letterinput; /** * * @author instructor */ public class Main { /** Creates a new instance of Main */ public Main() { } /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here System.out.println("Please enter a letter:"); char aLetter = MyInput.readChar(); //define variable int count = 0; while((aLetter != 'Q') && (aLetter != 'q')) { if((aLetter == 'T')||(aLetter == 't')||(aLetter == 'P')||(aLetter == 'p')) { System.out.println("Invalid Letter.");//you should not count invalid letter } else { count = count + 1; } System.out.println("Please enter the next letter: "); aLetter = MyInput.readChar();

} System.out.println("You entered " + count + " valid letters in total."); } }

Related Documents

Letter Input
November 2019 28
Input
June 2020 24
Input
October 2019 63
Input 2
June 2020 14
Data Input
May 2020 8
Input Devicesz
May 2020 7

More Documents from ""

Syll_fall_2008
November 2019 17
Acct 101 Syllabus
November 2019 27
Classex For Loop
November 2019 24
Jake S Client And Pet Data
November 2019 20
Mortgage Table
November 2019 18