// Arup Guha
// 8/31/2026
// While loop examples.

import java.util.*;

public class whileloop {

	public static void main(String[] args) {
		
		Scanner stdin = new Scanner(System.in);
		int total = 0, numPeople = 0, numDonators = 0;
		
		// Keep collecting until we get our goal.
		while (total < 100) {
		
			// Get next donation.
			System.out.println("Person "+(numPeople+1)+" how much money?");
			int value = stdin.nextInt();
			
			// Add to our collection.
			total += value;
			
			// You only count if you gave me actual money!
			numPeople++;
			if (value > 0)
				numDonators++;
		}
		
		// Summary of donations.
		System.out.println("We got donations from "+numDonators+" people collecting "+total);
		
		// Reset these for do while example
		total = 0; 
		numPeople = 0; 
		numDonators = 0;
		
		// Keep collecting until we get our goal.
		do {
		
			// Get next donation.
			System.out.println("Person "+(numPeople+1)+" how much money?");
			int value = stdin.nextInt();
			
			// Add to our collection.
			total += value;
			
			// You only count if you gave me actual money!
			numPeople++;
			if (value > 0)
				numDonators++;
			
		} while (total < 100);
		
		// Summary for version 2.
		System.out.println("Round 2: We got donations from "+numDonators+" people collecting "+total);
	}
}