whats wrong with these 2 ?

This is a discussion on "whats wrong with these 2 ?" within the JavaScript Forum section. This forum, and the thread "whats wrong with these 2 ? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old May 11th, 2007, 19:29
New Member
Join Date: May 2007
Location: uk
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
whats wrong with these 2 ?

i have 2 little programs that im stuck on.

the first, i need to out put all three numbers from highest to lowest but i can only get it to out put the one largest number and not the other two as well.

the other programs im stuck on is trying to get "quit" to exit when equal to "y" and loop back if not "y" "Y" "n" "N". it dosen't even have to loop really.

any help would be greatly appreciated


import cs1.Keyboard;
public class order
{
public static void main (String[] args)
{
int number, number2, number3;

System.out.println("Enter number 1");
number = cs1.Keyboard.readInt();

System.out.println("Enter number 2");
number2 = cs1.Keyboard.readInt();

System.out.println("Enter number 3");
number3 = cs1.Keyboard.readInt();

if (number > number2 && number > number3)
{

System.out.println (number);
}

if (number2 > number3 && number2 > number )

{

System.out.println (number2);
}

else


System.out.println (number3);
}
}






import cs1.Keyboard;
public class converter
{

public static void main (String[] args)
{
int option;
double Pound, Currency;
String quit;



do
{
System.out.println("Please enter GBP amount:");
Pound = cs1.Keyboard.readInt();
System.out.println("Please pick one of the four options:");


System.out.println("1 = Euro");
System.out.println("2 = USD ");
System.out.println("3 = AUD ");
System.out.println("0 = Quit");

option = Keyboard.readInt();



if (option == 1)
{

Currency = Pound * 1.48;
System.out.println("Answer =" +Currency);


System.out.println("Do you wish to quit the programme? ");
System.out.println("Y or N ");
quit = cs1.Keyboard.readString();


if (quit ! ||y||Y||n||N)

if (quit == y);
(
System.out.println("You have quit the programme")
)


}


else if (option == 2)

{

Currency = Pound * 1.97;
System.out.println("Answer =" +Currency);
}
else if (option == 3)

{

Currency = Pound * 2.43;
System.out.println("Answer =" +Currency);
}
}
while (!(option == 0));
System.out.println("You have quit the programme");


}
}
Reply With Quote

Reply

Tags
stuck

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Whats wrong? Bradfordp26 Web Page Design 11 Apr 5th, 2008 10:14
Whats wrong with this? MaccGaz Other Programming Languages 1 Nov 4th, 2006 21:12
Whats wrong with this? (Ajax) php_coder JavaScript Forum 1 May 24th, 2006 20:48
Whats wrong with tables and why css mrnthere Web Page Design 7 Mar 16th, 2006 23:38
Whats wrong with this? TheShadow Classic ASP 5 May 26th, 2005 12:55


All times are GMT. The time now is 10:40.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43