60 371
Assignments Done
98,1%
Successfully Done
In April 2018

# Answer to Question #12098 in C# for Nicole

Question #12098
A program to input a date ( numeric day only entered separately) and output the corresponding astrological sign based on the table below:

DEC 22 - JAN 20 Capricorn
JAN 21 - FEB 19 Aquarius
FEB 20 - MAR 20 Pisces
MAR 21 - APR 20 Aries
APR 21 - MAY 21 Taurus
MAY 22 - JUN 21 Gemini
JUN 22 - JUL 23 Cancer
JUL 24 - AUG 23 Leo
AUG 24 - SEP 23 Virgo
SEP 24 - OCT 23 Libra
OCT 24 - NOV 23 Scorpio
NOV 24 - DEC 21 Sagittarius
{
class Program
{
static void Main(string[]
args)
{
Console.WriteLine(&quot;Input date DD
MMM:&quot;);
string inputDate = Console.ReadLine();
int
inputDay = Convert.ToInt32((inputDate.Split(&#039; &#039;))[0]);
string
inputMon = (inputDate.Split(&#039; &#039;))[1];

//Console.WriteLine(inputDate,&quot; &quot;,inputMon);
inputMon =
inputMon.ToUpper();
switch (inputMon)

{
case &quot;DEC&quot;:

{
if (inputDay &gt; 31) {
Console.WriteLine(&quot;Incorrect day&quot;); }

else
if (inputDay &lt; 22)
Console.WriteLine(&quot;Sagittarius&quot;);
else
Console.WriteLine(&quot;Capricorn&quot;);
break;

}
case &quot;JAN&quot;:

{
if (inputDay &gt; 31) {
Console.WriteLine(&quot;Incorrect day&quot;); }

else
if (inputDay &lt; 21)
Console.WriteLine(&quot;Capricorn&quot;);
else
Console.WriteLine(&quot;Aquarius&quot;);

break;
}
case
&quot;FEB&quot;:
{
if (inputDay &gt; 29)
{ Console.WriteLine(&quot;Incorrect day&quot;); }

else
if (inputDay &lt; 20)
Console.WriteLine(&quot;Aquaruis&quot;);
else
Console.WriteLine(&quot;Pisces&quot;);

break;
}
case
&quot;MAR&quot;:
{
if (inputDay &gt; 31)
{ Console.WriteLine(&quot;Incorrect day&quot;); }

else
if (inputDay &lt; 21)
Console.WriteLine(&quot;Pisces&quot;);
else
Console.WriteLine(&quot;Aries&quot;);

break;
}
case
&quot;APR&quot;:
{
if (inputDay &gt; 30)
{ Console.WriteLine(&quot;Incorrect day&quot;); }

else
if (inputDay &lt; 21)
Console.WriteLine(&quot;Aries&quot;);
else
Console.WriteLine(&quot;Taurus&quot;);

break;
}
case
&quot;MAY&quot;:
{
if (inputDay &gt; 31)
{ Console.WriteLine(&quot;Incorrect day&quot;); }

else
if (inputDay &lt; 22)
Console.WriteLine(&quot;Taurus&quot;);
else
Console.WriteLine(&quot;Gemini&quot;);

break;
}
case
&quot;JUN&quot;:
{
if (inputDay &gt; 30)
{ Console.WriteLine(&quot;Incorrect day&quot;); }

else
if (inputDay &lt; 22)
Console.WriteLine(&quot;Gemini&quot;);
else
Console.WriteLine(&quot;Cancer&quot;);

break;
}
case
&quot;JUL&quot;:
{
if (inputDay &gt; 31)
{ Console.WriteLine(&quot;Incorrect day&quot;); }

else
if (inputDay &lt; 24)
Console.WriteLine(&quot;Cancer&quot;);
else
Console.WriteLine(&quot;Leo&quot;);

break;
}
case
&quot;AUG&quot;:
{
if (inputDay &gt; 31)
{ Console.WriteLine(&quot;Incorrect day&quot;); }

else
if (inputDay &lt; 24)
Console.WriteLine(&quot;Leo&quot;);
else
Console.WriteLine(&quot;Virgo&quot;);

break;
}
case
&quot;SEP&quot;:
{
if (inputDay &gt; 30)
{ Console.WriteLine(&quot;Incorrect day&quot;); }

else
if (inputDay &lt; 24)
Console.WriteLine(&quot;Virgo&quot;);
else
Console.WriteLine(&quot;Libra&quot;);

break;
}
case
&quot;OCT&quot;:
{
if (inputDay &gt; 31)
{ Console.WriteLine(&quot;Incorrect day&quot;); }

else
if (inputDay &lt; 24)
Console.WriteLine(&quot;Libra&quot;);
else
Console.WriteLine(&quot;Scorpio&quot;);

break;
}
case
&quot;NOV&quot;:
{
if (inputDay &gt; 30)
{ Console.WriteLine(&quot;Incorrect day&quot;); }

else
if (inputDay &lt; 24)
Console.WriteLine(&quot;Scorpio&quot;);
else
Console.WriteLine(&quot;Sagittarius&quot;);

break;
}
default: {
Console.WriteLine(&quot;Incorrect month&quot;); break; }
}

}
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!