Count how many uppercase letters are in the input. Program must have a function called count_upper that takes two arguments: an integer denoting the length a character sequence and a string representing the character sequence. It counts the number of uppercase letters found in the character sequence. It returns an integer value indicating how many uppercase letters the sequence contains.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 8RQ
icon
Related questions
Question
In C++ program, please show the output of this program
Sample Test Cases:
#
0
2
2
3 abc
5 Abcde
3
5 UNiTy
7 jEjEmOn
8 p@shp@sh
4
m
3 AAA
4 #Rmg
2 ур
2 SF
Input
0
1
2
3
Invalid character
3
Invalid character
Output
Transcribed Image Text:Sample Test Cases: # 0 2 2 3 abc 5 Abcde 3 5 UNiTy 7 jEjEmOn 8 p@shp@sh 4 m 3 AAA 4 #Rmg 2 ур 2 SF Input 0 1 2 3 Invalid character 3 Invalid character Output
Problem:
Count how many uppercase letters are in the input.
Program must have a function called count_upper that takes two arguments: an integer
denoting the length a character sequence and a string representing the character sequence. It
counts the number of uppercase letters found in the character sequence. It returns an integer
value indicating how many uppercase letters the sequence contains.
Input Format:
Input begins with an integer Nindicating how many character sequences are in the input.
Succeeding lines begin with an integer tindicating how many characters ch follow.
Output Format:
For each input, output how many uppercase letters are found.
Constraint:
1 <= N <= 100
1 <= t <= 100
ch could be any letter in the alphabet (lowercase or uppercase)
Transcribed Image Text:Problem: Count how many uppercase letters are in the input. Program must have a function called count_upper that takes two arguments: an integer denoting the length a character sequence and a string representing the character sequence. It counts the number of uppercase letters found in the character sequence. It returns an integer value indicating how many uppercase letters the sequence contains. Input Format: Input begins with an integer Nindicating how many character sequences are in the input. Succeeding lines begin with an integer tindicating how many characters ch follow. Output Format: For each input, output how many uppercase letters are found. Constraint: 1 <= N <= 100 1 <= t <= 100 ch could be any letter in the alphabet (lowercase or uppercase)
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Types of Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT