Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package andreza;
- import java.util.Random;
- public class q1 {
- public static void main(String[] args) {
- int faturamento = 0;
- Random vend = new Random();
- Random prec = new Random();
- for(int i = 1; i <= 100; i++) {
- faturamento += (int) ((prec.nextDouble() * vend.nextInt(50)+1));
- //System.out.println("O valor do "+i+"º faturamento é: " +(prec.nextDouble() * vend.nextInt(50)+1));
- }
- System.out.println("O valor de faturamento total é: "+faturamento);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement