In the PilotLicense class, declare the following private fields: integer year integer fee integer id and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In the PilotLicense class, declare the following private fields: integer year integer fee integer id and define the following public methods: • getYear() has no parameters and returns the year field. • getFee() has no parameters and returns the fee field. getid) has no parameters and returns the id field. Ex: If the input is 2016 6 683, then the output is: License year: 2016 License fee: 6 License id: 683 Note: If a field is not properly declared as private, an error message will be output. PilotLicense.java PilotLicenselnfo.java public class PilotLicense { /*Your code goes here */ public void setYear(int newYear) { year = newYear; } public void setFee(int newFee) { fee = newFee; } public void setld(int newld) { id = newld; } } import java.util.Scanner; public class PilotLicenselnfo { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); PilotLicense pilot1 = new PilotLicense(); int input Year; int inputFee; int inputld; input Year = scnr.nextInt(); inputFee = scnr.nextInt(); inputld = scnr.nextInt(); pilot1.set Year(input Year); pilot1.setFee(inputFee); pilot1.setId(inputld); System.out.println("License year: " + pilot1.getYear(); System.out.println("License fee: " + pilot1.getFee()); System.out.println("License id: " + pilot1.getld(); In the PilotLicense class, declare the following private fields: integer year integer fee integer id and define the following public methods: • getYear() has no parameters and returns the year field. • getFee() has no parameters and returns the fee field. getid) has no parameters and returns the id field. Ex: If the input is 2016 6 683, then the output is: License year: 2016 License fee: 6 License id: 683 Note: If a field is not properly declared as private, an error message will be output. PilotLicense.java PilotLicenselnfo.java public class PilotLicense { /*Your code goes here */ public void setYear(int newYear) { year = newYear; } public void setFee(int newFee) { fee = newFee; } public void setld(int newld) { id= newld; } } import java.util.Scanner; public class PilotLicenselnfo { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); PilotLicense pilot1 = new PilotLicense(); int input Year; int inputFee; int inputld; input Year = scnr.nextInt(); inputFee = scnr.nextInt(); inputld = scnr.nextInt(); pilot1.set Year(input Year); pilot1.setFee(inputFee); pilot1.setId(inputld); System.out.println("License year: " + pilot1.getYear(); System.out.println("License fee: " + pilot1.getFee()); System.out.println("License id: " + pilot1.getld(); In the PilotLicense class, declare the following private fields: integer year integer fee integer id and define the following public methods: • getYear() has no parameters and returns the year field. • getFee() has no parameters and returns the fee field. getid) has no parameters and returns the id field. Ex: If the input is 2016 6 683, then the output is: License year: 2016 License fee: 6 License id: 683 Note: If a field is not properly declared as private, an error message will be output. PilotLicense.java PilotLicenselnfo.java public class PilotLicense { /*Your code goes here */ public void setYear(int newYear) { year = newYear; } public void setFee(int newFee) { fee = newFee; } public void setld(int newld) { id = newld; } } import java.util.Scanner; public class PilotLicenselnfo { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); PilotLicense pilot1 = new PilotLicense(); int input Year; int inputFee; int inputld; input Year = scnr.nextInt(); inputFee = scnr.nextInt(); inputld = scnr.nextInt(); pilot1.set Year(input Year); pilot1.setFee(inputFee); pilot1.setId(inputld); System.out.println("License year: " + pilot1.getYear(); System.out.println("License fee: " + pilot1.getFee()); System.out.println("License id: " + pilot1.getld(); In the PilotLicense class, declare the following private fields: integer year integer fee integer id and define the following public methods: • getYear() has no parameters and returns the year field. • getFee() has no parameters and returns the fee field. getid) has no parameters and returns the id field. Ex: If the input is 2016 6 683, then the output is: License year: 2016 License fee: 6 License id: 683 Note: If a field is not properly declared as private, an error message will be output. PilotLicense.java PilotLicenselnfo.java public class PilotLicense { /*Your code goes here */ public void setYear(int newYear) { year = newYear; } public void setFee(int newFee) { fee = newFee; } public void setld(int newld) { id= newld; } } import java.util.Scanner; public class PilotLicenselnfo { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); PilotLicense pilot1 = new PilotLicense(); int input Year; int inputFee; int inputld; input Year = scnr.nextInt(); inputFee = scnr.nextInt(); inputld = scnr.nextInt(); pilot1.set Year(input Year); pilot1.setFee(inputFee); pilot1.setId(inputld); System.out.println("License year: " + pilot1.getYear(); System.out.println("License fee: " + pilot1.getFee()); System.out.println("License id: " + pilot1.getld();
Expert Answer:
Answer rating: 100% (QA)
public class Main public static void mainString args int ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
7. Find the value of indicated registers for each line of the following program. The original Value of SP is assumed to be FFEE. 1368:0100 B8B1A0 MOV AXA0B1 AX 1368:0103 BB3300 MOV BX,0033 BX...
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
In this assignment, you will create a program that allows theuser to draw in a window using brushes of different sizes andcolors. The user will be able to change the size and color of thebrush using...
-
From The Secret: "The secret is great leaders SERVE." "Am I a self-serving leader or a serving leader?" How can you be a serving leader in your current position as an employee, student, or team...
-
What international transactions are included in the current account? What does the capital account include? What are the credit and the debit transactions in the current and capital accounts? What is...
-
AS AN IMMIGRATION CASE MANAGER 1. What was the most important thing you learned from your practicum? 2. What was the most important thing you learned from your supervisor or the company in general?...
-
Many consumers are attracted to name brands because they are recognized through advertising. However, generic or store brands have become popular alternatives. Write About It Write a paragraph...
-
The differences between the book basis and tax basis of the assets and liabilities of Castle Corporation at the end of 2008 are presented below. It is estimated that the litigation liability will be...
-
5. The monthly sales for Telco Batteries, Inc., were as follows in Table 1: Table 1: Monthly Sales MONTH SALES January 10 February 14 March 15 April 14 May 12 June 10 July 14 August 18 September 20...
-
1. Based on prior experience, GBI estimates that approximately % of the net credit sales (gross credit sales minus returns of credit sales) for the month will become bad debt. GBI writes off bad...
-
An Australian importing company will make a payment of 3,500,000 NZD in 3 months time. The firm buys NZD forward to hedge this exposure. Current spot: 1.040/ 1.045 AUD/NZD 3 month forward rate:...
-
How is the frequency of the solution of Duffing's equation affected by the nature of the spring?
-
What is the source of nonlinearity in Duffing's equation?
-
True or False. Nonlinearity can be introduced into the governing differential equation through mass, springs, and/or dampers.
-
Give two examples of physical phenomena that can be represented by van der Pol's equation.
-
What is a limit cycle?
-
Jovan wants to convince his audience with his persuasive speech to integrate yoga into their daily lives to help manage stress, and increase balance and strength. He states, I can say with complete...
-
What key concerns must functional tactics address in marketing? Finance? POM? Personnel?
-
When a parent class contains a static method, child classes ____________ override it. a. Frequently b. Seldom c. Must d. Cannot
-
The statement jframe myframe = new jframe(); creates a jframe that is ____________. A. Invisible and has a title B. Invisible and has no title C. Visible and has a title D. Visible and has no title
-
Sammys Seashore Supplies rents beach equipment to tourists. In previous chapters, you developed a class that holds equipment rental information and an application that tests the methods using three...
-
Elianne Vinas owns Vinas Shoe Company. She is contemplating the purchase of a cutting machine that would be used to make shoes in her factory. The following estimates are available: Required:...
-
Paola Grillon owns Grillon Skin Care Products. She is contemplating the purchase of an industrial mixer that would be used to mix cosmetics in her factory. The following estimates are available:...
-
Penny Williams is contemplating the purchase of a new computer system for her company, Williams Manufacturing. She has made the following estimates: Required: a. Determine the internal rate of return...
Study smarter with the SolutionInn App