Question: Integer variables totalFlowers and numFlowers are read from input. A bouquet consists of numFlowers flowers, and the number of flowers is given by totalFlowers. Assign

Integer variables totalFlowers and numFlowers are read from input. A bouquet consists of numFlowers flowers, and the number of flowers is given by totalFlowers. Assign remainingFlowers with the remaining flowers after making as many bouquets as possible.
Ex: If the input is 134, then the output is:
import java.util.Scanner;
public class RemainingFlowers {
public static void main(String[] args){
Scanner scnr = new Scanner(System.in);
int totalFlowers;
int numFlowers;
int remainingFlowers;
totalFlowers = scnr.nextInt();
numFlowers = scnr.nextInt();
/* Your code goes here */
System.out.println("Remaining flowers: "+ remainingFlowers);
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!