Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PROBLEM 1 (a) Write a declaration to store the string This is a test in an array named char strtest [ 14 ] . Then

image text in transcribed

PROBLEM 1 (a) Write a declaration to store the string "This is a test" in an array named char strtest [ 14 ] . Then write a for statement to display the string in reverse order: tset a si sihT" (b) Write a while loop to display the string as stored. The expression while (str test [i] != ' \0' ) can be used. [5 points] 5 points] (c) Write a for statement to display only the array elements t, e, s, andt. 5 points] e) Define a vector of strings using the atrteat [) aray using the statement vector strvec (strtest, strtest+14) . Rewrite the C++ code fragment in part (a) above using vector class and functions specified in Table 7.2 of Bronson text. Include necessary libraries. You may use the vector functions: strvec.size, strvec.begin, strvec.end O, strvec.at (index), etc. [10 points]

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

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions