This repository was archived by the owner on Apr 23, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +69
-0
lines changed
Expand file tree Collapse file tree 4 files changed +69
-0
lines changed Original file line number Diff line number Diff line change 1+ class Ex01 {
2+ public static void main (String [] args ) {
3+ int gastosJaneiro = 15000 ;
4+ int gastosFevereiro = 23000 ;
5+ int gastosMarco = 17000 ;
6+ int gastosTrimeste = gastosJaneiro + gastosFevereiro + gastosMarco ;
7+
8+ System .out .println ("Gasto total do trimestre: " + gastosTrimeste );
9+ }
10+ }
Original file line number Diff line number Diff line change 1+ class Ex02 {
2+ public static void main (String [] args ) {
3+ int i = 0 ;
4+
5+ for (i = 150 ; i <= 300 ; i ++) {
6+ System .out .println (i );
7+ }
8+
9+ int soma = 0 ;
10+ for (i = 0 ; i <= 1000 ; i ++) {
11+ soma += i ;
12+ System .out .println (soma );
13+ }
14+
15+ int fatorial = 1 ;
16+ for (i = 1 ; i <= 5 ; i ++) {
17+ fatorial += fatorial * i ;
18+ }
19+ System .out .println (fatorial );
20+ }
21+ }
Original file line number Diff line number Diff line change 1+ class Ex03 {
2+ static class Conta {
3+ int numero ;
4+ String titular ;
5+ double saldo ;
6+
7+ void setSaldo (double novoSaldo ) {
8+ this .saldo = novoSaldo ;
9+ }
10+
11+ void setTitular (String novoTitular ) {
12+ this .titular = novoTitular ;
13+ }
14+
15+ double getSaldo () {
16+ return this .saldo ;
17+ }
18+
19+ String getTitular () {
20+ return this .titular ;
21+ }
22+ }
23+
24+ public static void main (String [] args ) {
25+ Conta contaAdvogated ;
26+ contaAdvogated = new Conta ();
27+
28+ contaAdvogated .setTitular ("Advogated" );
29+ contaAdvogated .setSaldo (9999.9 );
30+
31+ System .out .println ("Saldo de " + contaAdvogated .getTitular () + " = R$" + contaAdvogated .getSaldo ());
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ public class HelloWorld {
2+ public static void main (String [] args ) {
3+ System .out .println ("Hello, World!" );
4+ }
5+ }
You can’t perform that action at this time.
0 commit comments