C++ Programming: From Problem Analysis to Program Design
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
Question
Book Icon
Chapter 6, Problem 11SA
Program Plan Intro

Program Plan:

  1. Define the function isWhitespace, which takes a single character as input and returns a Boolean value indicating whether the character is a whitespace character or not.
  2. Within the isWhitespace function, use a series of conditional statements to check if the character is equal to any of the whitespace characters: space (' '), tab ('\t'), newline ('\n'), carriage return ('\r'), form feed ('\f'), or vertical tab ('\v').
  3. If the character is equal to any of the whitespace characters, return true; otherwise, return false.
  4. Define the main function.
  5. Within the main function, declare several character variables, and assign them different characters including whitespace and non-whitespace characters.
  6. Pass each of these character variables to the isWhitespace function to test whether they are whitespace characters or not.
  7. Print the results of each test using std::cout.

Program Description:

To define a function that can be used to determine whether a given character is a whitespace character or not.

Blurred answer
Students have asked these similar questions
Under what circumstances can you successfully return a pointer from a function?
3A in Python language please:
Programming Language : R programming (R Studio) A twin prime is a prime that has a prime gap of two. Sometimes the term twin prime isused for a pair of twin primes. For example, the five twin prime pairs are (3, 5), (5, 7),(11, 13), (17, 19) and (29, 31). Write a function that returns the number of all twin primepairs between 1 and a given number n.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning