Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3,4 C++ Programming. Please answer all ASAP. Thank you very much. Question 3: Write a program that asks for a word of up to 12

3,4 C++ Programming. Please answer all ASAP. Thank you very much.

Question 3: Write a program that asks for a word of up to 12 letters. Then the program asks for two whole numbers from 1 to 12 inclusive. It then swaps the two characters at the mentioned positions. Below is an example of what the output could look like:

Enter a string of 12 letters or less: Mountain Enter the position of the first letter to be changed: 2 Enter the position of the second letter to be changed: 5 The word after modifications is Mantogne

(Hint: Moving a letter in the word overwrites the new destination. You have to bypass this problematic by keeping the data elsewhere first.)

Question 4: Write a program that asks for a number made up of 7 digits (exactly). Then the program display the inverse number (mirror image) and the previous number of the latter. Below is an example of the output:

Enter a word: 1456734 The mirror number is 4376541 The previous number is: 4376540

(Note: We will not perform validity tests. We assume that the user enters a number of 7 figures)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions

Question

darcy manages a webpage for her business. she uses FTP to

Answered: 1 week ago