METHODS PROGRAM - Lawn Mowing Invoice Program (Using Methods): Lawn Mowing Invoice Program (Using Methods): This...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
METHODS PROGRAM - Lawn Mowing Invoice Program (Using Methods): Lawn Mowing Invoice Program (Using Methods): This program is for a small lawn mowing service company called Lisa's Lawn Mowing Service. The lawn mowing season is 20 weeks long in the part of the country Lisa's is located in. This program going to generate invoices for Lisa's customers based on the size of the lawn being mowed, the number of weeks the lawn will be mowed, and how/when payments will be made (there may or may not be a payment service charge). IMPORTANT: Only one lawn mowing invoice is generated at a time. READ ALL THE DIRECTIONS FIRST. STEP 1: Write the Methods you will have in the program in addition to the main method Your program is required to have the following 4 methods in addition to your main method: displayMenu - this must be a void method that accepts no arguments (so it has no parameter variables). It should display the following menu: calc Weekly MowFee- This method will calculate the weekly mowing fee for the lawn (how much is charged each week that the lawn is mowed). O LAWN MOWING INVOICE GENERATOR 1) Calculate and Display Invoice 2) Quit Program For Lisa's the weekly mowing fee for the lawn is calculated as follows: -If the lawn is less than 350 square feet the weekly mowing fee is $20.00 -If the lawn is 350 square feet or more but less than 550 square feet the weekly mowing fee is $30.00 -If the lawn is 550 square feet or more, the weekly mowing fee is $40.00 This must be a method with one parameter (it accepts one argument). This method should NOT be void; it should return the weekly fee for mowing the lawn. The argument passed into the method will be an integer that represents the size of the lawn in square feet. This method should return the weekly mowing fee for the lawn based on the size of lawn in square feet (so if the lawn was 450 square feet the method should return 30). O calcTotal Mow Cost - This method will calculate the total mowing cost for the lawn. This must be a method with two parameters (it accepts two arguments). This method should NOT be void. The first parameter should be the number of weeks the lawn is going to be mowed and the second parameter should be the weekly mowing fee for the lawn. This method should return the total mowing cost for the lawn for all the weeks. Calculate the total mowing cost as follows: total Mowing Cost = weeks lawn is to be mowed* weekly mowing fee calc Service Charge - This method will calculate the payment service fee for the customer if needed. A customer has two payment options: to pay the entire cost in advance or to pay weekly. If a customer pays in advance they will have no service charge, if the customer pays weekly they must pay a weekly service charge of $1.20. This method is used to calculate the weekly charge if the customer chooses to pay weekly (so this method will ONLY be used by main IF the customer chooses to pay weekly). This must be a method with one parameter (it accepts one argument). This method should NOT be void. The argument passed into the method will be the number of weeks the lawn is to be mowed. This method should return the total service charge for the lawn. Calculate the service charge for the lawn as follows: calc Service Charge - This method will calculate the payment service fee for the customer if needed. A customer has two payment options: to pay the entire cost in advance or to pay weekly. If a customer pays in advance they will have no service charge, if the customer pays weekly they must pay a weekly service charge of $1.20. This method is used to calculate the weekly charge if the customer chooses to pay weekly (so this method will ONLY be used by main IF the customer chooses to pay weekly). This must be a method with one parameter (it accepts one argument). This method should NOT be void. The argument passed into the method will be the number of weeks the lawn is to be mowed. This method should return the total service charge for the lawn. Calculate the service charge for the lawn as follows: o total Service Charge = weeks lawn is to be mowed * 1.20 STEP 2: Write the Main Method of your Program that will utilize the methods you wrote in Step 1 Next write the main method of your program. Your main method should have the following variables: one to hold the size of the lawn in square feet, one to hold the number of weeks the lawn is to be mowed, and one to hold whether or not the customer will pay in advance (all at once) or weekly (they should enter 1 if they will pay weekly and 2 if they will pay all in advance). You also need variables to hold the calculated weekly mowing fee, the calculated total 2 mowing cost, the service charge (may or may not be calculated) and the total cost for everything. You should add any additional variables your main method might need (such as a selection variable for the menu and variables for input and formatting). It is up to you to declare the variables correctly (of the correct type). The main method should first call the displayMenu method which displays the Lawn Mowing Invoice Generator menu and asks the user to make a selection. Using either the Scanner class or an input Dialog Box the main method should then accept input from the user and store it into a variable named choice. If the user selects choice 1- the main method should follow these steps to calculate and display an invoice for the customer's lawn service: o The main method should first ask the user for the size of the lawn to be mowed in square feet (square feet will not be fractional). Use an input validation loop to prevent the user from entering a negative number of square feet for the size of the lawn. o Next, the main method should ask the user for the number of weeks they would like the lawn to be mowed for (weeks will not be fractional). You do not have to do input validation for this; assume the user will enter a number bigger than zero and less than 21. and asks the user to make a selection. Using either the Scanner class or an input Dialog Box the main method should then accept input from the user and store it into a variable named choice. If the user selects choice 1- the main method should follow these steps to calculate and display an invoice for the customer's lawn service: o The main method should first ask the user for the size of the lawn to be mowed in square feet (square feet will not be fractional). Use an input validation loop to prevent the user from entering a negative number of square feet for the size of the lawn. o Next, the main method should ask the user for the number of weeks they would like the lawn to be mowed for (weeks will not be fractional). You do not have to do input validation for this; assume the user will enter a number bigger than zero and less than 21. o Next, the main method should next ask the user if payment for the lawn services will be paid in advance (all at once) or on a weekly basis. Have the user enter 1 for payment in advance and 2 for weekly payment. (you do not have to do input validation for this assume the user will enter 1 or 2) o The main method should then calculate the weekly mowing fee for the lawn by calling the calc Weekly MowFee method using the information the user entered for the lawn size. o The main method should then calculate the total mowing cost for all the weeks by calling the calc Total MowCost method and sending the proper information to the method (weekly mowing fee and the number of weeks) o Next if the user entered 2 for weekly payment the main method should call the calcService Charge method to calculate the service charge for the lawn service. If the user entered 1 for payment in advance you can just set the service charge equal to zero (no need to call the method). o Finally the main method should calculate the overall total (total mowing cost + service charge) display the a lawn mowing invoice similar to the one below (do several tests not just the one shown): LISA'S LAWN MOWING SERVICE - INVOICE Size of Lawn: Number of Weeks: Weekly Mowing Fee: Total Mowing Fee: Service Charge: TOTAL COST: 450 10 $30.00 $300.00 $12.00 $312.00 If the user selects choice 2 - the program should end. If the user selects a choice that is not 1 or 2 - the main method should display an "Invalid Selection" message The menu should continue to display and generate lawn mowing invoices until the user selects 2 to quit the program. METHODS PROGRAM - Lawn Mowing Invoice Program (Using Methods): Lawn Mowing Invoice Program (Using Methods): This program is for a small lawn mowing service company called Lisa's Lawn Mowing Service. The lawn mowing season is 20 weeks long in the part of the country Lisa's is located in. This program going to generate invoices for Lisa's customers based on the size of the lawn being mowed, the number of weeks the lawn will be mowed, and how/when payments will be made (there may or may not be a payment service charge). IMPORTANT: Only one lawn mowing invoice is generated at a time. READ ALL THE DIRECTIONS FIRST. STEP 1: Write the Methods you will have in the program in addition to the main method Your program is required to have the following 4 methods in addition to your main method: displayMenu - this must be a void method that accepts no arguments (so it has no parameter variables). It should display the following menu: calc Weekly MowFee- This method will calculate the weekly mowing fee for the lawn (how much is charged each week that the lawn is mowed). O LAWN MOWING INVOICE GENERATOR 1) Calculate and Display Invoice 2) Quit Program For Lisa's the weekly mowing fee for the lawn is calculated as follows: -If the lawn is less than 350 square feet the weekly mowing fee is $20.00 -If the lawn is 350 square feet or more but less than 550 square feet the weekly mowing fee is $30.00 -If the lawn is 550 square feet or more, the weekly mowing fee is $40.00 This must be a method with one parameter (it accepts one argument). This method should NOT be void; it should return the weekly fee for mowing the lawn. The argument passed into the method will be an integer that represents the size of the lawn in square feet. This method should return the weekly mowing fee for the lawn based on the size of lawn in square feet (so if the lawn was 450 square feet the method should return 30). O calcTotal Mow Cost - This method will calculate the total mowing cost for the lawn. This must be a method with two parameters (it accepts two arguments). This method should NOT be void. The first parameter should be the number of weeks the lawn is going to be mowed and the second parameter should be the weekly mowing fee for the lawn. This method should return the total mowing cost for the lawn for all the weeks. Calculate the total mowing cost as follows: total Mowing Cost = weeks lawn is to be mowed* weekly mowing fee calc Service Charge - This method will calculate the payment service fee for the customer if needed. A customer has two payment options: to pay the entire cost in advance or to pay weekly. If a customer pays in advance they will have no service charge, if the customer pays weekly they must pay a weekly service charge of $1.20. This method is used to calculate the weekly charge if the customer chooses to pay weekly (so this method will ONLY be used by main IF the customer chooses to pay weekly). This must be a method with one parameter (it accepts one argument). This method should NOT be void. The argument passed into the method will be the number of weeks the lawn is to be mowed. This method should return the total service charge for the lawn. Calculate the service charge for the lawn as follows: calc Service Charge - This method will calculate the payment service fee for the customer if needed. A customer has two payment options: to pay the entire cost in advance or to pay weekly. If a customer pays in advance they will have no service charge, if the customer pays weekly they must pay a weekly service charge of $1.20. This method is used to calculate the weekly charge if the customer chooses to pay weekly (so this method will ONLY be used by main IF the customer chooses to pay weekly). This must be a method with one parameter (it accepts one argument). This method should NOT be void. The argument passed into the method will be the number of weeks the lawn is to be mowed. This method should return the total service charge for the lawn. Calculate the service charge for the lawn as follows: o total Service Charge = weeks lawn is to be mowed * 1.20 STEP 2: Write the Main Method of your Program that will utilize the methods you wrote in Step 1 Next write the main method of your program. Your main method should have the following variables: one to hold the size of the lawn in square feet, one to hold the number of weeks the lawn is to be mowed, and one to hold whether or not the customer will pay in advance (all at once) or weekly (they should enter 1 if they will pay weekly and 2 if they will pay all in advance). You also need variables to hold the calculated weekly mowing fee, the calculated total 2 mowing cost, the service charge (may or may not be calculated) and the total cost for everything. You should add any additional variables your main method might need (such as a selection variable for the menu and variables for input and formatting). It is up to you to declare the variables correctly (of the correct type). The main method should first call the displayMenu method which displays the Lawn Mowing Invoice Generator menu and asks the user to make a selection. Using either the Scanner class or an input Dialog Box the main method should then accept input from the user and store it into a variable named choice. If the user selects choice 1- the main method should follow these steps to calculate and display an invoice for the customer's lawn service: o The main method should first ask the user for the size of the lawn to be mowed in square feet (square feet will not be fractional). Use an input validation loop to prevent the user from entering a negative number of square feet for the size of the lawn. o Next, the main method should ask the user for the number of weeks they would like the lawn to be mowed for (weeks will not be fractional). You do not have to do input validation for this; assume the user will enter a number bigger than zero and less than 21. and asks the user to make a selection. Using either the Scanner class or an input Dialog Box the main method should then accept input from the user and store it into a variable named choice. If the user selects choice 1- the main method should follow these steps to calculate and display an invoice for the customer's lawn service: o The main method should first ask the user for the size of the lawn to be mowed in square feet (square feet will not be fractional). Use an input validation loop to prevent the user from entering a negative number of square feet for the size of the lawn. o Next, the main method should ask the user for the number of weeks they would like the lawn to be mowed for (weeks will not be fractional). You do not have to do input validation for this; assume the user will enter a number bigger than zero and less than 21. o Next, the main method should next ask the user if payment for the lawn services will be paid in advance (all at once) or on a weekly basis. Have the user enter 1 for payment in advance and 2 for weekly payment. (you do not have to do input validation for this assume the user will enter 1 or 2) o The main method should then calculate the weekly mowing fee for the lawn by calling the calc Weekly MowFee method using the information the user entered for the lawn size. o The main method should then calculate the total mowing cost for all the weeks by calling the calc Total MowCost method and sending the proper information to the method (weekly mowing fee and the number of weeks) o Next if the user entered 2 for weekly payment the main method should call the calcService Charge method to calculate the service charge for the lawn service. If the user entered 1 for payment in advance you can just set the service charge equal to zero (no need to call the method). o Finally the main method should calculate the overall total (total mowing cost + service charge) display the a lawn mowing invoice similar to the one below (do several tests not just the one shown): LISA'S LAWN MOWING SERVICE - INVOICE Size of Lawn: Number of Weeks: Weekly Mowing Fee: Total Mowing Fee: Service Charge: TOTAL COST: 450 10 $30.00 $300.00 $12.00 $312.00 If the user selects choice 2 - the program should end. If the user selects a choice that is not 1 or 2 - the main method should display an "Invalid Selection" message The menu should continue to display and generate lawn mowing invoices until the user selects 2 to quit the program.
Expert Answer:
Related Book For
Financial Accounting
ISBN: 978-1259103285
5th Canadian edition
Authors: Robert Libby, Patricia Libby, Daniel Short, George Kanaan, M
Posted Date:
Students also viewed these programming questions
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Consider a social network where people are represented as vertices and friendships as edges. If there are 1 0 people in the network and each person is friends with 3 others, calculate the total...
-
On February 28, 2016, Marlin Corp. issues 8%, 10-year bonds payable with a face value of $900,000. The bonds pay interest on February 28 and August 31. Marlin Corp. amortizes bond discount by the...
-
A project your firm is considering requires an investment today of $58,000 and isforecastedto generate cash flows at years 1 through 14 (payments at t = 1 through t = 14) of $15,300 and a cash flow...
-
What is a minute order?
-
An article in Techno metrics by S. C. Narula and J. F. Wellington (Prediction, Linear Regression, and a Minimum Sum of Relative Errors, Vol. 19, 1977) presents data on the selling price and annual...
-
Modigliani and Miller showed the conditions under which dividend policy is not relevant to firm value. Yet when firms announce an unexpected increase in dividends, stock price (and hence firm value)...
-
Assume the only choice variable is x. The total benefit function is B (x) = 170 x x2, and the cost function is C (x) = 100 10 x + 2x2. a. What are the marginal benefit and marginal cost functions?...
-
Consider the model given below: Yi = B1 + B2 D2i + B3D3i + ui Where Yi = Average consumption expenditure per person per 30 days in state i D2i = 1 if the state is in the eastern region of India 0 if...
-
Read the article, "Minorities Who 'Whiten' Job Resumes Get More Interviews". (a) Does this strategic response on the part of minorities make sense given the findings? (b) One of the most popular...
-
Sialkot Ltd . operates a large factory that produces International Quality Football, which is used in the FIFA World Cups. The export price is Rs . 2 , 0 0 0 per football. The variable costs are Rs ....
-
Santana Rey created Business Solutions on October 1, 2021. The company has been successful, and Santana plans to expand her business. She believes that an additional $100,000 is needed and is...
-
List 2 aspects which must be considered for the each of the stages listed below with reference to stocks, sauces and soups to ensure safe temperatures and hygiene procedures. Production S torage...
-
On 1 July 20.1, Joe Traders bought three printers for R84 000 each from Qwerty Technologies and was given a 10% cash discount. BB Logistics delivered all three printers to Joe Traders and charged R2...
-
A stand-up paddleboard outfitter operates without insurance. The outfitter's marginal cost of safety (e.g., staff training, rescue equipment) is MCA = 100+ 144. The marginal benefit of those actions...
-
Q:1 Take any product or service offered in Pakistan and apply all determinents of customer Perceived value ?
-
Sultan Inc. was organized on January 1, 2014. It reported the following for its first two years of operations: Net earnings for 2014 ............. $ 31,000 Dividends for 2014 .............. 14,200...
-
Refer to the financial statements and the accompanying notes of Canadian Tire Corporation given in Appendix A and of RONA Inc. on Connect. Required: 1. Total assets is a common measure of the size of...
-
Briefly explain adjusting entries. List the four types of adjusting entries, and give an example of each type.
-
Find the distance s and the force F on the seesaw fulcrum shown in the figure. Assume that the system is in equilibrium. 20 lb ks- F -24 ft- 10 lb
-
A jet airplane is climbing at a constant airspeed in nowind conditions. The plane is directly over a point on the ground that is 4 statute miles from the takeoff point and the altimeter reads 15 840...
-
The airplane in Problem 6 starts from a brakeslocked position on the runway. The airplane takes off at an airspeed of 200 fps. Find the time for the aircraft to reach takeoff speed.
Study smarter with the SolutionInn App