Jump to content

Alteração de estrutura de decisão


Pera Lopes
 Share

Recommended Posts

Recodifique, na linguagem de programação JAVA, a seguinte decisão alternativa, substituindo-a por uma decisão do tipo múltipla

import java.io.*;
public class exame_2epoca_fp_4A
{
static public void main(String[] args)
{
int decisora = 2;
if ( decisora < 0 ) System.out.println ("Variável fora do intervalo admissível");
else if ( decisora == 0) System.out.println (" Variável = 0 ");
else if ( decisora == 1) System.out.println (" Variável = 1 ");
else if ( decisora == 2) System.out.println (" Variável = 2 ");
else if ( decisora > 2) System.out.println ("Variável fora do intervalo admissível");
}
}
Link to comment
Share on other sites

❝The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.❞- John Carmack on software patents

A list  of command line apps

Link to comment
Share on other sites

É uma série de tutoriais à linguagem Java. Terás lá as bases necessárias para fazer o trabalho.

O guia Language Basics parece-me ideial.

❝The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.❞- John Carmack on software patents

A list  of command line apps

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.