Question: java Instructions Today we are going to go all the way back to variables and reading console input. We want to print a nice story


Instructions Today we are going to go all the way back to variables and reading console input. We want to print a nice story about a farmer, their land, and their animals. Output is handled for you, but you will need to handle the input Details Input Read in 4 variables in the following order: - A String called farmer An Int called animalCount - A double called acres -A String called crop These values will all be on the same line, 50 tis recommended that you use the methods input.next. input nextint)", and "input.nextDouble(". Processing Read in the required variables from the console, ensuring they are named properly, such that the printFarmerDetalls method is called as intended. This problem is meant to be very simple, so it shouldn't take any longer than it took to read these instructions Output The output is already handled for you, but an example is shown below. Processing Read in the required variables from the console, ensuring they are named properly, such that the printFarmer Details method is called as intended. This problem is meant to be very simple, so it shouldn't take any longer than it took to read these instructions Output The output is already handied for you, but an example is shown below. Sample input/output Input Joe 12 30.99 potatoes Output There once was a farmer named Joe Joe loved to farm, and their most profitable crop was potatoes. They had 30.99 acres of land, and they owned 12 farm animals which they took great care o import java.util.Scanner; public class POD { public static void main (String[] args) { Scanner input-new Scanner (System.in); W/ Define and read in the required variables here printFarmerDetails(farmer, animal Count, acres, crop); } public static void printFarmerDetails(String farmer, int animals, double acres, String crop) { String result ""; result result "There once was a farmer named I farmer". result result farmer + " loved to farm, and ntheir most profitable crop result result "was + crop + ". They had acres + " acres of land, and result result "they owned animals " farm animals which they took great result result "care of."; System.out.println(result); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
