1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ksju [112]
4 years ago
11

Write an application for a lawn-mowing service. The lawn-mowing season lasts for 20 weeks. The weekly fee for mowing a lot less

than 400 square feet is $25. The fee for a lot that is 400 square feet or more, but fewer than 600 square feet, is $35 per week. The fee for a lot that is 600 square feet or over is $50 per week. Prompt the user for the length and width of a lawn, and then print the weekly mowing fee, as well as the 20-week seasonal fee. Save the class as Lawn.java.
Computers and Technology
1 answer:
jenyasd209 [6]4 years ago
4 0

Answer:

// 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;}

}

}

Explanation:

Read the length and width of lawn from user with the help of scanner object. Find the area of the lawn.If the area if less than 400 then Weekly mowing fee  is $25 and find the 20-week seasonal fee by multiply 25 with 20.If the area is greater than 400 and less than 600 then Weekly fee is $35 and seasonal fee  will be 35*20.if the area is greater than 600 then Weekly fee is $50 and seasonal fee will be 50*20.

Output:

Enter length of lawn:15                                                                                                    

Enter width of lawn:12                                                                                                    

Weekly mowing fee is:$25                                                                                                  

20-week seasonal fee is:$500

You might be interested in
I recently fixed my computer's hard drive, and when I rebooted my comp., the mouse and keyboard won't work. The keys work when i
dezoksy [38]
Just simply do a hard reset, all your data will be lost but i think it will work, with my computes passed the same.
5 0
4 years ago
Lab Assignment 7A For the lab this week, you will sort an array - using any of the sort methods discussed in Chapter 23 or the S
zhuklara [117]

Answer:

See explaination

Explanation:

import java.util.Scanner;

public class sort {

static void lowestToHighest(float arr[][])

{

float temp;

for(int i=0;i<11;i++)

for(int j=0;j<12-i-1;j++) //Using bubble sort to sort

{

if(arr[j][0]>arr[j+1][0])

{

temp = arr[j][0];

arr[j][0] = arr[j+1][0];

arr[j+1][0] = temp;

}

}

for(int i=0;i<11;i++) //Using bubble sort to sort

{

for(int j=0;j<12-i-1;j++)

if(arr[j][1]>arr[j+1][1])

{

temp = arr[j][1];

arr[j][1] = arr[j+1][1];

arr[j+1][1] = temp;

}

}

System.out.println("Data in the array after sorting lowest to highest: ");

for(int i=0;i<12;i++)

System.out.printf(arr[i][0]+" "+arr[i][1]+"\n");

}

static void highestToLowest(float arr[][])

{

float temp;

for(int i=0;i<11;i++)

for(int j=0;j<12-i-1;j++) //Using bubble sort to sort

{

if(arr[j][0]<arr[j+1][0])

{

temp = arr[j][0];

arr[j][0] = arr[j+1][0];

arr[j+1][0] = temp;

}

}

for(int i=0;i<11;i++) //Using bubble sort to sort

{

for(int j=0;j<12-i-1;j++)

if(arr[j][1]<arr[j+1][1])

{

temp = arr[j][1];

arr[j][1] = arr[j+1][1];

arr[j+1][1] = temp;

}

}

System.out.println("Data in the array after sorting highest to lowest: ");

for(int i=0;i<12;i++)

System.out.printf(arr[i][0]+" "+arr[i][1]+"\n");

}

public static void main(String[] args){

float temperature[][]=new float[12][2];

Scanner input = new Scanner(System.in);

System.out.println("Enter 12 months of highest and lowest temperatures for each month of the year: ");

for(int i=0;i<12;i++)

for(int j=0;j<2;j++)

temperature[i][j]=input.nextFloat();

System.out.println("Data in the array: ");

for(int i=0;i<12;i++)

System.out.printf(temperature[i][0]+" "+temperature[i][1]+"\n");

lowestToHighest(temperature);

highestToLowest(temperature);

}

}

8 0
4 years ago
If you purchase a software suite for personal use, you can install the software how many times on how many different machines?
givi [52]

A software for personal use can be installed for a finite number of times as stated in the agreement signed between the customer and the supplier. Therefore the answer to this question is <span>“It depends upon the conditions stated in the license agreement”.</span>

8 0
4 years ago
Help please fast
Pachacha [2.7K]
Bookmark because you can go back to it at any given time to re use it
4 0
3 years ago
Read 2 more answers
An Excel formula always begins with a(n) ____.
Basile [38]
Every Excel formula begins with '=' (equality) sign.
7 0
3 years ago
Other questions:
  • The process of converting information, such as text, numbers, photos, or music, into digital data that can be manipulated by ele
    7·1 answer
  • If you are planning to carry a large balance on your credit card, which of the following credit card features should you look fo
    7·2 answers
  • If you want to access your files anywhere from almost any connected device, you should store your files on your ________.
    9·1 answer
  • Which View option allows you to view your document as it would appear when posted online?
    8·1 answer
  • Can some one help me on 4&amp;5
    6·1 answer
  • 1) List at least five smaller behaviors you could break the complex behavior "brushing my teeth" into.
    14·2 answers
  • Aarti, a museum employee, has created a table in access titled “Roman Achitecture”. She has included a field that links users im
    8·1 answer
  • How to prepare and draw a corresponding flowchart to compute the sum and product of all prime numbers between 1 and 50
    7·1 answer
  • What are different sheet icons
    5·1 answer
  • PLEASE ANSWER AND HURRY I'LL MARK YOU BRAINLIEST!!<br><br><br>​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!