online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl, C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); Nuts[] nut = new Nuts[4]; for(int i=0; i<nut.length; i++){ int nutId =scan.nextInt(); scan.nextLine(); String nutName = scan.nextLine(); String nutType= scan.nextLine(); double nutamount = scan.nextDouble(); nut[i] = new Nuts(nutId,nutName,nutType,nutamount); } int usrnutId = scan.nextInt(); boolean usrRate = scan.nextBoolean(); double result = secondMethod(nut,usrnutId,usrRate); if(result!=0){ System.out.println(result); } } public static double secondMethod(Nuts[] nut,int usrnutId, boolean usrRate){ double amount =0; for(int i=0; i<nut.length; i++) { if(usrRate==true && nut[i].getnutId()==usrnutId) { amount = nut[i].getnutamount()*1.25; } return amount; } return 0; } } class Nuts { int nutId; String nutName; String nutType; double nutamount; boolean usrRate; Nuts(int nutId,String nutName, String nutType,double nutamount){ this.nutId = nutId; this.nutName = nutName; this.nutType = nutType; this.nutamount = nutamount; } public void setnutId(int nutId){ this.nutId = nutId; } public int getnutId(){ return nutId; } public void setnutName(String nutName){ this.nutName = nutName; } public String getnutName(){ return nutName; } public void setnutType(String nutType){ this.nutType = nutType; } public String getnutType(){ return nutType; } public void setnutamount(double nutamount){ this.nutamount = nutamount; } public double getnutamount(){ return nutamount; } public void setusrRate(boolean usrRate){ this.usrRate = usrRate; } public boolean getusrRate(){ return usrRate; } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue