Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning Java 2
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
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); }
}
}
}
 
Old July 25th, 2010, 06:22 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!
 
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 ...
 
Old July 25th, 2010, 08:19 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!
 
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




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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.