Question: Hi , I need help, please. In Java. Here are the assignment instructions: The modulo operator ( % ) evaluates the remainder of the division

Hi, I need help, please. In Java.
Here are the assignment instructions:
Themodulo operator(%) evaluates the remainder of the division of two integer operands. Ex: 23%10 is 3.
Write a program that uses the modulo operator. The program will accept user input for the total number of flowers available to create a bouquet and the number of flowers each bouquet will contain. The program will then calculate how many bouquets can be created and how many flowers will be left over.
Example input (the program should prompt the user to input the below values - these are example values only).
Ex: If the input is:
Enter total flowers available (as an integer): 23
Enter the number of flowers for your bouquet (as an integer): 5
Corresponding output:
There will be 4 bouquets.
There will be 3 remaining flowers.
Here is what I have:
import java.util.Scanner;
import java.util.*;
public class IntDivModulo {
public static int modCalculation {
int mod =0;
mod =(flowers % bouquets);
}
return mod;
}
public static void main(String[] args){
Scanner myScan = new Scanner(System.in);
int flowers, bouquets =0;
System.out.println ("Enter total flowers available (as an integer): ");
flowers = myScan.nextInt();
System.out.println ("Enter the number of flowers needed per bouquet (as an integer): ");
bouquets = myScan.nextInt();
//Print out statements
System.out.println ("There will be "+ flowers +" flowers.");
System.out.println ("There will be "+ bouquets +" bouquets.");
}
}

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 Programming Questions!