1
Hey, good night, man. I’m in the first period of computer science, my university has its own website that evaluates its code and gives you a grade from 0 to 100, but it turns out that in this code below I get 93.3, and the site says that the program does not solve everything that is needed. I’m just using everything you’ve been teaching,I want to know where it’s wrong, or what’s missing. Thank you very much!
This is my code;
#include <iostream>
using namespace std;
int main (){
int codigo;
float salarioatual,aumento,novosalario;
cin>>codigo>>salarioatual;
switch (codigo){
case (1):
aumento=salarioatual*0.5;
novosalario=salarioatual+aumento;
cout<<"Escrituario"<<endl<<aumento<<endl<<novosalario;
break;
case (2):
aumento=salarioatual*0.35;
novosalario=salarioatual+aumento;
cout<<"Secretario"<<endl<<aumento<<endl<<novosalario;
break;
case(3):
aumento=salarioatual*0.20;
novosalario=salarioatual+aumento;
cout<<"Caixa"<<endl<<aumento<<endl<<novosalario;
break;
case(4):
aumento=salarioatual*0.10;
novosalario=salarioatual+aumento;
cout<<"Gerente"<<endl<<aumento<<endl<<novosalario;
break;
case(5):
aumento=salarioatual*0;
novosalario=salarioatual+aumento;
cout<<"Diretor"<<endl<<aumento<<endl<<novosalario;
break;
default:
cout<<"Codigo nao definido";
}
return 0;
}
What’s your problem? You can also post your code in textual mode, instead of a print that we can’t interact with?
– Jefferson Quesado
I tried to post textual and left by half, what is the form I post textual? the problem is that the site sees an error in it understood, there is some issue that it does not solve, and I can not see this issue!
– Victor Oliveira Silva