Question: Special Note Use NetBeans IDE as tool to write the Java code. Using Command-line as the proper interface ( CLI ) Create a Student object

Special Note

  • Use NetBeans IDE as tool to write the Java code.
  • Using Command-line as the proper interface (CLI)
  • Create a Student object (Student.java) class that requires the following to make a new object with the required parameters:
    • Year in school (Integer [1,2, 3, 4, 5, etc.])
    • Major (String [CIS, TIM, etc.)
    • GPA (Double [2.5])
  • Overload the constructor to allow for other objects to be created if:
    • Only Year and Major (0.0 for GPA)
    • Only Year (UND for Major, 0.0 for GPA)
  • Use the YouDoIt (pp. 203-205) CarInsurancePolicy.java and CreatePolicies.java as a guide (code also in the attachments).
  • No need to Scanner user entry. Just create three objects and output the results via code. Much like the CarInsurance Example.
  • Finally, take a screenshot of your CLI output and then submit it along with your zipped NetBeans project folder of this exercise to e-Learning.

>>>>>>> note I have attached pages(203-205 ) on one photo for example

Special Note Use NetBeans IDE as tool to write the Java code.

(continued You Do It 5. Add a displayO method that outputs all the insurance policy data Creating Overioaded Constructors public void displayO h this section, you create a class with overloaded constructors and demonstrate how Systan . out-Printin('Policy #. policylubar + ". " + they work. nunPayments+"paymants annually. Driver rasidas in + rasidentCity . (continued 1. Open anew file in your text editor, and start the CarinsurancaPolicy class as follows. The class contains three fields that hold a policy number, the number of payments the pclicyholder will make anually, and the policyholder's city of 10. Add a fourth declaration to the CreatePolicias class that attermpts to create 6. Add a closing curly brace for the class. Save the file as a CarInsurancePolicy object using a default constructor CarInsurancePolicy fourth -now CarInsurancaPolicyO: 7. Open a new text file to create a short application that demonstrates the 11. Save and compile the revised CreatePolicies program. The class does not public class CarInsurancePolicy private int policyNunber: private int munPaynants; private String residentCity constructors at work. The application declares three CarinsurancePolicy objects using a different constructor version each time. Type the following code: comple because the CarInsurancePolicy class does not contain a defaut constructor. Change the newty added declaration to a commentcomple the class again, and observe that the class now compiles correcty. public class CreataPolicias lic static void main(Stringl] args) Exarmining Prewritten Overloaded Methods 2. Create a constructor that requires parameters for all three data fields public Car InsurancaPolicyCint nus, int payments, String city) CarInsurancaPolicy first now Car InsurancaPolicyC123); CarInsurancaPolicy sacond-now CarInsurancaPolicy(456, 4) CarInsurancePolicy third now CarInsurancePolicy h this section, you examine some builtin classes and recogrize their correcty overloaded methods. pol icyNunber nun (789. 12, Nowcastle") 1. Using a Web browser, go to the Java Web site at www.oracle.com/ res idantCity - city: and select Java APIls and Java SE 8 8. Display each object, and add closing curly braces for the method and the class: 2. Using the alphabetical ist of classes, find the PrintStroan class, and select it. first.displayO: sacond.displayO: third.displayo 3. Suppose the agency that sells car insurance policies is in the city of Mayfield. Create a two-parameter constructor that requires only a policy number and the number of payments. This constructor assigns Mayfield to residentCity public CarInsurancaPolicyCint nun, int paymonts) 3. Examine the list of constructors for the class, and notice that each version 4. Examine the list of methods named printO and print 1nO. Notice that each 5. Using the alphabetical ist of classes, find the 30ptionPane class, and select it has a unique parameter ist 9. Save the file as CreatePolicies.java, and then compile and test the program overloaded version has a unique parameter list pol icyNunber nus The output appears in Figure 423 rasidentCity "Mayfield": 6. Examine the list of constructors for the class, and notice that each version has a unique parameter ist 4. Add a third constructor that requires only a poicy number parameter. This 7. Examine the ist of methods named showConfiraDialogO and constructor uses the default values of two annual payments and Maytield as the resident city. Later in this chapter, you will learn how to eliminate the duplicated assignments in these constructors.) peysents annaelly, Driver res ides in Mayf ield showInputDialogO. Notice that each overloaded version has a unique parameter list iey 18912 pegnento anna1ly. Driver resides in Newoastle 1ic CarInsurancaPolicyCint num) policyNumber-nu residentCity "Mayfield": Figure 4-23 Output of the CreataPolicias program (continues

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!