import java.util.*;
import java.lang.*;
import java.io.*;
/* class Main {
public static void main(String[] args) {
Scanner teclado = new Scanner(System.in);
String[] nomes = new String[100];
double[] notas = new double[100];
int i = 0;
double soma = 0;
while (true) {
System.out.print("Escreva o nome do aluno ou saia");
String nome = teclado.nextLine();
if (nome.equalsIgnoreCase("sair")) {
break;
}
System.out.print("Escreva a nota do aluno: ");
double nota = teclado.nextDouble();
teclado.nextLine();
nomes[i] = nome;
notas[i] = nota;
soma += nota;
i++;
}
System.out.println("Quantidade de Alunos:");
for (int j = 0; j < i; j+++) {
System.out.println("Aluno: " + nomes[j] + ", Nota; " + notas[j]);
}
double media = soma / i;
System.out.println("A média é: " + media);
teclado.close();
}
} */
/* class Main {
public static void main(String[] args) {
Scanner teclado = new Scanner(System.in);
String[] nomes = new String[100];
int[] quantia = new int[100];
double[] valor = new double[100];
int i = 0;
double total = 0;
System.out.println("=== Cadastro de Produtos ===");
System.out.println("Digite o nome do produto ou 'sair' para sair.");
while (true) {
System.out.print("Escreva o nome do produto:");
String nome = teclado.nextLine();
if (nome.equalsIgnoreCase("sair")) {
break;
}
System.out.print("Escreva a quantidade: ");
int quantidade = teclado.nextInt();
System.out.print("Escreva o valor unitário: ");
double valorr = teclado.nextDouble();
teclado.nextLine();
nomes[i] = nome;
quantia[i] = quantidade;
valor[i] = valorr;
double t = quantidade * valorr;
total += t;
i++;
}
System.out.println(" === Resumo da Compra === ");
for (int j = 0; j < i; j++) {
double t = quantia[j] * valor[j];
System.out.printf("%d) %s - %d x R$ %.2f = R$ %.2f\n", j + 1, nomes[j], quantia[j], valor[j], t);
}
System.out.printf("Total Final: R$ %.2f\n", total);
teclado.close();
}
} */
To embed this project on your website, copy the following code and paste it into your website's HTML: