Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use C++ Assignment J 30 points Create a CPP program named lastname-Asgn] to accomplish the following tasks: (I point) Put your name and course

Please use C++
image text in transcribed
Assignment J 30 points Create a CPP program named "lastname-Asgn]" to accomplish the following tasks: (I point) Put your name and course and section on the first line as documentation and display your name and Assignment J to the screen. . (I point) Be sure to indent statements for readability based on examples in the book. . (1 point ) The program will have only one variable the day number and it will be entered only one time you must produce a message for what day of the week it is from the day number provided by the user based on the matching message from the list below. The program will display ONLY two messages, one using code that has switch /case statements and one from code using IF logic YOU must generate only ONE cout for each message (one from the IF one from the SWITCH) (This means you must figure out how to do OR's and/or AND's logic in both if and switch syntax and (4 points) use a variable to hold the message to print it later) For this assignment we will assume day 1 is Monday, 2 is Tuesday. etc the following messages should be displayed Friday, Sunday and Saturday Monday and Wednesday Tuesday and Thursday display "weekend have fun" display "Study for C++ Class display "Attend C++ class adjust the Attend/study message to match your class days.. meaning EACH cout may appear only two times in the program, once for IF tests once for Switch tests (3 points) any other value outside the range of 1 to 7 should display "bad day number" A. (8 points) construct the series of switch/case statements to produce the messages. B. (8 points) Construct a series of ifelse/if statements that will produce the same results. Sample output might look like one of these two execution examples-be sure to try several wrong values such as -5 and each of the values to make sure they all work: Assignment J -yourname here please enter a day number between 1 and 7? 3 message from If statements: Attending C++ Class message from Switch statements: Attending C++Class Assignment J - yourname here please enter a day number between 1 and 7215 message from If statements: invalid day number message from Switch statements: invalid day number

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

Students also viewed these Databases questions

Question

define what is meant by the term human resource management

Answered: 1 week ago