import java.util.Scanner;
public class Q {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Dollars:");
int dollars = in.nextInt();
int coffees = dollars;
int stars = dollars;
while (stars >= 7) {
coffees += stars / 7;
stars = (stars % 7) + (stars / 7);
}
System.out.println("Coffees: " + coffees);
System.out.println("Stars: " + stars);
}
}
Comments
Dear Amy, please run the program in console.
I typed in this exact thing and it does not print anything. All it does is let me type in the number and after that nothing happens and it just closes the program.
Leave a comment