hi;
please help me on my assignment about c++;

my problem is write a program that will enter month and day and display its corresponding sodiac sign

pls. help tnx

Welcome. What have you written so far? If you haven't started writing what do you have for information on the dates of the divisions?

#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include<cmath>
using namespace std;


int main()
{int d;
  char mon[10];
	cout<<"Enter the date"<<endl;
	cin>>d;
	cout<<"Enter the month:"<<endl;
	cin>>mon;

	if(( (0 == strcmp ("dec",mon)) && ( d>=22 && d<=31)) || ( (0 == strcmp ("jan",mon)) && ( d>=1 && d<=20)))
	cout<<"Capricorn"<<endl;
	
	
	if(( (0 == strcmp ("jan",mon)) && ( d>=21 && d<=31)) || ( (0 == strcmp ("feb",mon)) && ( d>=1 && d<=20)))
	cout<<"Aquarius"<<endl;	

	
	if(( (0 == strcmp ("feb",mon)) && ( d>=21 && d<=28)) || ( (0 == strcmp ("mar",mon)) && ( d>=1 && d<=20)))
	cout<<"Pisces"<<endl;
	
	
	if(( (0 == strcmp ("mar",mon)) && ( d>=21 && d<=31)) || ( (0 == strcmp ("apr",mon)) && ( d>=1 && d<=20)))
	cout<<"Aries"<<endl;
	
	// Complete 




	return 0;

}

This is part of ur assignment .. complete it in the same way for the other months..

Edited 6 Years Ago by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

Comments
Giving code is not a good idea, giving pointers on what you need (like pointing out that you need a method to get input, a way to compare, etc) would be a much better method.
That doesn't teach him/her anything

hi;
please help me on my assignment about c++;

my problem is write a program that will enter month and day and display its corresponding sodiac sign

pls. help tnx

Why not use Google and reason through your problem? You have some obvious points you need to cover. You require a method to obtain input from the user, you need to compare that input with a database of zodiac signs that correspond with certain inputs and you need a way to output the final answer on the screen. Use Google to find out ways to do these things (and make sure you do some searching around for the best practice, certain syntax is bad form / dangerous to use in most cases).

It is a simple program, do not let it overwhelm you, take it in pieces, part by part and it will be a cakewalk. I can't give you any more or I would be doing the assignment for you, it really is about as easy as it gets besides the infamous "Hello World!" program.

thank you for helping me on my assignment ^_^

Edited 3 Years Ago by Nick Evan: Fixed formatting

thank you for helping me on my assignment ^_^

Congratulations! You've cheated your way through another assignment! Keep up the good work! :icon_rolleyes:

This article has been dead for over six months. Start a new discussion instead.