Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

WRITE A C++ PROGRAM a. Prime number. (Midterm program problem #2) Write a C++ pr

ID: 3531014 • Letter: W

Question

WRITE A C++ PROGRAM


a. Prime number. (Midterm program problem #2) Write a C++ program to determine whether a user's input number N is a prime number or not.


b. Calendar Write a C++ program that takes two user inputs (int) m and y and prints out the monthly calendar for the mth month of year y. For example, if your inputs are 2 and 2009, respectively, the output should be: February 2009 S MTu WTh F S 1234567 8 9 1011121314 15 16 17 18 19 20 21 22 23 24 25 26 27 28 You should look up the formula to find day of year and whether a year is leap year. Make sure whatever formula you use, you are not just copy-and-pasting from something you have no idea about.


c. Selection sort. Write a C++ program that takes in a list of 9 integers from user's input and stores them in an array. Sort the array, and print them in descending order. Sample input: Sample output: 31 63 3 31 7 16 99 16 7 67 63 6 73

Explanation / Answer

a)