Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise #2: Shifting Array Elements Write a program that uses an array of size eight (8) and then prompts the user to input eight integers

image text in transcribed
Exercise #2: Shifting Array Elements Write a program that uses an array of size eight (8) and then prompts the user to input eight integers for the array. The program should do the following 1. Print the numbers in the output given in the sample Input/Output 2 The user is prompted to enter an integer value k the program will then shift the array elements kpositions to the right, while the last Kelements are moved to the beginning of the array For example: if we have an array [1 23 4567 81 shifting 2 positions to the right should give the array [7 8123456] Sample Input/Output ns entered nunbers arei 1 2 3 S 7 8 1 values for an Array Enter the nunber of shifts: 3 Exercise #3: Strings' operations Write a C+ program that prompts the user to enter a sentence, the program then does the following 1. Prints the total characters in the sentence. 2. Prints the word count of the sentence, assuming only one space between each tow words Prints total vowel (a, e. i o, u) in the sentence 4. Prints the vowel frequency as shown in the sample below 5. Prints the sentence in reverse. 6. Prints the total number of characters other than the alphabets (Note: space is a character) 7. Prints the sentence in a way so that the case of each character is changed Le. from lower to upper and vice versa Sample input/outpu Enter eft niketo play ootball. o. ado a strins s to play foot Character Count 49 ord Count:9 Uove1 Count :13 Jowe1 Prequeney fleg dna innet llabtoof yalp ot sekil A .D Count 12 hange Case R aLI LIKES TO PLAY FOOTBALL TIS. RND COLF

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_2

Step: 3

blur-text-image_3

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

Privacy In Statistical Databases International Conference Psd 2022 Paris France September 21 23 2022 Proceedings Lncs 13463

Authors: Josep Domingo-Ferrer ,Maryline Laurent

1st Edition

3031139445, 978-3031139444

More Books

Students also viewed these Databases questions

Question

Identify the influence of social media on political communication

Answered: 1 week ago