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
-
A mutual fund manager claims that he has achieved a positive Jensen Measure over the past five years by studying companies' price/earnings ratio. (a) (5 points) You run a regression of the monthly...
-
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...
-
This Module is mainly to practice If ... Then ... ElseIf ... with creating a project in VB Open Visual Basic and create a new Project. Select Windows Form New Project window. You will save this...
-
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...
-
Recall from Theorem 1.7.1 b that a product of lower triangular matrices is lower triangular. Use this fact to prove that the matrix L in 8 is lower triangular.
-
Assume Isuzu produces a car in Japan for 1.8 million. On June 1, when new models are introduced, the exchange rate is 150/USD. Consequently, the automaker sets the sticker price for the car at USD...
-
We are extracting pyridine from \(500 \mathrm{~kg} / \mathrm{h}\) of a feed that is \(15.0 \mathrm{wt} \%\) pyridine and \(85.0 \mathrm{wt} \%\) water using \(225 \mathrm{~kg} / \mathrm{h}\) of pure...
-
Presented below is 2009 information for PepsiCo, Inc. and The Coca-Cola Company. Instructions Using the cash-based measures presented in this chapter, compare the (a) Liquidity (b) Solvency of the...
-
Alyeska Services Company, a division of a major oil company, provides various services to the operators of the North Slope oil field in Alaska. Data concerning the most recent year appear below:...
-
A. Compute the mean return and variance of return for each stock in Problem 1 using (1) The single-index model (2) The historical data In Problem 1 B. Compute the covariance between each possible...
-
Use the tax brackets and rates to compute the federal tax for Jim, who is declaring taxable income of$90,000 $44,701 or less 15% Over $44,701- $89,401 22% Over $89,401 - $138,581 26% O $23,400 O...
-
What do you mean by controllable costs? Give an example. What is a purchase requisition? To whom it is submitted? What are the objectives of Cost Accounting? Name any four techniques of inventory...
-
Wonderer Inc. incurred the following expenditures in 2020: Purchase of land with a dilapidated building at the beginning of the year (no significant value) P5,600,000 Land survey 208,000 Fees for...
-
A heat engine uses two containers held at different temperatures. One container is at 342 K, while the other is kept at 503 K. What is the maximum possible efficiency e for this engine? e =
-
A local accounting firm employs 24 full-time professionals. The budgeted annual compensation per employee is $49,500. The average chargeable time is 400 hours per client annually. All professional...
-
Auto Mobile Ltd is required to prepare general purpose financial reports for the year ending 30 June 2023. i. What type of entity must Auto Mobile Ltd be?(1 mark) ii. What are the accounting...
-
A 7.9 kg body undergoes an acceleration of 3.2 m/s. If this same force is applied to a 4.7 kg body, what is the magnitude of the acceleration in m/s?
-
The company manufactures three products: wooden chairs, tables and dressers. AFC started off as a 'Mom & Pop' shop but has grown rapidly. AFC uses one assembly line to build all three products,...
-
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.
-
Assume that an income statement contains each of the three sections listed below. Which will be the last section presented in the income statement? a. Gross profit b. Income from continuing...
-
When constructing a common-sized income statement, all amounts are expressed as a percentage of: a. net income. b. gross profit. c. net sales. d. income from operations.
-
The current ratio of Hydro Company at December 31, 2018, calculated using the above data, was 3.13 and the company's working capital was \(\$ 170,000\). Which of the following would happen if the...
Study smarter with the SolutionInn App