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...
-
In Prob. 15.41, determine (a) The velocity of point O, (b) The point of the disk with zero velocity. 14hPa) + 1" (Pay=Px 600 mm A $1(a)=1
-
Kathryns sample consists of patients at a psychiatric clinic. In the clinic population, 40% of patients have depression, 28% have anxiety disorders, 15% have eating disorders, 10% have intellectual...
-
Pew Research Center collected data on the same 10 political value questions from 1994 to 2014 and combines these responses to place each person on a scale ranging from consistently liberal to...
-
Leisure is an inferior good for Horace. a. Use indifference curves to show the income and substitution effects of an increase in Horaces wage rate. b. Could Horaces labor supply curve be...
-
What did they do to accelerate analysis and results in general electric case?
-
The Brady & Matthew Camera Company has just come out with their newest professional quality digital camera, the ToughPix1. The company is selling this camera only through its new mobile app at a...
-
Lewis Incorporated reports the following annual budget and the actual results for Products A, B and C for fiscal year, 2021: Product A Product B Product C Product A Product B Product C Selling Price...
-
You stand 17.5 m from a wall holding a rock. You throw the rock at the wall at an angle of 22.5 degrees from the ground with an initial speed of 20.5 m/s. At what height y above its initial position...
-
A line charge with charge density = +35 C/m lies along the central axis of a thin, charged cylindrical shell with radius R = 17 cm. At a distance r = 45 cm from the central axis, the electric field...
-
Suppose you went to Walmart or a grocery store with the intention of building a capacitor out of materials you buy there. What would you buy, how would you construct the capacitor, and show a...
-
Emma is roller skating, skating over a 0 . 9 - m - tall hill. Assuming that she is moving at a speed of 4 . 1 m / s at the top of the peak, what is her speed when she reaches level ground at 0 m ?...
-
All employees of Basic Company are covered by a group hospitalization insurance plan, but the employees must pay the premiums ($8,000 for each employee). None of the employees has sufficient medical...
-
40. Label the components of the cardiac conduction system Right bundle. branch AV node Left bundle branch Interventricular septum Interatnal branch SA node Reset Zoom AV bundle Interatrial septum...
-
Coastal Refining Company operates a refinery with a distillation capacity of 12,000 barrels per day. As a new member of Coastal's management team, you have been given the task of developing a...
-
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...
-
Can the displacement of a persons trip be zero, yet the distance involved in the trip is nonzero? How about the reverse situation? Explain.
-
An object traveling at a constant velocity vo experiences a constant acceleration in the same direction for a period of time t. Then an acceleration of equal magnitude is experienced in the opposite...
-
You are told that a person has walked 750 m. What can you safely say about the persons final position relative to the starting point?
Study smarter with the SolutionInn App