EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 5, Problem 8PE
Program Plan Intro
Automobile application
Program plan:
- In a file “Automobile.java”, create a class “Automobile”,
- Declare the necessary variables.
- Define the constructor,
- Call the method “set_Id()”,
- Call the method “set_Make()”,
- Call the method “set_Model()”,
- Call the method “set_Color()”,
- Call the method “set_Year()”,
- Call the method “set_Mpg()”,
- Define the method “set_Id()”,
- Initialize the final variable.
- Check whether either the id is less than “0” or greater than maximum id,
- If it is true, set the id to “0”.
- Otherwise, set the initial id.
- If it is true, set the id to “0”.
- Define the method “set_Make()” to set the initial make value.
- Define the method “set_Model()” to set the initial model value.
- Define the method “set_Color()” to set the initial color value.
- Define the method “set_Year(),
- Initialize the minimum year and maximum year.
- Check whether either the year is less than the minimum year or greater than the maximum year,
- If it is true, set the year to “0”.
- Otherwise, set the initial year.
- If it is true, set the year to “0”.
- Define the method “set_Mpg()”,
- Initialize the minimum and maximum miles per gallon.
- Check whether either the Miles Per Gallon(MPG) is less than the minimum mpg or greater than the maximum mpg,
- If it is true, set the MPG to “0”.
- Otherwise, set the mpg value.
- If it is true, set the MPG to “0”.
- Define the method “get_Id()” to return the id.
- Define the method “get_Make()” to return the Make.
- Define the method “get_Model()” to return the Model.
- Define the method “get_Color()” to return the Color.
- Define the method “get_Year()” to return the year.
- Define the method “get_Mpg()” to return the MPG.
- In a file “TestAutomobiles.java”, create a class “TestAutomobiles”,
- Define the method “main ()”,
- Call the constructor “Automobile()” that instantiates several job automobile dealers.
- Call the method “display1()” for first automobile dealer.
- Call the method “display1()” for second automobile dealer.
- Call the method “set_Id()” for first automobile dealer.
- Call the method “display1()” for first automobile dealer.
- Call the method “set_Id()” for first automobile dealer.
- Call the method “display1()” for first automobile dealer.
- Call the method “set_Make()” for first automobile dealer.
- Call the method “set_Model()” for first automobile dealer.
- Call the method “display1()” for first automobile dealer.
- Call the method “set_Id()” for second automobile dealer.
- Call the method “set_Color()” for second automobile dealer.
- Call the method “set_Year()” for second automobile dealer.
- Call the method “display1()” for second automobile dealer.
- Call the method “set_Mpg()” for second automobile dealer.
- Call the method “display1()” for second automobile dealer.
- Call the method “set_Mpg()” for second automobile dealer.
- Call the method “display1()” for second automobile dealer.
- Define the method “display1()”,
- Print the output.
- Define the method “main ()”,
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
We are considering the RSA encryption scheme. The involved numbers are small, so the communication is insecure. Alice's public key (n,public_key) is (247,7).
A code breaker manages to factories 247 = 13 x 19
Determine Alice's secret key.
To solve the problem, you need not use the extended Euclid algorithm, but you may assume that her private key is one of the following numbers 31,35,55,59,77,89.
Consider the following Turing Machine (TM). Does the TM halt if it begins on the empty tape? If it halts, after how many steps? Does the TM halt if it begins on a tape that contains a single letter A followed by blanks? Justify your answer.
Pllleasassseee ssiiirrrr soolveee thissssss questionnnnnnn
Chapter 5 Solutions
EBK JAVA PROGRAMMING
Ch. 5 - Prob. 1RQCh. 5 - Prob. 2RQCh. 5 - Prob. 3RQCh. 5 - Prob. 4RQCh. 5 - Prob. 5RQCh. 5 - Prob. 6RQCh. 5 - Prob. 7RQCh. 5 - Prob. 8RQCh. 5 - Prob. 9RQCh. 5 - Prob. 10RQ
Ch. 5 - Prob. 11RQCh. 5 - Prob. 12RQCh. 5 - Prob. 13RQCh. 5 - Prob. 14RQCh. 5 - Prob. 16RQCh. 5 - Prob. 17RQCh. 5 - Prob. 18RQCh. 5 - Prob. 19RQCh. 5 - Prob. 20RQCh. 5 - Prob. 1PECh. 5 - Prob. 2PECh. 5 - Prob. 3PECh. 5 - Prob. 4PECh. 5 - Prob. 5PECh. 5 - Prob. 6PECh. 5 - Prob. 7PECh. 5 - Prob. 8PECh. 5 - Prob. 9PECh. 5 - Prob. 10PECh. 5 - Prob. 1GZCh. 5 - Prob. 2GZCh. 5 - Prob. 3GZCh. 5 - Prob. 4GZCh. 5 - Prob. 5GZ
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- 4. def modify_data(x, my_list): X = X + 1 my_list.append(x) print(f"Inside the function: x = {x}, my_list = {my_list}") num = 5 numbers = [1, 2, 3] modify_data(num, numbers) print(f"Outside the function: num = {num}, my_list = {numbers}") Classe Classe that lin Thus, A pro is ref inter Ever dict The The output: Inside the function:? Outside the function:?arrow_forwardpython Tasks 5 • Task 1: Building a Library Management system. Write a Book class and a function to filter books by publication year. • Task 2: Create a Person class with name and age attributes, and calculate the average age of a list of people Task 3: Building a Movie Collection system. Each movie has a title, a genre, and a rating. Write a function to filter movies based on a minimum rating. ⚫ Task 4: Find Young Animals. Create an Animal class with name, species, and age attributes, and track the animals' ages to know which ones are still young. • Task 5(homework): In a store's inventory system, you want to apply discounts to products and filter those with prices above a specified amount. 27/04/1446arrow_forwardOf the five primary components of an information system (hardware, software, data, people, process), which do you think is the most important to the success of a business organization? Part A - Define each primary component of the information system. Part B - Include your perspective on why your selection is most important. Part C - Provide an example from your personal experience to support your answer.arrow_forward
- Management Information Systemsarrow_forwardQ2/find the transfer function C/R for the system shown in the figure Re དarrow_forwardPlease original work select a topic related to architectures or infrastructures (Data Lakehouse Architecture). Discussing how you would implement your chosen topic in a data warehouse project Please cite in text references and add weblinksarrow_forward
- Please original work What topic would be related to architectures or infrastructures. How you would implement your chosen topic in a data warehouse project. Please cite in text references and add weblinksarrow_forwardWhat is cloud computing and why do we use it? Give one of your friends with your answer.arrow_forwardWhat are triggers and how do you invoke them on demand? Give one reference with your answer.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Introduction to Classes and Objects - Part 1 (Data Structures & Algorithms #3); Author: CS Dojo;https://www.youtube.com/watch?v=8yjkWGRlUmY;License: Standard YouTube License, CC-BY