Question:
My java program runs but will not give an output! Urgent help needed!?
sheryl lyn b
2007-09-27 23:31:41 UTC
I am using JCreator as IDE for my Java programs in Programming Fundamentals. My problem is, the process is completed yet the desired output is not displayed. Our instructor doesn't help much on this matter. I dug the internet but examples given were all integers and strings and not cahracters.We are ask to make a program that determines the class of a ship depending on a code entered.
B or b = Battleship
C or C = Cruiser
D or d = destroyer
G or g = Gunboat
other = Invalid code
.. the output is by using JOptionPane.
Five answers:
Shariq (http://coinsindia.info)
2007-09-28 01:13:01 UTC
Modify your question with the code. But I suggest you two option.

1. If you are using console input/output you command line compilation/run with the help DOS Prompt.



2. If you are using Windows input/output you can use appletviewer supplied by the JDK.



I also guess that your code would be like this







if(choice==B||choice==b)

{

System.out.println("BattleShip");

}

if(choice==C || choice==c)

{

System.out.println("Cruiser");

}





and if you are using something like above

than use



javac to compile

java to run



Reply me if problem is solved or not
?
2016-10-20 09:05:02 UTC
hi Steve, there are 2 others, same project. one in each and every of them feels like it got here from Asia. What Y!solutions desires is a stronger way of categorizing those homework assignments. the single that is futher alongside in this incredibly exhibits what grow to be copied and what they're attempting to alter utilising the trial and mistake approach.
2007-09-27 23:35:17 UTC
It's really hard to fix a programming problem without seeing the code. Can you post it?
2014-11-04 19:23:52 UTC
sophisticated step. browse on to google. that may help!
trebz
2007-09-28 00:02:36 UTC
use java update


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...