Java Programming : Java Parameters, Constants, Variables, Black, and Scope 'Java has many built-in features that allow for easier programming. Two of...
This question has been answered
Question

Java Programming : Java Parameters, Constants, Variables, Black, and Scope

"Java has many built-in features that allow for easier programming. Two of these features are the Math methods class and the String Builder class. These classes are useful because they provide prewritten constants and methods to utilize when writing your own code. For instance, if you need to identify the larger of two numbers, the Math methods class can perform that operation. If you need to test whether a character is uppercase or lowercase, the String Builder class is useful. These are just two examples of the many operations that the Math methods and String Builder classes provide. You can explore additional operations as you continue to practice writing Java code. You will write Java program that includes numeric and string input and output parameters. As you work through the program, you will utilize constants and variables to demonstrate the concepts of code blocks and scope."


***How to create Automobile class for a dealership to keep the auto inventory current. Include fields for an ID number, model, color, year, and miles per gallon. Include get and set methods for each field.

***In the set methods, code the values validations as follows:

Do not allow the ID to be negative or more than 9999. If it is, set the ID to 0.

Do not allow the year to be earlier than 2005 or later than 2021. If it is, set the year to 0.

Do not allow the miles per gallon to be less than 10 and more than 60. If it is, set the miles per gallon to 0.


Include a constructor that accepts arguments for each field and assign their values to the parameters passed (call the set methods for each field within that constructor).

Please, help me to write the application driver class TestAutomobiles, which has three methods:

  • create-Automobile() method, which is the void method (will not accept any parameters), but will create & return the Automobile object with the fields to be set from the user's inputs. Within this method: first, create object of the Automobile class making use of the Automobile class constructor and pass to that constructor the user inputs for each object field. You might accept the user inputs first and store the data in proper variables. Include the proper prompts for a user to enter data for each field. Then, when the user's data is stored in the proper variables - call Automobile constructor passing the input data values to the Automobile object being created.

*** The void display-Automobile(Automobile new-Automobile) method, which will accept an Automobile object as a parameter, calls the get methods of that object to determine each field value and displays these fields values. You can use command line interface or J0ptionPane to display the fields values.

***The main (...) method

Here you will create two Automobile objects, one after another, by calling the create-Automobile() method twice. Each time you call the create-Auto-mobile() method and that method will be processed with user inputs asked for and provided for each Automobile object fields. Then the Automobile object with these fields values will be created. That object will be returned to the main method for display.


After these two Automobile objects are created - call display_Automobile(Automobile oneAutomobile) twice, once for each of the two Automobile objects created, and display each of two automobile field values.


Make your application user-friendly. When the application starts, display a welcome message explaining what a user will be doing next in this application.


In the main method, you may also declare and use the StringBuilder class to accumulate and format the final output of the application in a table of two Automobile objects.

Answered by Expert Tutors

a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac,

gue

facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, d

gue

gue

gue

gue

ipiscing elit.

gue

gue

itur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing eli

gue

gue

gue

gue vel laoreet ac,

gue

gue

ur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pul

gue

gue

gue

gue

Step-by-step explanation

e ve

gue

gue

sum do

gue

gue

at, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoree

gue

gue

gue

ipsum dolo

gue

16418895
16418896
16418966
16418965

4 Attachments
Screenshot_1.png
png
Screenshot_2.png
png
Screenshot_3.png
png
Screenshot_5.png
png
The student who asked this found it Helpful
Overall rating 100%
Other answer

inia pulvinar tortor nec faci

ng elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam l
Step-by-step explanation

ec facilisis. Pellentesque dap

ultrices ac magna. Fusce dui lectus, congue v

ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pell

, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit a

inia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus

at, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vita

Donec

o

molestie consequat

acinia pulvinar tortor nec facilisis. Pellentesque dapibus eff

e vel laoreet ac, dictum vitae odio. Donec aliquet. Lo

gue

, dictum vitae odio. Donec aliquet. Lorem ipsum

nec facilisis. Pellentesque dapibus efficitur laoree

ac, dictum vitae odio. Donec aliquet. Lorem ipsum

, consectetur adipiscing elit. Nam lac

dictum vit

entesque dapibus efficitur laoreet. Nam risu

icitur laoreet. Nam risus ante, dapibu

dictum vit

a molestie consequat, ultrices ac magna

itur laoreet. Nam risus ante, dapibus a molestie

ac, dictum vitae odio. Donec aliquet. Lorem ipsum

dictum vitae odio. Donec aliquet.

dictum vit

lestie consequat, ultrices ac magna. Fusce dui lectu

s ante, dapibus a molestie consequat, ultrice

dictum vit

lestie consequat, ultrices ac magna. Fusce dui lectus, con

at, ultrices ac magna. Fusce dui lectus, congue vel la

sus ante, dapibus a molestie consequat, ultrices ac magna. Fus

ce dui lectus, congue vel laoreet ac, dictum

dictum vit

acinia pulvinar tortor nec facilisis. Pel

cing elit. Nam lacinia pulvinar tortor

dictum vit

m risus ante, dapibus a molestie consequat

, consectetur adipiscing elit. Nam

dictum vit

fficitur laoreet. Nam risus ante, dapibus a

m ipsum dolor sit amet, consectetur ad

dictum vit

or nec facilisis. Pellentesque dapibus efficitur l

sus ante, dapibus a molestie consequat, ultrices

ur laoreet. Nam risus ante, dapibus a moles

rem ipsum dolor sit amet, consectetur adipiscing elit.

gue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ip

sum dolor sit amet, consectetur adipiscing e

s ante, dapibus a molestie consequat, ultrice

, dictum vitae odio. Donec aliquet. Lorem ipsum

gue

a. Fusce dui lectus, congue ve

nec facilisis. Pellentesque dapib

risus ante, dapibus a molest

Donec

ongue vel laoreet ac, dic

a. Fusce dui lectus, congue vel lao

risus ante, dapibus a molest

Donec

lestie consequat, ultrices ac magn

or nec facilisis. Pellentesque dapi

risus ante, dapibus a molest

Donec

usce dui lectus, congue vel la

lestie consequat, ultrices ac magn

risus ante, dapibus a molest

Donec

gue

ng elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ult

ng elit. Nam lacinia pulvinar tortor

, consectetur adipiscing elit.

usce dui lectus, congue vel l

m ipsum dolor sit amet, consectetur adi

iscing elit. Nam lacinia pulvinar tortor nec fac

ipiscing elit. Nam lacinia pul

inia pulvinar tortor nec faci

m ipsum dolor sit amet, consect

dictum vit

o

gue

The student who asked this found it Unhelpful
Overall rating 0%
Get unstuck

416,787 students got unstuck by Course
Hero in the last week

step by step solutions

Our Expert Tutors provide step by step solutions to help you excel in your courses