online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
//Swift language import Foundation let CONST_SEG_SOCIAL = 0.0665 // Declaración de función func deduccion(sueldoBruto: Double) -> Double { return sueldoBruto * CONST_SEG_SOCIAL } // Variables var sueldoHora: Double = 0.0 var sueldoBruto: Double = 0.0 var descSegSoc: Double = 0.0 var sueldoNeto: Double = 0.0 var horasTrab: Int = 0 var overtime: Double = 0.0 var repetir: Int = 1 let limiteHoras: Int = 50 while repetir == 1 { repeat { print("Ingrese las horas trabajadas: ", terminator: "") if let input = readLine(), let horas = Int(input) { horasTrab = abs(horas) if horasTrab < 1 { print("Por favor, ingrese horas mayor a 0.") } else if horasTrab >= limiteHoras { print("Favor de ingresar horas mayores a 0 y menores a \(limiteHoras)") } } } while horasTrab < 1 || horasTrab >= limiteHoras // Validación de horas trabajadas repeat { print("Ingrese el sueldo por hora: ", terminator: "") if let input = readLine(), let sueldo = Double(input) { sueldoHora = abs(sueldo) if sueldoHora < 1 { print("Por favor, ingrese un sueldo por hora mayor a 0.") } } } while sueldoHora < 1 // Validación de sueldo por hora // Calcula las horas extras if horasTrab > 40 { overtime = Double(horasTrab - 40) * 2 * sueldoHora } else { overtime = 0 } // Calcula sueldo bruto sueldoBruto = (Double(horasTrab) * sueldoHora) + overtime // Llama a la función dd deducción descSegSoc = deduccion(sueldoBruto: sueldoBruto) // Calcula el sueldo neto sueldoNeto = sueldoBruto - descSegSoc print("Las horas trabajadas son: \(horasTrab) horas con un overtime de \(Int(overtime)) horas, un descuento de seguro social de \(descSegSoc), y un sueldo bruto de \(sueldoBruto) y de un sueldo neto de \(sueldoNeto).") repeat { print("¿Desea ingresar otra persona? 1 = sí, 2 = no: ", terminator: "") if let input = readLine(), let respuesta = Int(input) { repetir = respuesta if repetir != 1 && repetir != 2 { print("Por favor, ingresar 1 o 2.") } } } while repetir != 1 && repetir != 2 // Validación de repetir } print("Gracias por usar el programa!")

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