-
Notifications
You must be signed in to change notification settings - Fork 21.2k
Add files via upload #398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add files via upload #398
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import java.util.Scanner; | ||
| public class LawnMowing{ | ||
| public static void main ( String [] args){ | ||
|
|
||
| Scanner input = new Scanner (System.in); | ||
| System.out.print ("Lawn-mowing service"); | ||
| System.out.print (" \n Please Enter the Length and Width of your lawn: "); | ||
| System.out.print ("\n Length: "); | ||
| double length = input.nextDouble(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct the indent according to the lines above. |
||
| System.out.print ("Width: "); | ||
| double width = input.nextDouble(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This lines must be indent according to the main-method. |
||
| System.out.print ("How would you like to set up a payment? \n (1) once, (2) twice, (3) 20 times per year"); | ||
| int payment = input.nextInt(); | ||
|
|
||
| double lawn = length*width; | ||
| double wcost = 0.0; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This lines must be indent according to the main-method. |
||
| if (lawn < 4000) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indent, too. |
||
| wcost = 25;} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move the curly brace in the next line. |
||
| else if (lawn >= 4000 && lawn < 6000) { | ||
| wcost = 35;} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move the curly brace in the next line. |
||
| else { | ||
| wcost = 50;} | ||
| double costt = wcost*20; | ||
| double costp = 0.0; | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Put in comments in your code. Because your code would more readable. |
||
|
|
||
| if ( payment == 1) { | ||
| costp = costt;} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move the curly brace in the next line. |
||
| else if (payment == 2) { | ||
| costp = (costt/2);} | ||
| else if (payment == 20) { | ||
| costp = (costt/20);} | ||
|
|
||
|
|
||
| System.out.printf (" \n Your lawn is %.2f ", lawn); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indent this lines according to the main-method. |
||
| System.out.print (" square feet."); | ||
| System.out.printf ("\n your weekly fee: %.2f", wcost); | ||
| System.out.printf ("\n 20-week seasonal fee: %.2f", costt); | ||
| System.out.print ("\n your payment is a " + payment); | ||
| System.out.printf(" time fee %.2f", costp); | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The last curly brace in the next line. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lines must be indent.