Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help we solve task 1 and 2 please Problem 1 Use switch-case statements for this program. Write a menu-driven c program which has the following

Help we solve task 1 and 2 please

image text in transcribed
Problem 1 Use switch-case statements for this program. Write a menu-driven c program which has the following options: Factorial ofa number Prime or not Odd or even Exit PP'P!' Once a menu item is selected the appropriate action should be taken and once this action is finished, the menu should reappear. Unless the user selects the 'Exit' option the program should continue to run. Problem 2 Left-right shift array elements: Write a program that performs the following tasks: a. Define a symbolic constant N that can be any positive integer. b. The program takes N integers as input from the user from the command line and stores them in an integer array called inputArray. Print out all elements of inputArray on a single line. d. Program asks user to input one of the following characters as input. Program keeps asking for input until 'X' or 'x' is input by the user: - 'L' or 'l': Left-shift the elements of inputArray. For example, if inputArray contains {1, 2, 3, 4}, after performing a left-shift its contents will be {2, 3, 4, 1}. Print out the new contents of the array on a single line. - 'R' or 'r': Right-shift the elements of inputArray. For example, if inputArray contains {1, 2, 3, 4}, after performing a right-shit its contents will be {4, 1, 2, 3}. Print out the new contents of the array on a single line. - 'X' or 'x': Print out the new contents of the array on a single line. Then, exit the program. - For any other input, do nothing and ask for another input character again. 9 Submission Instructions Upload an MS Word document file (.DOCX) that contains the following: 1. Source code (.CPP file) of your program. 2. Also include a screenshot of the console window output of your program

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions