to com dúvida nessa questão:
- Fazer um programa que leia três variáveis do tipo string e as mostre centralizadas na tela.
eu já fiz isso:
/*
- To change this template, choose Tools | Templates
- and open the template in the editor.
*/
package lista1_3;
import java.util.Scanner;
/**
*
-
@author [telefone removido]
*/
public class Main {/**
-
@param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner novo = new Scanner(System.in);
System.out.println(“Informe a primeira mensagem”);
String a = novo.nextLine();
System.out.println(“Informe a segunda mensagem”);
String b = novo.nextLine();
System.out.println(“Informe a terceira mensagem”);
String c = novo.nextLine();
int quant1 = a.length();
int quant2 = b.length();
int quant3 = c.length();
int meio = 40 - (quant1/2);
}
-
@param args the command line arguments
}
estou contando que a tela tem 80 posições, o que tá faltando é apresentar as strings na posição meio encontrada, como faço?
e qq coisa volte a perguntar