I. Following Javadoc Comments: Part A The shell for a Car.java class is available in Desire2Learn....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
I. Following Javadoc Comments: Part A The "shell" for a Car.java class is available in Desire2Learn. The car.java file is inside a .zip file that is posted there. Download that .zip file and extract the contents to save a copy of Car.java. The Car.java file that we have provided includes javadoc comments that explain what code is to be added. There is a javadoc comment for the class itself, as well as a javadoc comment for each instance variable and method. Read these comments carefully, and fill in the missing code (in the proper locations within the file). Implement the car class as it has been described in the javadoc comments. Aside from filling in your name & student number beside the @author tag, you are NOT permitted to alter the comments in any way. Also, include only those instance variables and methods that have been described in the comments; no other instance variables or methods should be added. I. Following Javadoc Comments: Part A The "shell" for a Car.java class is available in Desire2Learn. The car.java file is inside a .zip file that is posted there. Download that .zip file and extract the contents to save a copy of Car.java. The Car.java file that we have provided includes javadoc comments that explain what code is to be added. There is a javadoc comment for the class itself, as well as a javadoc comment for each instance variable and method. Read these comments carefully, and fill in the missing code (in the proper locations within the file). Implement the car class as it has been described in the javadoc comments. Aside from filling in your name & student number beside the @author tag, you are NOT permitted to alter the comments in any way. Also, include only those instance variables and methods that have been described in the comments; no other instance variables or methods should be added. When printing output, make sure that the information is easy to read. Make it clear which information belongs to each car and include appropriate labels. (Remember, whitespace can help with formatting & readability.) Be sure to add a javadoc comment to the top of your CarTestDriver class; include the @author tag (with your name & student number). Once this first question is complete... Create a file containing the output of CarTest Driver (as you did in Lab #2, using redirection at the command line); name this file As2Q1Output.txt. When you later create the .zip archive for this assignment, you will include this output file, as well as the source code for Part A & Part B (i.e. the car.java and CarTestDriver.java files.) Add appropriate headings to your report document for this assignment. Copy & paste into your report the complete source code (the Car.java and CarTestDriver.java files) and the output. II. Creating an Application from Scratch: Part A A local golf course has a clubhouse with a restaurant and bar that members of the club may visit. Any food or drinks that a member orders there are added to a tab, which means that the cost of each of the items ordered is simply added to a running total that the member will pay when they leave the clubhouse at the end of their visit. Write a Java class named Tab that can be used to create & work with Tab objects. For each Tab, we need to keep track of the name of the member who is running the tab (e.g. "Stewart MacDonald"), their seat number (e.g. 12), as well as the total amount owing (which is always 0.00 when the tab is first created when they enter the clubhouse). In the Tab class, include three instance variables and one constructor. The constructor should initialize the instance variables. Provide three simple accessor methods: one to retrieve the member's name, one to retrieve the seat number, and one to retrieve the total amount for all of the charges that have been added to the tab so far. Provide a mutator method that adds the price of a requested menu item to the member's tab. The price of the menu item is passed in through a parameter. (Aside: You may assume that all taxes are already included in the menu prices.) Include one more accessor method that will calculate and return a tip amount when given a percentage. For example, if the patron's current tab was 22.50, and they wanted to leave an 18% tip, the tip amount would be 4.05. This method will accept the percentage as a parameter (e.g. 0.18 for 18%) and return the tip amount. Part B Side note: There are details included in the scenario that is described below that are not needed for the code that you will write. (These details are simply included to help tell the story.) Do not add extra fields or methods to the Tab class (other than those that were mentioned in Part A). Scenario: A group of friends are members of this golf club. They haven't seen one another much over the summer, so they decide to meet up at the clubhouse to share a meal and catch up. Everyone is paying separately so each person will have their own tab. Write and test a Friends Meetup class. This class will serve as a driver program for Part A and should be saved in the same folder as the Tab class. In the main method of the Friends Meetup class, include statements to support the following (in this order): ⚫ Mike Smith arrives first. He decides to sit at seat 3 and opens a tab. Create a Tab object called mikesTab. • Mike orders a Coke, which costs 2.50. • Sarah Jones, who wants to sit at the end in seat 1, opens a tab; call this object variable sarahsTab. • Sarah orders an iced-tea at a cost of 2.85. ⚫ Jin Chen sits beside Sarah at seat 2, and he is the next to open a tab; call this object variable jinsTab. ⚫ Jin chooses a milkshake, at a cost of 5.50. • Ella Paul, who sits across from Mike at seat 7, also opens a tab; call this object variable ellasTab. • Ella orders an orange juice for herself for 2.75, and then orders a salad for 7.50. (Use two separate statements, one for each purchase.) • Sarah then orders the stir-fry, which costs 15.50. . Jin decides to order a plate of nachos; this costs 12.75. • Mike is really hungry so he orders the calamari appetizer for 8.75 and a burger, which costs 13.45. (Use two separate statements, one for each purchase.) ⚫ After Ella finishes her salad she is still hungry so she orders pie for dessert for 4.75. Next, for each of the four Tab objects print out the member's name, the seat number, and the current total amount owing. Suppose Mike wishes to leave a 20% tip. Sarah, feeling slightly less generous, wishes to leave an 18% tip. Jin and Ella both opt to leave 16% tips. Make the appropriate method calls to retrieve the tip amounts for each patron. Print out each of these tip amounts. (Aside: You do NOT need to worry about displaying the tip amounts with exactly 2 decimal digits.) NOTE: In this driver program, be sure to label all of your output so the meanings of the values are clear. (i.e. Don't just print out numbers without explaining what they represent.) You do NOT need to worry about displaying the monetary amounts with exactly 2 decimal digits. Part C Add a javadoc comment to the top of your Friends Meetup class. Include a one- line description of the class as well as the author information (using the @author tag). Add proper javadoc comments to your Tab class as well. For Tab, you should include a comment for the class, as well as a comment for each instance variable and method. The javadoc comment for the class should include an @author tag. Within the javadoc comment for each method, include @param tag(s) if the method has any parameters, as well as an @return tag if there is anything being returned from the method. Run the javadoc utility on your Tab.java file. Recall that, by default, author information and everything that is private is ignored by javadoc. To include this information, you must turn on the appropriate switches by doing this: javadoc -author private Tab.java Do this and then open the resulting Tab.html file in a browser. If you notice any problems with the documentation, go back and fix your javadoc comments and rerun javadoc on your file. Once this question is complete... Create a file containing the output of Friends Meetup: name this file As2Q2Output.txt. When you create the zip archive for this assignment, you will include this output file, as well as the source code (i.e. the Tab.java and Friends Meetup.java files) and the documentation files that were generated when you ran javadoc on Tab.java. (Aside: In addition to the Tab.html file, the javadoc utility created a number of other files and folders. These are used to provide structure/formatting to the documentation. All of those files & folders should be included in the zip file that you submit for this assignment.) Add appropriate headings to your report document for this assignment. Copy & paste into your report the complete source code (the Tab.java and Friends Meetup.java files) and the output. The documentation files that were created when you ran the javadoc utility do not need to be included in your assignment report. (They will only be in the .zip archive.) ii. an archive file (.zip) that contains your Java source code and output for this assignment, as well as the files that were produced by running the javadoc utility on Tab.java in Question II. Make sure that your archive includes all.java files (in case the marker wishes to compile & run your code to test it), both of the output files (with the correct filenames), and all of the files & folders that were created by the javadoc utility. You should not include the report document or the .class files in your archive. This archive should be submitted as a single file to the appropriate submission folder on Desire2Learn. Note: Please name this archive file as follows: YourName_As2_Archive.zip I. Following Javadoc Comments: Part A The "shell" for a Car.java class is available in Desire2Learn. The car.java file is inside a .zip file that is posted there. Download that .zip file and extract the contents to save a copy of Car.java. The Car.java file that we have provided includes javadoc comments that explain what code is to be added. There is a javadoc comment for the class itself, as well as a javadoc comment for each instance variable and method. Read these comments carefully, and fill in the missing code (in the proper locations within the file). Implement the car class as it has been described in the javadoc comments. Aside from filling in your name & student number beside the @author tag, you are NOT permitted to alter the comments in any way. Also, include only those instance variables and methods that have been described in the comments; no other instance variables or methods should be added. I. Following Javadoc Comments: Part A The "shell" for a Car.java class is available in Desire2Learn. The car.java file is inside a .zip file that is posted there. Download that .zip file and extract the contents to save a copy of Car.java. The Car.java file that we have provided includes javadoc comments that explain what code is to be added. There is a javadoc comment for the class itself, as well as a javadoc comment for each instance variable and method. Read these comments carefully, and fill in the missing code (in the proper locations within the file). Implement the car class as it has been described in the javadoc comments. Aside from filling in your name & student number beside the @author tag, you are NOT permitted to alter the comments in any way. Also, include only those instance variables and methods that have been described in the comments; no other instance variables or methods should be added. When printing output, make sure that the information is easy to read. Make it clear which information belongs to each car and include appropriate labels. (Remember, whitespace can help with formatting & readability.) Be sure to add a javadoc comment to the top of your CarTestDriver class; include the @author tag (with your name & student number). Once this first question is complete... Create a file containing the output of CarTest Driver (as you did in Lab #2, using redirection at the command line); name this file As2Q1Output.txt. When you later create the .zip archive for this assignment, you will include this output file, as well as the source code for Part A & Part B (i.e. the car.java and CarTestDriver.java files.) Add appropriate headings to your report document for this assignment. Copy & paste into your report the complete source code (the Car.java and CarTestDriver.java files) and the output. II. Creating an Application from Scratch: Part A A local golf course has a clubhouse with a restaurant and bar that members of the club may visit. Any food or drinks that a member orders there are added to a tab, which means that the cost of each of the items ordered is simply added to a running total that the member will pay when they leave the clubhouse at the end of their visit. Write a Java class named Tab that can be used to create & work with Tab objects. For each Tab, we need to keep track of the name of the member who is running the tab (e.g. "Stewart MacDonald"), their seat number (e.g. 12), as well as the total amount owing (which is always 0.00 when the tab is first created when they enter the clubhouse). In the Tab class, include three instance variables and one constructor. The constructor should initialize the instance variables. Provide three simple accessor methods: one to retrieve the member's name, one to retrieve the seat number, and one to retrieve the total amount for all of the charges that have been added to the tab so far. Provide a mutator method that adds the price of a requested menu item to the member's tab. The price of the menu item is passed in through a parameter. (Aside: You may assume that all taxes are already included in the menu prices.) Include one more accessor method that will calculate and return a tip amount when given a percentage. For example, if the patron's current tab was 22.50, and they wanted to leave an 18% tip, the tip amount would be 4.05. This method will accept the percentage as a parameter (e.g. 0.18 for 18%) and return the tip amount. Part B Side note: There are details included in the scenario that is described below that are not needed for the code that you will write. (These details are simply included to help tell the story.) Do not add extra fields or methods to the Tab class (other than those that were mentioned in Part A). Scenario: A group of friends are members of this golf club. They haven't seen one another much over the summer, so they decide to meet up at the clubhouse to share a meal and catch up. Everyone is paying separately so each person will have their own tab. Write and test a Friends Meetup class. This class will serve as a driver program for Part A and should be saved in the same folder as the Tab class. In the main method of the Friends Meetup class, include statements to support the following (in this order): ⚫ Mike Smith arrives first. He decides to sit at seat 3 and opens a tab. Create a Tab object called mikesTab. • Mike orders a Coke, which costs 2.50. • Sarah Jones, who wants to sit at the end in seat 1, opens a tab; call this object variable sarahsTab. • Sarah orders an iced-tea at a cost of 2.85. ⚫ Jin Chen sits beside Sarah at seat 2, and he is the next to open a tab; call this object variable jinsTab. ⚫ Jin chooses a milkshake, at a cost of 5.50. • Ella Paul, who sits across from Mike at seat 7, also opens a tab; call this object variable ellasTab. • Ella orders an orange juice for herself for 2.75, and then orders a salad for 7.50. (Use two separate statements, one for each purchase.) • Sarah then orders the stir-fry, which costs 15.50. . Jin decides to order a plate of nachos; this costs 12.75. • Mike is really hungry so he orders the calamari appetizer for 8.75 and a burger, which costs 13.45. (Use two separate statements, one for each purchase.) ⚫ After Ella finishes her salad she is still hungry so she orders pie for dessert for 4.75. Next, for each of the four Tab objects print out the member's name, the seat number, and the current total amount owing. Suppose Mike wishes to leave a 20% tip. Sarah, feeling slightly less generous, wishes to leave an 18% tip. Jin and Ella both opt to leave 16% tips. Make the appropriate method calls to retrieve the tip amounts for each patron. Print out each of these tip amounts. (Aside: You do NOT need to worry about displaying the tip amounts with exactly 2 decimal digits.) NOTE: In this driver program, be sure to label all of your output so the meanings of the values are clear. (i.e. Don't just print out numbers without explaining what they represent.) You do NOT need to worry about displaying the monetary amounts with exactly 2 decimal digits. Part C Add a javadoc comment to the top of your Friends Meetup class. Include a one- line description of the class as well as the author information (using the @author tag). Add proper javadoc comments to your Tab class as well. For Tab, you should include a comment for the class, as well as a comment for each instance variable and method. The javadoc comment for the class should include an @author tag. Within the javadoc comment for each method, include @param tag(s) if the method has any parameters, as well as an @return tag if there is anything being returned from the method. Run the javadoc utility on your Tab.java file. Recall that, by default, author information and everything that is private is ignored by javadoc. To include this information, you must turn on the appropriate switches by doing this: javadoc -author private Tab.java Do this and then open the resulting Tab.html file in a browser. If you notice any problems with the documentation, go back and fix your javadoc comments and rerun javadoc on your file. Once this question is complete... Create a file containing the output of Friends Meetup: name this file As2Q2Output.txt. When you create the zip archive for this assignment, you will include this output file, as well as the source code (i.e. the Tab.java and Friends Meetup.java files) and the documentation files that were generated when you ran javadoc on Tab.java. (Aside: In addition to the Tab.html file, the javadoc utility created a number of other files and folders. These are used to provide structure/formatting to the documentation. All of those files & folders should be included in the zip file that you submit for this assignment.) Add appropriate headings to your report document for this assignment. Copy & paste into your report the complete source code (the Tab.java and Friends Meetup.java files) and the output. The documentation files that were created when you ran the javadoc utility do not need to be included in your assignment report. (They will only be in the .zip archive.) ii. an archive file (.zip) that contains your Java source code and output for this assignment, as well as the files that were produced by running the javadoc utility on Tab.java in Question II. Make sure that your archive includes all.java files (in case the marker wishes to compile & run your code to test it), both of the output files (with the correct filenames), and all of the files & folders that were created by the javadoc utility. You should not include the report document or the .class files in your archive. This archive should be submitted as a single file to the appropriate submission folder on Desire2Learn. Note: Please name this archive file as follows: YourName_As2_Archive.zip I. Following Javadoc Comments: Part A The "shell" for a Car.java class is available in Desire2Learn. The car.java file is inside a .zip file that is posted there. Download that .zip file and extract the contents to save a copy of Car.java. The Car.java file that we have provided includes javadoc comments that explain what code is to be added. There is a javadoc comment for the class itself, as well as a javadoc comment for each instance variable and method. Read these comments carefully, and fill in the missing code (in the proper locations within the file). Implement the car class as it has been described in the javadoc comments. Aside from filling in your name & student number beside the @author tag, you are NOT permitted to alter the comments in any way. Also, include only those instance variables and methods that have been described in the comments; no other instance variables or methods should be added. I. Following Javadoc Comments: Part A The "shell" for a Car.java class is available in Desire2Learn. The car.java file is inside a .zip file that is posted there. Download that .zip file and extract the contents to save a copy of Car.java. The Car.java file that we have provided includes javadoc comments that explain what code is to be added. There is a javadoc comment for the class itself, as well as a javadoc comment for each instance variable and method. Read these comments carefully, and fill in the missing code (in the proper locations within the file). Implement the car class as it has been described in the javadoc comments. Aside from filling in your name & student number beside the @author tag, you are NOT permitted to alter the comments in any way. Also, include only those instance variables and methods that have been described in the comments; no other instance variables or methods should be added. When printing output, make sure that the information is easy to read. Make it clear which information belongs to each car and include appropriate labels. (Remember, whitespace can help with formatting & readability.) Be sure to add a javadoc comment to the top of your CarTestDriver class; include the @author tag (with your name & student number). Once this first question is complete... Create a file containing the output of CarTest Driver (as you did in Lab #2, using redirection at the command line); name this file As2Q1Output.txt. When you later create the .zip archive for this assignment, you will include this output file, as well as the source code for Part A & Part B (i.e. the car.java and CarTestDriver.java files.) Add appropriate headings to your report document for this assignment. Copy & paste into your report the complete source code (the Car.java and CarTestDriver.java files) and the output. II. Creating an Application from Scratch: Part A A local golf course has a clubhouse with a restaurant and bar that members of the club may visit. Any food or drinks that a member orders there are added to a tab, which means that the cost of each of the items ordered is simply added to a running total that the member will pay when they leave the clubhouse at the end of their visit. Write a Java class named Tab that can be used to create & work with Tab objects. For each Tab, we need to keep track of the name of the member who is running the tab (e.g. "Stewart MacDonald"), their seat number (e.g. 12), as well as the total amount owing (which is always 0.00 when the tab is first created when they enter the clubhouse). In the Tab class, include three instance variables and one constructor. The constructor should initialize the instance variables. Provide three simple accessor methods: one to retrieve the member's name, one to retrieve the seat number, and one to retrieve the total amount for all of the charges that have been added to the tab so far. Provide a mutator method that adds the price of a requested menu item to the member's tab. The price of the menu item is passed in through a parameter. (Aside: You may assume that all taxes are already included in the menu prices.) Include one more accessor method that will calculate and return a tip amount when given a percentage. For example, if the patron's current tab was 22.50, and they wanted to leave an 18% tip, the tip amount would be 4.05. This method will accept the percentage as a parameter (e.g. 0.18 for 18%) and return the tip amount. Part B Side note: There are details included in the scenario that is described below that are not needed for the code that you will write. (These details are simply included to help tell the story.) Do not add extra fields or methods to the Tab class (other than those that were mentioned in Part A). Scenario: A group of friends are members of this golf club. They haven't seen one another much over the summer, so they decide to meet up at the clubhouse to share a meal and catch up. Everyone is paying separately so each person will have their own tab. Write and test a Friends Meetup class. This class will serve as a driver program for Part A and should be saved in the same folder as the Tab class. In the main method of the Friends Meetup class, include statements to support the following (in this order): ⚫ Mike Smith arrives first. He decides to sit at seat 3 and opens a tab. Create a Tab object called mikesTab. • Mike orders a Coke, which costs 2.50. • Sarah Jones, who wants to sit at the end in seat 1, opens a tab; call this object variable sarahsTab. • Sarah orders an iced-tea at a cost of 2.85. ⚫ Jin Chen sits beside Sarah at seat 2, and he is the next to open a tab; call this object variable jinsTab. ⚫ Jin chooses a milkshake, at a cost of 5.50. • Ella Paul, who sits across from Mike at seat 7, also opens a tab; call this object variable ellasTab. • Ella orders an orange juice for herself for 2.75, and then orders a salad for 7.50. (Use two separate statements, one for each purchase.) • Sarah then orders the stir-fry, which costs 15.50. . Jin decides to order a plate of nachos; this costs 12.75. • Mike is really hungry so he orders the calamari appetizer for 8.75 and a burger, which costs 13.45. (Use two separate statements, one for each purchase.) ⚫ After Ella finishes her salad she is still hungry so she orders pie for dessert for 4.75. Next, for each of the four Tab objects print out the member's name, the seat number, and the current total amount owing. Suppose Mike wishes to leave a 20% tip. Sarah, feeling slightly less generous, wishes to leave an 18% tip. Jin and Ella both opt to leave 16% tips. Make the appropriate method calls to retrieve the tip amounts for each patron. Print out each of these tip amounts. (Aside: You do NOT need to worry about displaying the tip amounts with exactly 2 decimal digits.) NOTE: In this driver program, be sure to label all of your output so the meanings of the values are clear. (i.e. Don't just print out numbers without explaining what they represent.) You do NOT need to worry about displaying the monetary amounts with exactly 2 decimal digits. Part C Add a javadoc comment to the top of your Friends Meetup class. Include a one- line description of the class as well as the author information (using the @author tag). Add proper javadoc comments to your Tab class as well. For Tab, you should include a comment for the class, as well as a comment for each instance variable and method. The javadoc comment for the class should include an @author tag. Within the javadoc comment for each method, include @param tag(s) if the method has any parameters, as well as an @return tag if there is anything being returned from the method. Run the javadoc utility on your Tab.java file. Recall that, by default, author information and everything that is private is ignored by javadoc. To include this information, you must turn on the appropriate switches by doing this: javadoc -author private Tab.java Do this and then open the resulting Tab.html file in a browser. If you notice any problems with the documentation, go back and fix your javadoc comments and rerun javadoc on your file. Once this question is complete... Create a file containing the output of Friends Meetup: name this file As2Q2Output.txt. When you create the zip archive for this assignment, you will include this output file, as well as the source code (i.e. the Tab.java and Friends Meetup.java files) and the documentation files that were generated when you ran javadoc on Tab.java. (Aside: In addition to the Tab.html file, the javadoc utility created a number of other files and folders. These are used to provide structure/formatting to the documentation. All of those files & folders should be included in the zip file that you submit for this assignment.) Add appropriate headings to your report document for this assignment. Copy & paste into your report the complete source code (the Tab.java and Friends Meetup.java files) and the output. The documentation files that were created when you ran the javadoc utility do not need to be included in your assignment report. (They will only be in the .zip archive.) ii. an archive file (.zip) that contains your Java source code and output for this assignment, as well as the files that were produced by running the javadoc utility on Tab.java in Question II. Make sure that your archive includes all.java files (in case the marker wishes to compile & run your code to test it), both of the output files (with the correct filenames), and all of the files & folders that were created by the javadoc utility. You should not include the report document or the .class files in your archive. This archive should be submitted as a single file to the appropriate submission folder on Desire2Learn. Note: Please name this archive file as follows: YourName_As2_Archive.zip I. Following Javadoc Comments: Part A The "shell" for a Car.java class is available in Desire2Learn. The car.java file is inside a .zip file that is posted there. Download that .zip file and extract the contents to save a copy of Car.java. The Car.java file that we have provided includes javadoc comments that explain what code is to be added. There is a javadoc comment for the class itself, as well as a javadoc comment for each instance variable and method. Read these comments carefully, and fill in the missing code (in the proper locations within the file). Implement the car class as it has been described in the javadoc comments. Aside from filling in your name & student number beside the @author tag, you are NOT permitted to alter the comments in any way. Also, include only those instance variables and methods that have been described in the comments; no other instance variables or methods should be added. I. Following Javadoc Comments: Part A The "shell" for a Car.java class is available in Desire2Learn. The car.java file is inside a .zip file that is posted there. Download that .zip file and extract the contents to save a copy of Car.java. The Car.java file that we have provided includes javadoc comments that explain what code is to be added. There is a javadoc comment for the class itself, as well as a javadoc comment for each instance variable and method. Read these comments carefully, and fill in the missing code (in the proper locations within the file). Implement the car class as it has been described in the javadoc comments. Aside from filling in your name & student number beside the @author tag, you are NOT permitted to alter the comments in any way. Also, include only those instance variables and methods that have been described in the comments; no other instance variables or methods should be added. When printing output, make sure that the information is easy to read. Make it clear which information belongs to each car and include appropriate labels. (Remember, whitespace can help with formatting & readability.) Be sure to add a javadoc comment to the top of your CarTestDriver class; include the @author tag (with your name & student number). Once this first question is complete... Create a file containing the output of CarTest Driver (as you did in Lab #2, using redirection at the command line); name this file As2Q1Output.txt. When you later create the .zip archive for this assignment, you will include this output file, as well as the source code for Part A & Part B (i.e. the car.java and CarTestDriver.java files.) Add appropriate headings to your report document for this assignment. Copy & paste into your report the complete source code (the Car.java and CarTestDriver.java files) and the output. II. Creating an Application from Scratch: Part A A local golf course has a clubhouse with a restaurant and bar that members of the club may visit. Any food or drinks that a member orders there are added to a tab, which means that the cost of each of the items ordered is simply added to a running total that the member will pay when they leave the clubhouse at the end of their visit. Write a Java class named Tab that can be used to create & work with Tab objects. For each Tab, we need to keep track of the name of the member who is running the tab (e.g. "Stewart MacDonald"), their seat number (e.g. 12), as well as the total amount owing (which is always 0.00 when the tab is first created when they enter the clubhouse). In the Tab class, include three instance variables and one constructor. The constructor should initialize the instance variables. Provide three simple accessor methods: one to retrieve the member's name, one to retrieve the seat number, and one to retrieve the total amount for all of the charges that have been added to the tab so far. Provide a mutator method that adds the price of a requested menu item to the member's tab. The price of the menu item is passed in through a parameter. (Aside: You may assume that all taxes are already included in the menu prices.) Include one more accessor method that will calculate and return a tip amount when given a percentage. For example, if the patron's current tab was 22.50, and they wanted to leave an 18% tip, the tip amount would be 4.05. This method will accept the percentage as a parameter (e.g. 0.18 for 18%) and return the tip amount. Part B Side note: There are details included in the scenario that is described below that are not needed for the code that you will write. (These details are simply included to help tell the story.) Do not add extra fields or methods to the Tab class (other than those that were mentioned in Part A). Scenario: A group of friends are members of this golf club. They haven't seen one another much over the summer, so they decide to meet up at the clubhouse to share a meal and catch up. Everyone is paying separately so each person will have their own tab. Write and test a Friends Meetup class. This class will serve as a driver program for Part A and should be saved in the same folder as the Tab class. In the main method of the Friends Meetup class, include statements to support the following (in this order): ⚫ Mike Smith arrives first. He decides to sit at seat 3 and opens a tab. Create a Tab object called mikesTab. • Mike orders a Coke, which costs 2.50. • Sarah Jones, who wants to sit at the end in seat 1, opens a tab; call this object variable sarahsTab. • Sarah orders an iced-tea at a cost of 2.85. ⚫ Jin Chen sits beside Sarah at seat 2, and he is the next to open a tab; call this object variable jinsTab. ⚫ Jin chooses a milkshake, at a cost of 5.50. • Ella Paul, who sits across from Mike at seat 7, also opens a tab; call this object variable ellasTab. • Ella orders an orange juice for herself for 2.75, and then orders a salad for 7.50. (Use two separate statements, one for each purchase.) • Sarah then orders the stir-fry, which costs 15.50. . Jin decides to order a plate of nachos; this costs 12.75. • Mike is really hungry so he orders the calamari appetizer for 8.75 and a burger, which costs 13.45. (Use two separate statements, one for each purchase.) ⚫ After Ella finishes her salad she is still hungry so she orders pie for dessert for 4.75. Next, for each of the four Tab objects print out the member's name, the seat number, and the current total amount owing. Suppose Mike wishes to leave a 20% tip. Sarah, feeling slightly less generous, wishes to leave an 18% tip. Jin and Ella both opt to leave 16% tips. Make the appropriate method calls to retrieve the tip amounts for each patron. Print out each of these tip amounts. (Aside: You do NOT need to worry about displaying the tip amounts with exactly 2 decimal digits.) NOTE: In this driver program, be sure to label all of your output so the meanings of the values are clear. (i.e. Don't just print out numbers without explaining what they represent.) You do NOT need to worry about displaying the monetary amounts with exactly 2 decimal digits. Part C Add a javadoc comment to the top of your Friends Meetup class. Include a one- line description of the class as well as the author information (using the @author tag). Add proper javadoc comments to your Tab class as well. For Tab, you should include a comment for the class, as well as a comment for each instance variable and method. The javadoc comment for the class should include an @author tag. Within the javadoc comment for each method, include @param tag(s) if the method has any parameters, as well as an @return tag if there is anything being returned from the method. Run the javadoc utility on your Tab.java file. Recall that, by default, author information and everything that is private is ignored by javadoc. To include this information, you must turn on the appropriate switches by doing this: javadoc -author private Tab.java Do this and then open the resulting Tab.html file in a browser. If you notice any problems with the documentation, go back and fix your javadoc comments and rerun javadoc on your file. Once this question is complete... Create a file containing the output of Friends Meetup: name this file As2Q2Output.txt. When you create the zip archive for this assignment, you will include this output file, as well as the source code (i.e. the Tab.java and Friends Meetup.java files) and the documentation files that were generated when you ran javadoc on Tab.java. (Aside: In addition to the Tab.html file, the javadoc utility created a number of other files and folders. These are used to provide structure/formatting to the documentation. All of those files & folders should be included in the zip file that you submit for this assignment.) Add appropriate headings to your report document for this assignment. Copy & paste into your report the complete source code (the Tab.java and Friends Meetup.java files) and the output. The documentation files that were created when you ran the javadoc utility do not need to be included in your assignment report. (They will only be in the .zip archive.) ii. an archive file (.zip) that contains your Java source code and output for this assignment, as well as the files that were produced by running the javadoc utility on Tab.java in Question II. Make sure that your archive includes all.java files (in case the marker wishes to compile & run your code to test it), both of the output files (with the correct filenames), and all of the files & folders that were created by the javadoc utility. You should not include the report document or the .class files in your archive. This archive should be submitted as a single file to the appropriate submission folder on Desire2Learn. Note: Please name this archive file as follows: YourName_As2_Archive.zip
Expert Answer:
Answer rating: 100% (QA)
Heres how you can implement them Part A Carjava Part ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
Part A Light has both a wave and a particle nature. Particles have a wave nature as well, and therefore All particles decay with a certain characteristic lifetime. Their position can not be specified...
-
Torrance Technology Company (TTC) is developing a new touchscreen smartphone to compete in the cellular phone industry. The company will sell the phones at wholesale prices to cell phone companies,...
-
Determine which sets of vectors are orthogonal. 5 -4 0 3 -4 1 -3 8 33 3 5 -1
-
For the following products and countries, identify the type of warehouse that should be used as well as the method of transportation that should deliver the product to end users. Using the Internet,...
-
1. Matthew Paul of Sisseton, South Dakota, is single and has been working as an admissions counselor at a university for five years. Matthew owns a home valued at $156,000 on which he owes $135,000....
-
What type of cost does not change with changes in production volume?
-
1) What is the justification for the usage of the allowance method as contrasted with the direct write-off method of accounting for bad debts? 2) Discuss and explain three reasons why a company may...
-
Given 1 Astronomical Unit (AU)= 1.5x10 8 m. A planet is 5.2 AU away from the sun. How far is the planet from the sun in meters.
-
The World Bank records the prevalence of HIV in countries around the world. According to their data, "Prevalence of HIV refers to the percentage of people ages 15 to 49 who are infected with HIV." In...
-
Calculate the instantaneous and longtime deflection (time limit of 5 years) of a 40ft span simply supported beam (fc = 4 ksi, fy = 60 ksi,) W =3k/ft W =7k/ft PL=15k P =10k 40" 2.5" 3-#9 24" 20.5"...
-
Problem 2 (10 pts): For a given directed acyclic graph, find all longest paths from V, to V, and indicate all active edges (=arcs) in this graph (in the sense of our discussion on October 12). 3 2 V4...
-
The demand for Oman Food company is 45000 units daily. In the past they had faced a lot of issues related with ordering and carrying cost. Mr. Mohammed has joined this company recently and gave a...
-
Bank of Vancouver pays 7 percent simple interest on its savings account balances, whereas Bank of Calgary pays 7 percent interest compounded annually. If you made a $6,000 deposit in each bank, how...
-
U.S. households have become smaller over the years. The following table from the 2010 GSS contains information on the number of people currently aged 18 years or older living in a respondent's...
-
Jim is fired from his job as a waiter and decides to take an extended trip to Europe. After touring Europe for 3 months, Jim returns to look for a new job as a waiter. Are his job-hunting expenses...
-
John Fuji (age 37) moved from California to Washington in December 2011. He lives at 468 Cameo Street, Yakima, WA 98901. John's Social Security number is 571-78-5974 and he is single. His earnings...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Explain the effect of each of these on the shape and position of the countrys production-possibility curve: a. A proportionate increase in the total supplies (endowments) of all factors of...
-
Why does the HeckscherOhlin theory predict that most research and development (R&D) activity is done in the industrialized countries?
-
A free-trade equilibrium exists in which the United States exports machinery and imports clothing from the rest of the world. The goods are produced with two factors: capital and labor. The trade...
Study smarter with the SolutionInn App