[QUOTE=iamthwee;1008500]If there was ever a time to use a goto statement. That code just there. In post # 1.

Yep, that would definitely be an essential use of the goto statement.

[QUOTE=neithan;1008502]It would make your code much more readable and clean to convert those multiply and divide lines into two shiny functions.[/QUOTE]

I plan on using methods but for simplicity of my first ever program written in any language other than java I consider a "quick fix" rather than full declarations to be more efficient as they relate back to Batches which I was probably writting before you were in your daddy's balls!
you'll find I'm experienced in solaris, unix, linux, windows all the way back to 3.0, and I have even done assembly for the Amiga right up to 64 bit AMD architectures...sorry but flaming from a script kiddie like yourself is quite pittiful, show me something you have done...seeing as I helped secure government machines in networking to protect them from false injection at the age of 12.
but o na positive note...which is everything "iamthwee"(how immature) isnt, neithan brought up the point I plan to do next, thanks


include <iostream>

using namespace std;

int main ()
bool a = true;
cout << ("Multiply = 1 or Divide = 2 ?\n");
cin >> a;
if( a = "true")
goto Multiply;
} else {
goto Divide;

double x;
double y;
cout << ("Please Enter The First Number ");
cin >> x;
cout << ("Please Enter The Second Number");
cin >> y;
cout << (x*y);
return 0;

double x;
double y;
cout << ("Please Enter The Larger Number");
cin >> x;
cout << ("Please Enter The Smaller Number");
cout << (x/y);
return 0;

errors everywhere, using code::blocks on Ubuntu using g++ compiler...I think I just need to sort out the goto, all help greatly appreciated

import javax.swing.*;
import java.text.DecimalFormat;
public class BMI {

public static void main(String args[ ]) {
double Weight = .453592;
double Height = 2.54;

 weight = Double.parseDouble(JOptionPane.showInputDialog(null,"enter your weight in kilograms"));
 height = Double.parseDouble(JOptionPane.showInputDialog(null,"enter your height in kilograms"));
 double BMI = weight/(height*height);
 DecimalFormat fmt = new DecimalFormat("#.##");
 System.out.println("Your Body Mass Index is: " + fmt.format(BMI));


what you need is this...
do second one first...
set 2 attributes: double x
double y

methods you should programme are: constructors

first one...
create a class with 3 attributes which are all doubles...
create the same as above except in the toString, instead of a list of calculations (pm me if you are unsure about this) seperated with the "\n" aswell as the + signs...just create the sum for average using the 3 inputs.
need any further help then pm me please, as I am beginning to wonder if this forum is a joke due to flamers as theres only one person offered to help me since I joined when I have answered quite some threads for my first day

constructors: When you use classes in future applications in Arrays/ArrayLists(for now, consider "String" is a class)
the Class, to be used must first be created, as a class is only a blueprint...when you create it, then it can be used (can you live in a blueprint peice of paper).
it helps fill the needed attributes on creation of the class which is very efficient, you are best asking your lecturer about "Classes as Objects" and "are classes only blueprints for the object?" (that should get any further needed information or just pm me if you wish)

toString: when you need to output the data from the class, the toString method is called on which gives you the chance to structure or manipulate the output given. (pm me if you need any more help)

any mistakes, post here AND pm me any corrections.

I suppose Computer Science is a basis of both put together
I am in second year and learning C,assembly,Java and SQL...but also learning about processor architectures via assembly.
software engineering is programming viewing things from the software level, where as Computer engineers learn from the hardware's point of view.
look deep enough into either and you should cover both, thus Computer Science which is the current generalisation of both I think,
pm me corrections if I am wrong please

create new project in it, and right click the package name on the left hand side and make new "Jpanel" or "Jframe" and this will give you a GUI based GUI builder...any success compiling with it, then look at my thread on making my own taskbar
any corrections via pm greatly appreciated

VB6 is the last I used Visual Basic but feel it would be very usefull, Java is mostly a databasing and command-line language from what I have seen so far but am not experienced enough to give a definite answer.
but I feel if you are using Microprocessors and controllers you are best using C as this can be ported between the various architectures.
if this is just a visualisation for studnets, look at Java, VB or possibly Python.
any corrections to any post I have, please pm me as I am here mostly to learn but like helping wherever I can

the runtime environment is the key here, you need to make a runtime environment for each processor architecture which is compatible with all OS's which that Architecture can run.
and aslong as all your runtime environments accept the same software input for operation then I see no problems in this, but good luck, and keep me informed if you go ahead with this as I would be interested in seeing your progress as this could become a very impressive feat.

any corrections to my posts neccessary...please pm me

Class: Multiply
Attributes: int x
int y
Methods: getters&setters

in Main
create array or arraylist of the class Multiply
take in the 2 numbers into each
to print:
iterate through the array and print the "Multiply.toString()" and the "toString()" will include the "x*y = z" to form each line

I would recomend using the IDE's BlueJ or Netbeans (Netbeans does most of it for you hence is my favourite)

any errors in my repllies then pm me please as I am also a learner

I use the IDE Netbeans and as a personal project I want to create an application in java similar to "Mac OSX" dock bar.
I dont know how to run the coding using the GUI...all I have done so far are database structures and commandline programming.
I will need to run .jar's and .exe's in windows environment. some pointers once I have designed the GUI as a "Jframe" (or would a Jpanel be better?) , how do I enter the code so I can compile it...I plan on running it at start-up and making it a link to all programmign resources including opening my new home page([url]www.daniweb.com[/url]).
All help and advice greatly appreciated, please be patient of my replies as I am also busy as this is the start of my second year at University.

Some things you may wish to consider,
"Disk", can I see source of it?
"Disk"s constructor...is it expecting an integer then a double?
if (plate1.equals(plate2))...did you programme "equals" In Disk?
instead of printing plate1 try printing the plate1.toString which you should have programmed to simplify things

any corrections of my post pm me please

for(int i = 0; i < 3; i++){
//what you need to be repeated

1) initialises the "for loop"
int i = 0; initialises the i which is the number used ot monitor the repititions past.

2) the code you need performed...remmeber the ";" at the end as this is an easily made error

3) closes the for loop.

//your code

1) initiates the while loop, very similar to for's except I didnt initiate i in this one, its assumed you have done sooner in the class.

2) your own code again

3) end loop

I hope this helped, pm me the link to this thread when you reply if you need any other help, and also all readers, if you see errors i nmy coding please pm me what I have done wrong as I am also a learner so everyone should take my advice with a pinch of salt.

I have been searching for a community for years, I settled at hackforums among the flamers and snobs...I found this site, now that I have seen the posts I know this is where I should be.
I am studying Computer Science, I am in my second year, starting SQL now havign done HTML and CSS and currently working on Java.
I guess thats all I have to say other than hi and I look forwards t otrying to help anyone who needs assistance and also receiving help from those more experienced.