Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package projetorobo;
- public class CriaRobo{
- String nomeRobo;
- String numSerie;
- String dataFab;
- int carga;
- double valor1,valor2,resultado;
- public CriaRobo(){
- this.carga = 100;
- }
- public void setAtributos(String nome, String serie, String data){
- this.nomeRobo = nome;
- this.numSerie = serie;
- this.dataFab = data;
- }
- if(valor1 % 2 != 0)
- {
- carga = carga - ((carga*10)/100);
- }elseif(valor1 % 2 != 0){
- carga = (carga - ((carga*5)/100));
- }
- double soma(double valor1, double valor2){
- resultado = valor1 + valor2;
- return resultado;
- }
- double subtrai(double valor1, double valor2){
- resultado = valor1 - valor2;
- return resultado;
- }
- double multiplica(double valor1, double valor2){
- resultado = valor1 * valor2;
- return resultado;
- }
- double divide(double valor1, double valor2){
- resultado = valor1 / valor2;
- return resultado;
- }
- double resto(double valor1, double valor2){
- resultado = valor1 % valor2;
- return resultado;
- }
- void setAtributos(String nome) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement