-2

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

6
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by Nick Evan
Featured Replies
  • To EngSara and gertails please read this [url]http://www.daniweb.com/forums/announcement8-2.html[/url] . 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. Read More

0

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?

-4
#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 by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

Votes + 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
0

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.

0

thank you for helping me on my assignment ^_^

Edited by Nick Evan: Fixed formatting

0

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 topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.