Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

M3 HW Assignment COP2274 Spring 2022 M3HW Assignment Due: January 27 at 11:59 pm Calendar Printer Write a C++ program using if-else statements, switch statements, and/or loops (for, while, do- while)...

1 answer below »

M3 HW Assignment
COP2274 Spring 2022 M3HW Assignment Due: January 27 at 11:59 pm
Calendar Printer

Write a C++ program using if-else statements, switch statements, and/or loops (for, while, do-
while) that prints a month’s calendar after prompting the user inputs. Your program must
validate all the user inputs (or keep prompting the user inputs until the user enters valid inputs),
display a formatted calendar, ask the user if they want to print another calendar (y/n), repeat
the program until the user enters 'n', and then exit with the final message.

Note:
• You can use setw() function in the li
ary

Program Inputs
• Enter a month (1 to 12):
- If user enters an invalid option, keep displaying this prompt until a valid input is entered
• Enter days in the month (28, 29, 30, or 31):
- If user enters an invalid option, keep displaying this prompt until a valid input is entered
• Enter start day (0 to 6):
- If user enters an invalid option, keep displaying this prompt until a valid input is entered

Program Outputs
• A formatted calendar is displayed according to the valid user inputs (see the sample output
elow).
• Would you like to print another month (y/n)?
- A Question for repeating (y/n)
- User will always enter ‘y’ or ‘n’.
- If user enters ‘y’, display the initial prompt “Enter a month (1 to 12): ” again.
- If user enters ‘n’, display the final message “Thank you for using this program. Goodbye!”
and terminate the program
















COP2274 Spring 2022 M3HW Assignment Due: January 27 at 11:59 pm
Sample Output
The following test cases do not cover all possible scenarios but should indicate if your code is on
the right track. To guarantee full credit, your program's output should exactly match the output
elow.

Test Cases:
COP2274 Spring 2022 M3HW Assignment Due: January 27 at 11:59 pm
Binary-Decimal Converter

Write a C++ program that converts a decimal number to binary, or a binary number to decimal
ased on the user selection. Your program should prompt the user for two options. The first
option will prompt the user for an integer as a decimal number, convert to binary, and print the
esult. The second option will prompt the user for an integer as a binary number, convert to
decimal, and print the result (see the sample output below).

Program Inputs
• Choose an option (Enter 1 or 2):
- User will always enter a valid option.
• Enter a decimal number:
- This prompt is displayed if the user chooses Option 1.
- User will always enter a valid input as a decimal number.
• Enter a binary number:
- This prompt is displayed if the user chooses Option 2.
- User will always enter a valid input as a binary number.

Program Outputs
• XX converted to binary is: YYYY.
- This output is displayed if the user chooses Option 1.
- Replace XX with user input.
- Replace YYYY with the co
esponding binary number.
• XXXX converted to decimal is: YY.
- This output is displayed if the user chooses Option 2.
- Replace XXXX with user input.
- Replace YY with the co
esponding decimal number.
• Would you like to use the converter again (y/n)?
- A Question for repeating (y/n)
- User will always enter ‘y’ or ‘n’.
- If user enters ‘y’, display the initial menu with the prompt “Choose an option (Enter 1 or 2): ”
again.
- If user enters ‘n’, display the final message “Thank you for using this program. Goodbye!”
and terminate the program

Sample Output
The following test cases do not cover all possible scenarios but should indicate if your code is on
the right track. To guarantee full credit, your program's output should exactly match the output
elow.

Test Cases:
Welcome to the Binary-Decimal Converter!
(1) Convert Decimal to Binary
(2) Convert Binary to Decimal
COP2274 Spring 2022 M3HW Assignment Due: January 27 at 11:59 pm
Choose an option (Enter 1 or 2): 1
Enter a decimal number: 35
35 converted to binary: 100011
Would you like to use the converter again (y/n)? y

(1) Convert Decimal to Binary
(2) Convert Binary to Decimal
Choose an option (Enter 1 or 2): 2
Enter a binary number: XXXXXXXXXX
XXXXXXXXXXconverted to decimal: 91
Would you like to use the converter again (y/n)? n

Thank you for using this program. Goodbye!



Your grade will be subject to the following condition(s):
• Submission:
Late submission will NOT be accepted, so be sure to start early and submit early.

Submit your code on Canvas. You just need to upload two .cpp files. Please name your
.cpp files using your 3 initials followed by M3HW_1 or M3HW_2 (for example,
ksc_M3HW_1.cpp and ksc_M3HW_2.cpp)

In addition, you will need to write in the comment field your pseudocode (main flow of
your code in plain English). Also, PLEASE doublecheck your submission to make sure the
file has actually been uploaded.

Your grade will be calculated based on the following (total 100 points):
• Pseudocode: 10 pt
• Compilation: 30 pts
Your source code MUST be complied successfully without e
or. There is no partial credit
available here, either your code compiles or it doesn’t.
• Execution: 40 pts
Your program will be tested against 8 cases, each worth 5 points. You can earn partial
credit here if your code doesn’t work for every single case. If it does work for every case,
you will get the full 40 points.
• Style: 20 pts
Your code will also be graded on its style. This includes things like using meaningful
variable names (7.5 pts), useful comments (7.5 pts), and proper indentation and spacing (5
pts). All of these things make your code easy to read and maintain. Partial credit will be
available here. As a minimum, your code should have a comment at the beginning with
your name, date, and a high level but still descriptive overview of what the program does.
Answered Same Day Jan 27, 2022

Solution

Neha answered on Jan 27 2022
110 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here