Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Purpose: To learn how to code multiple methods and have the main() call these methods within the same application program. Dividing the work a program

image text in transcribed

image text in transcribed

Purpose: To learn how to code multiple methods and have the main() call these methods within the same application program. Dividing the work a program has to complete into methods makes the program more efficient, easier to maintain, and debug. The code within a method should support a task or function. These methods will all be parameterless (empty parentheses) and void (return nothing) Prep Work: Read chapter 5 and your instructor's PowerPoint slides. Refer in particular to slide 5 on how to code the methods headers and slide 10 on how to code class-level variables (fields) that can be accessed by all the methods in a class. Lab Exercise 5.1 Instructions: Use the Dental program you created for LE 1.2. Rename the program to DentalYourLastNameFirstinitialLE51 java. In the program create 4 additional methods. The main) will call these methods in the order listed. Name and code the methods as follows: 1. setGroupPolicyNo(): This method prompts the user for the dental group policy number 2. setNolnsured): This method prompts for the number of people to be insured. 3. calcDentalCost(): This method calculates the total cost of the dental policy assuming an average cost of $40.00 per person with a 5% discount if the number insured is 1000 or more. 4. displayPolicylnfo(): This method prints the group policy number, the total number insured, and the total cost of the dental coverage for Wayne's Body Shop 5. Refer to attached sample output. Grading Requirements: During lab class, enter your name on the sign-up sheet for grading when your assignment is in gradable condition. Files Posted with Instructions LE 5.1 SAMPLE OUTPUT pdf o Test your program using all the data and scenarios in the sample output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Web Database Development Step By Step

Authors: Jim Buyens

1st Edition

0735609667, 978-0735609662

More Books

Students also viewed these Databases questions

Question

Was there an effort to involve the appropriate people?

Answered: 1 week ago