Write one or more C++ statements that perform the following tasks: a) Define a constant integer variable NSize, initialized to m, where m is the length of your full name. b) Declare an array with NSize elements of type char, and initialize the elements with your full name. c) Print the first and the last elements of the array in (b).

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 1TF: Mark the following statements as true or false. A double type is an example of a simple data type....
icon
Related questions
Question
Write one or more C++ statements that perform the following tasks:
а)
Define a constant integer variable NSize, initialized to m, where m is the length of your
full name.
b) Decdare an array with NSize elements of type char, and initialize the elements with your
full name.
c)
Print the first and the last elements of the array in (b).
d) Print all the array elements using a for statement.
e)
Count and display how many vowels are in the array. Use the for and if statements.
f)
Replace vowels in the array with '$'. Print the array again.
g)
Declare an array, initialize it with your student number.
h)
Total up all numerals in the array declared in (g) using a while statement.
i)
Sort the numerals in the array declared in (g) in descending order.
j)
Find any duplicates in the numerals. Replace the duplicates with alphabet 'd'.
Transcribed Image Text:Write one or more C++ statements that perform the following tasks: а) Define a constant integer variable NSize, initialized to m, where m is the length of your full name. b) Decdare an array with NSize elements of type char, and initialize the elements with your full name. c) Print the first and the last elements of the array in (b). d) Print all the array elements using a for statement. e) Count and display how many vowels are in the array. Use the for and if statements. f) Replace vowels in the array with '$'. Print the array again. g) Declare an array, initialize it with your student number. h) Total up all numerals in the array declared in (g) using a while statement. i) Sort the numerals in the array declared in (g) in descending order. j) Find any duplicates in the numerals. Replace the duplicates with alphabet 'd'.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Array
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr