Westonci.ca connects you with experts who provide insightful answers to your questions. Join us today and start learning! Join our Q&A platform and connect with professionals ready to provide precise answers to your questions in various areas. Explore comprehensive solutions to your questions from a wide range of professionals on our user-friendly platform.
Sagot :
The prompt to the user for the length and width of a lawn is; Done by the program created below in Java using JOPTIONPANE
How do you write a Program in Java?
// library
import java.util.*;
// class definition
class Main
{// main method of the class
public static void main (String[] args) throws java.lang.Exception
{
try{
// object to read inputs
Scanner scr=new Scanner(System.in);
System.out.print("Enter length of lawn:");
// read the length of lawn
int length=scr.nextInt();
System.out.print("Enter width of lawn:");
// read the width of lawn
int width=scr.nextInt();
// find area of lawn
int area=length*width;
//if area is less than 400
if(area<400)
{// Weekly mowing fee
System.out.println("Weekly mowing fee is:$25");
// seasonal fee
System.out.println("20-week seasonal fee is:$"+(25*20));
}
// if area >=400 and area <600
else if(area>=400 && area<600)
{
// Weekly mowing fee
System.out.println("Weekly mowing fee is:$35");
// seasonal fee
System.out.println("20-week seasonal fee is:$"+(35*20));
}
// if area >=600
else if(area>=600)
{
// Weekly mowing fee
System.out.println("Weekly mowing fee is:$50");
// seasonal fee
System.out.println("20-week seasonal fee is:$"+(50*20));
}
}catch(Exception ex){
return;}
}
}
Read more about Java Programming at; https://brainly.com/question/18554491
Thank you for your visit. We're committed to providing you with the best information available. Return anytime for more. We appreciate your time. Please revisit us for more reliable answers to any questions you may have. Thank you for trusting Westonci.ca. Don't forget to revisit us for more accurate and insightful answers.