Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please program in c++ Program Requirements Write a program that does the following: 1. Read a string (a C-style char array) from the user through

please program in c++image text in transcribed

Program Requirements Write a program that does the following: 1. Read a string (a C-style char array) from the user through the console o You can assume that the user will not enter more than 40 characters *Remember that 1 more character is needed for the null string terminator The user may enter letters (lowercase or uppercase), digits, or symbols (", :@.#,, etc.) 2. Copy all the letters from the input string into a new array, and copy all the digits from the input string into another new array (see Figure 1) Each new array must be dynamically allocated to the exact size needed to hold all of the letters or digits, plus one final location that must be set to the null string terminator character You can use the isalpha() and isdigit() functions (#include ) to identify letters and digits, respectively o o Ignore any characters that are not letters or digits 3. Display the letter and digit arrays Input String = FN2187-3poandR2D2 StringArrayFNcpoandRD NumberArray 2187322 Figure 1: Creating the letter array and digit array 4. Reverse the order of the characters in the letter and digit arrays (see Figure 2) o Write a function to modify each original array (don't make new arrays) 5. Display the reversed letter and digit arrays

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

Graph Database Modeling With Neo4j

Authors: Ajit Singh

2nd Edition

B0BDWT2XLR, 979-8351798783

Students also viewed these Databases questions