import java - BufferedReader br = new BufferedReader(new...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.util.Scanner; public class Exercise8_15 { public static void main(String[] args) { Scanner input = new Scanner(System.in);; String line = null; line = input.nextLine(); int upperCaseCount = 0; for (int i=0; i<line.length(); i++) { for(char uc='A'; uc<='Z'; uc++) { if (line.charAt(i) == uc) { upperCaseCount++; } } } System.out.println("The number of uppercase letters is:" + upperCaseCount);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String userName = null; // read the username from the command-line; need to use try/ catch with the // readLine() method try { userName = br.readLine(); } catch (IOException ioe) { System.out.println("IO error trying to read your name!"); System.exit(1); }...
View Full Document

This note was uploaded on 10/20/2010 for the course ITEC 1302 taught by Professor Liang during the Spring '10 term at Armstrong State University.

Page1 / 2

import java - BufferedReader br = new BufferedReader(new...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online