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

Recommended Answers

All 6 Replies

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..

commented: That doesn't teach him/her anything +0
commented: 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. +0

To EngSara and gertails please read this http://www.daniweb.com/forums/announcement8-2.html . This forum is designed to help people find answers not to give them to them. This was assigned as homework for a reason. People must show effort otherwise the learning process does not happen as it should.

commented: Preach it :) +2
commented: Damn straight! +19

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 ^_^

thank you for helping me on my assignment ^_^

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.