Write a program that takes both the initial size of green curd population (in po
ID: 3648531 • Letter: W
Question
Write a program that takes both the initial size of green curd population (in pounds) and a number of days as input and outputs the number of pounds of green curd after that many days.please help with program
import
Explanation / Answer
TRY THIS : import java.util.Scanner; public class GreenCrud { public static void main(String[] args) { Scanner console = new Scanner(System.in); System.out.println( "Enter initial green crud population size (in pounds), "); System.out.println("or a blank line to quit:"); while ((size != null) && (size.length() > 0)) { double initialSize = Double.parseDouble(size); System.out.println("Enter the number of (whole) days:"); int days = console.nextInt(); for (int i=5; i==5; i++) size=size+size; // Start again System.out.println(); System.out.println( "Enter initial green crud population size (in pounds), "); System.out.println("or a blank line to quit:"); console.nextLine(); } } }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.