GithubHelp home page GithubHelp logo

ajuda's Issues

Duvida

package atividadesn1;
import java.util.Scanner;

public class atividade28 {
public static void main(String[] args) {

    Scanner entrada = new Scanner (System.in);
    
    double numero1, numero2;
    Object opcao = null;
    
    System.out.print("Operações Permitidas\n Opções:\n 1 - Soma\n 2 - Subtração\n 3 - Multiplicação\n 4 - Divisão\n");
    
    System.out.print("Digite uma opção: ");
    
    
if (("1".equals(opcao)) && (opcao.equals("2"))) && (opcao.equals("3"))) && (opcao.equals("4")))
{
    System.out.print("Digite um número real......: ");
    numero1 = entrada.nextDouble();
    
    System.out.print("Digite um outro número real: ");
    numero2 = entrada.nextDouble();
    
    switch ("opcao") {
        case "1": {
            System.out.printf("SOMA: (%.2f) + (%.2f) = %.2f\n", numero1, numero2, numero1 + numero2);
            break;
        }
        case "2": {
            System.out.printf("SUBTRAÇÃO: (%.2f) - (%.2f) = %.2f\n", numero1, numero2, numero1 - numero2);
            break;
        }
        case "3": {
            System.out.printf("MULTIPLICAÇÃO: (%.2f) * (%.2f) = %.2f\n", numero1, numero2, numero1 * numero2);
            break;
        }
        case "4": {
            if (numero2 == 0.0) {
                System.out.printf("DIVISÃO imposs\u00edvel: (%.2f) / (%.2f)\n", numero1, numero2);
                break;
            }
            System.out.printf("Divisão: (%.2f) / (%.2f) = %.2f\n", numero1, numero2, numero1 / numero2);
        }
    }
}
else 
    {
  System.out.printf("'%s' não é uma opção!\n", new Object[] { opcao });
}

}
}

Horas

package Bolo_no_Pote;

public class NewClass {
public static void main(String[] args) {

long totalmilisegundos = System.currentTimeMillis()- 10800000;

long totalSegundos = totalmilisegundos/1000;
long segundoatual = totalSegundos %60;

long totalMinutos = totalSegundos /60;
long minutoAtual = totalMinutos % 60;

long totalHora = totalMinutos /60;
long horaAtual = totalHora %24;

System.out.println(horaAtual + ":" + minutoAtual + ":" + segundoatual);

}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.