Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning Java 2
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Java 2
This is the forum to discuss the Wrox book Beginning Java 2, SDK 1.4 Edition by Ivor Horton; ISBN: 9780764543654
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java 2 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 24th, 2010, 04:45 PM
Registered User
 
Join Date: Jul 2010
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default i made a program please help to to find out bugs on it ...

i made a program please help to to find out bugs on it ...


public class lab1_horo {

/** Creates a new instance of lab1_horo */
public lab1_horo() {
}
public static void main(String[] args) {
double day;
String month, name, sign = null;

DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
Date date = new Date();

System.out.println(dateFormat.format(date));

Scanner input = new Scanner(System.in);

System.out.println("Hello, what is your name?");
name = input.nextLine();

System.out.println("In what month were you born?");
month = input.nextLine();

System.out.println("On what day of " month " were you born?");
day = input.nextDouble();

if (month.equals("March") && day >= 21 || month.equals("April")
&& day <= 20);{
sign = "Aries";
System.out.println(name ", you are an " sign ". You will have an awesome day");}

else if (month.equals("April") && day >= 21 || month.equals("May")
&& day <= 21) {
sign = "Taurus";
System.out.println(name ", you are an " sign);}

else if (month.equals("May") && day >= 22 || month.equals("June")
&& day <= 21) {
sign = "Gemini";
System.out.println(name ", you are an " sign);}


else if (month.equals("June") && day >= 22 || month.equals("July")
&& day <= 22); {
sign = "Cancer";
System.out.println(name ", you are an " sign);}

else if (month.equals("July") && day >= 23 || month.equals("August")&& day <= 23);
{ sign = "Leo";
System.out.println(name ", you are an " sign);}

else if (month.equals("August") && day >= 24 || month.equals("September")
&& day <= 23)
;
{
sign = "Virgo";
System.out.println(name ", you are an " sign);
}
else if (month.equals("September") && day >= 24 || month.equals("October")
&& day <= 23)
;
{
sign = "Libra";
System.out.println(name ", you are an " sign);
}
else if (month.equals("October") && day >= 24 || month.equals("November")
&& day <= 22)
;
{
sign = "Scorpio";
System.out.println(name ", you are an " sign);
}
else if (month.equals("November") && day >= 23 || month.equals("December")
&& day <= 21)
;
{
sign = "Sagittarius";
System.out.println(name ", you are an " sign);
}
else if (month.equals("December") && day >= 22 || month.equals("January")
&& day <= 20)
;
{
sign = "Capricorn";
System.out.println(name ", you are an " sign);
}
else if (month.equals("January") && day >= 21 || month.equals("February")
&& day <= 18) ;
{sign = "Aquarius";
System.out.println(name ", you are an " sign); }

else (month.equals("February") && day >= 19 || month.equals("March") && day <= 20);
{sign = "Pisces";
System.out.println(name ", you are an " + sign); }
}
}
}
  #2 (permalink)  
Old July 25th, 2010, 06:22 AM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Wouldn't it help if you described which bugs you're experiencing?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #3 (permalink)  
Old July 25th, 2010, 07:15 AM
Registered User
 
Join Date: Jul 2010
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks for help ...
  #4 (permalink)  
Old July 25th, 2010, 08:19 AM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Did you solve the problem now?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #5 (permalink)  
Old July 25th, 2010, 11:14 AM
Registered User
 
Join Date: Jul 2010
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Few hours before this post ... my friend help me for this code ...

Quote:
Originally Posted by Imar View Post
Did you solve the problem now?

Imar
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
could not find WindowsApplication1.program ?? Hannibal C# 2005 1 December 4th, 2006 04:40 AM
ODBC Bugs? sandeepk Oracle ASP 0 February 20th, 2006 09:13 AM
Search has some bugs?!!! mehdi62b Forum and Wrox.com Feedback 10 September 8th, 2004 09:18 AM
UNION BUGS?? virtualdave Pro VB Databases 2 March 8th, 2004 05:11 PM
I can't find bugs in my Login function. (User.cs) kaz VS.NET 2002/2003 5 December 7th, 2003 05:46 AM



All times are GMT -4. The time now is 07:14 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.