Ask Question
18 March, 06:16

Write a program that reads in the length and the width of a rectangular yard. your program should compute the time required (in minutes) to cut the grass at the rate of 2.3 square meters a second

I just want to know the equation that i need

+4
Answers (1)
  1. 18 March, 07:19
    0
    import javax. swing.*;

    public class Grass { public static void main (String[]args) { / / Variable declarations String gd; Double st, st2, st3, st4, time; for (int i=1; i<=5; i++) { / / Get user input gd = JOptionPane. showInputDialog ("Enter the length of yard"); st = Double. parseDouble (gd); st2 = Double. parseDouble (JOptionPane. showInputDialog ("Enter the width of yard")); st3 = Double. parseDouble (JOptionPane. showInputDialog ("Enter the length of house")); st4 = Double. parseDouble (JOptionPane. showInputDialog ("Enter the width of house")); / / Calculate time = (st * st2 - st3 * st4) / 2.3; / / Display the result System. out. println ("The time required (in minutes) to cut the grass: "+time); } } / / end of main } / / end of grass
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a program that reads in the length and the width of a rectangular yard. your program should compute the time required (in minutes) to ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers