Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this program, you will be reading a series of characters from input and measuring the value of the characters passed in. There will be

In this program, you will be reading a series of characters from input and measuring the value of the characters passed in.

There will be a series of n lowercase characters provided via standard input. You will read these n characters and measure the value of each of these individual characters using the following key of values:

a = 1 b = 2 c = 3 . . . x = 24 y = 25 z = 26

Each of these characters will be on an individual line by themselves. The input will be terminated with the character ! on the final line of standard input.

You must keep track of the total value as you read each character. Your reading of the characters will be terminated in one of two ways. The first is that you will read all of the characters from input and output the final value of all of them collectively with a newline after this number. The second is that you will terminate early because the total goes over 100.

If reading a character causes the value to go over 100, you will print two lines of text to output. The first line will read Too Many and have a newline follow it. The second line will be how many characters were read up to the point of going over the total of value of 100, including the character which caused the overage. A newline will follow this.

An example of this would be reading in a series of the character z from input. You would read 4 of this character before going over the value 100. Once you read this 4th z and broke the 100 threshold, you would print out: Too Many 4

C++

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions

Question

Write a note on job design.

Answered: 1 week ago

Question

Compute the derivative of f(x)cos(-4/5x)

Answered: 1 week ago

Question

Discuss the process involved in selection.

Answered: 1 week ago

Question

Differentiate tan(7x+9x-2.5)

Answered: 1 week ago