online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
// Escriba la clase C2 para leer mis dos ingresos (en soles) del mes pasado y luego haga un // resumen, ejemplo de salida: // // Mis dos ingresos del mes pasado: 500 1000 // Resumen // Ingresos Porcentaje // 1 S/500.00 33 % // 2 S/1,000.00 67 % // Total S/1,500.00 100 % // // Obligatorio: Use la clase NumberFormat para formatear números. import java.util.Scanner; import java.text.NumberFormat; //class C2{ class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); NumberFormat soles = NumberFormat.getCurrencyInstance(); NumberFormat porcentaje = NumberFormat.getPercentInstance(); System.out.print("Mis dos ingresos del mes pasado: "); float in1 = sc.nextFloat(); float in2 = sc.nextFloat(); float total = in1 + in2; System.out.println("Resumen"); System.out.println("\t Ingresos Porcentaje"); System.out.printf("1 %12s%12s\n", soles.format(in1), porcentaje.format(in1/total)); System.out.printf("2 %12s%12s\n", soles.format(in2), porcentaje.format(in2/total)); System.out.printf("Total%12s%12s\n", soles.format(total), porcentaje.format((in1+in2)/total)); } }

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