Question: C++ Only Topics if/else if Description Write a program that determines the users astrological sign. The program asks the user to enter his/her birth month

C++ Only

Topics

if/else if

Description

Write a program that determines the users astrological sign. The program asks the user to enter his/her birth month as a whole number. Then it asks the user to enter his/her birth day as a whole number. It uses the birth month and birth day to determine the users astrological sign. At the end, it displays the users birth month, birth day and the astrological sign.

Requirements

Use if/else if statement (not multiple if statements).

Notes

Use the hyperlink below to access information about astrological signs.

http://www.infoplease.com/ipa/A0202818.html

Test Data

Test this assignment by performing the test runs below using the test data shown.

Input Test Run 1

Enter your birth month as a whole number <1-12>:

3

Enter your birth day as a whole number:

27

Output Test Run 1

Your Birth Month: 3

Your Birth Day: 27

Your Astrological Sign: Aries

Input Test Run 2

Use either your own or someone elses birth date.

Submit

Output of all the test runs

All the C/C++ source code.

Sample Code

/*

The code below is written for the Aries and Taurus signs. Add additional else if clauses for the remaining signs. Below month and day are int variables. The variable month contains the month value and the variable day contains the day value.

*/

#include

if ( ( (month == 3) && ( day>=21 ) ) ||

( ( month == 4 ) && ( day <=19 ) ) )

{

sign = Aries;

}

else if ( ( (month == 4) && ( day> 19 ) ) ||

( ( month == 4 ) && ( day <=20 ) ) )

{

sign = Taurus;

}

.

.

.

else

{

{

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!