Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Zodiac Sign Program
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
KiranjotAssi




PostPosted: Sat Apr 04, 2015 3:39 pm   Post subject: Zodiac Sign Program

What is it you are trying to achieve?
I'm trying to write a program that will tell you what year you will be twice your age and what your zodiac sign is.


What is the problem you are having?
I can't figure out what type of statement to use to distinguish between the zodiac signs, as they begin and end in between months(Gemini is two weeks in May and two weeks in June).


Describe what you have tried to solve this problem
I've tried using different types of statements but they all give me errors


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)


Turing:


<Add your code here>



Please specify what version of Turing you are using
<Answer Here>



AGE.T
 Description:

Download
 Filename:  AGE.T
 Filesize:  3.04 KB
 Downloaded:  162 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Sat Apr 04, 2015 4:06 pm   Post subject: RE:Zodiac Sign Program

code:
aries =03 or 04 and birthdate:=22 to 20
then
Font.Draw("Your Zodiac sign is Aries", 275,375,font1, 16)
end when


This is not a statement. This is gibberish. 'end when' is not a thing. The first line of that snippet makes no sense at all.

You know exactly what date each zodiac sign starts and ends. You simply need to check- 'is your birthday between Areis start date and areis end date? Yes? You're an Areis. No? Then check if your birthday is between Taurus start date and Taurus end date. Yes? You're a Taurus. No? Continue for other signs.

Quote:
I've tried using different types of statements but they all give me errors


I suggest you read the error messages and try to figure out what they mean. They don't just tell you 'Something is wrong!' (usually). They tell you what went wrong and where. Further, 'trying different types of statements' tells me you haven't thought about the problem at all. This approach will never, ever work except by accident. Every statement has a purpose. Do you need to do something lots of times? Use a loop. Do you need to compare two things? Use an if.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: