ı need help in my homework zodiac sign program
it is my first year on university but ı took a third grade java class and ı am not even computer science student so ı learned some things for first project which is ı need ı already did a functional menu that can go main and sub menus without crashing and for the 2-3 days ı am working on a program that will take input from user and says what is the users age and after that our program will show our users zodiac sign ı thinked about some parts but ı completely lost that ı can not figure out how to procces users age with using java time method that it ı do know we will use user input for zodiac sign but ı do not know how to procces user age and giving exceptions to string inputs for example user inputs aa for date my program will not crash
any help appreciated ı am sorry for my bad english
any help appreciated ı am sorry for my bad english
41 Replies
⌛ This post has been reserved for your question.
Hey @this is mistifi! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
so you want
the user to input age
and depending on it
the app is supposed to do something
yes
yes
show your current code
the part where you grab users age
GitHub
Proije_1/src/Zodiac_Sign.java at master · mstf16/Proije_1
Contribute to mstf16/Proije_1 development by creating an account on GitHub.
by the way thanks for helping
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
so im assuming
below these checks you want to print the zodiac sign
ok so
hold on let me write it
okay no problem ı have 2 more days to finish it
after that ı will do reverse string program fortunately ı found a tutorial
you can do something like this
and then
oh yea replace the letters with ur zodiac sign thing
and then if you wanna print it
just do
i saw month is your variable so i put it there
do ı need any other methods for program
no
try this
Zodiac sign does not change on month though. It's somewhere around the 21st but different for each sign.
oh yea lmao
i forgot
have to tweak it a bit then
so ı oly need to use date variable
also how ı am going to do the math between the time methot and our ınputted year
it says you can not do that they are diffrenent types
which thing
we will use day and month
ill show how in a second
currentYear-year=user age
it is not implemented yet but ı need it
oh user age
its just
let me write it
thanks ı appcreaite your effort
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
this is user age
i named it day
but in your code its date
is it
built in method
our teacher stated that you can not use built in methots
interesting
did he say if you can use localdate.now
its also a built in method
only for getting current time he said
ok
ı dont know wht it is so hard
ok question
do you want
longer answer
or simpler answer
for zodiac sign
ı think the longer answer
ı need to push my limits
did you have enums
in school
yeah in todays class
we looked into enums
they are reference types like arrays
but improved arrays
so will you be able to explain whats happening when the teacher asks you to explain
im asking cuz im thinking whether to show the answer with enums or no
or just ifs
ill do enums and if its too complex ill show the simple version
enums are just like arrays as ı understand
if there is parts that ı do not know
i will learn
ı am putting 4-5 hours to coding as it is my first year
ok
replace your
publci static void main
with what i put
and check it out
basically
i used enums
to create date ranges
and since you cant use built in stuff
i put it as int
otherwise the best idea would be using monthday
and then
it just compares the range
sees if a value is in range
and returns the name
of that enum
thanks for your help as in my country time is 23.10
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
ı will look at toworrow
when you typed it was 23:14
ez
damm
ı gotta sleep well
or ı am going to find time travel
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.