Question
Write the program reverseArgs.cpp that takes command line input arguments and prints them back in reverse order. For example, if you ran the program as
Write the program reverseArgs.cpp that takes command line input arguments and prints them back in reverse order. For example, if you ran the program as ./reverseArgs first_arg second_arg, you would get an output back of second_arg first_arg. If you ran the program as ./reverseArgs I love gorgonzola cheese, but I hate toothpaste, you would get an output back of toothpaste hate I but cheese, gorgonzola love I. This is why I (lovingly) refer to this exercise as the Yoda program If you ran the program with double quotes, then the words within should act as one unit. For example: ./reverseArgs I would rather be at "UC Santa Barbara" would output: UC Santa Barbara at be rather would I. You are only permitted to use the iostream library. A session should look exactly like the following example (including whitespace and formatting - note that there is no whitespace at the end of each of these lines and each printed line has a newline at the end), with all manners of different numbers for inputs and the output:
GONZO CPP Write a program gonzo.cpp that takes 2 command line input arguments: a number (N) and a name. The program then does 2 things: it prints out what the remainder of N divided by 10 is and, on the next line, prints out the name N times separated by a comma and space character with a period at the end of the sentence. You are only permitted to use the iostream library and you must use a switch statement at least once in this program. A session should look exactly like the following example (including whitespace and formatting note that there is no whitespace at the end of each of these lines and each printed line has a newline at the end), with all manners of different numbers for inputs and the output: /gonzo 5 jim 5 divided by ten leaves a remainder of five. jim, jim, jim, jim, jim. ./gonzo 53 pam 53 divided by ten leaves a remainder of three. pan, pam, pam, pam, pam pam, pam, pam pam, pam pam pam, pam pam pam, pam, pam, pam, pam pam, pam, pam pam, pa m, pam, pam, pam, pam, pam, pam, pam, pam, pan, pams pam, pam, pams pam, pam, pam, pam, pam, pam, Pams pam, pam, pams pam pam pam, pam pam pam ./gonzo 20 dwight 20 divided by ten leaves a remainder of zero. dwight, dwight, dwight, dwight, dwight, dwight dwight, dwight, dwight, dwight, dwight, dwight, dwight, dwight, dwigh t, dwight, dwight, dwight, dwight, dwight. ./gonzo 18 michael 18 divided by ten leaves a remainder of eight. michael, michael, michael, michael, michael, michael, michael michael, michael, michael, michael, michael, michael michael, michael, michael, michael, michaelStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started