Answered step by step
Verified Expert Solution
Question
1 Approved Answer
java this is one qeustion Programming language is java please fast You are going to develop a class to represent Car. *For the instance variables,
java
this is one qeustion
Programming language is java
please fast
You are going to develop a class to represent Car. *For the instance variables, add the below ones. Make sure that these values cannot be accessed from other classes. Brand of the car Price of the car Model of the car Segment of the car (For example A, B, C or D) Number of purchases *Write at least two constructors (not the default one)(Hint: When you first create a car, purchases should be ) *For this class, make sure you follow the encapsulation rules. (Add methods that you think are necessary for encapsulation) *Add an additional buy method that increases the purchase amount *Override the toString method. Return everything in a proper format. #implement a class that will represent a car Gallery, *For the instance variables, add the below ones. Make sure that these values cannot be accessed from other classes. name of the gallery Type here to search ot name of the gallery number of cars cars *Write at least two constructors (not the default one) *For this class, make sure you follow the encapsulation rules. (Add methods that you think are necessary for encapsulation) *Write one additional method to add cars to a gallery. *Write one additional method to search a car by the segment in this gallery. If you can find any car belonging to the given segment, display them. *Write one additional method to search a car by the price in this gallery. If you can find a car (or cars) smaller than or equal to a given price, display them. *Write another method to decide the top-selling car in this gallery and return it (which is the most purchased car) *Override the toString method. Return everything including the car properties. *Finally, use this class with a main method. Create a couple of cars. Then create a gallery with these cars. Buy them randomly. Search the cars.call the necessary methods and at the end show us which car is the top-selling car and which one is the most expensive one. Activate Window The general flow is up to you but make sure you call search methods. buy method add method and tostring methods ING O Type here to search 7 s 96 Uverride the lostring method. Return everything including the car properties. *Finally, use this class with a main method. Create a couple of cars. Then create a gallery with these cars. Buy them randomly. Search the cars, call the necessary methods and at the end show us which car is the top-selling car and which one is the most expensive one. The general flow is up to you but make sure you call search methods, buy method, method and tostring met WHEN YLI KOPY PASTE YOUR CODE TO THE BELO COPY THE CLASS CAR TADD THIS DASSES COPY THE GALERY CLASS TADD THIS DASH COPY YOUR MOON METHOD Activate Window Your answer: ENG 1345 1/2012 AI O Type here to search 8 M 5 00 You are going to develop a class to represent Car. *For the instance variables, add the below ones. Make sure that these values cannot be accessed from other classes. Brand of the car Price of the car Model of the car Segment of the car (For example A, B, C or D) Number of purchases *Write at least two constructors (not the default one)(Hint: When you first create a car, purchases should be ) *For this class, make sure you follow the encapsulation rules. (Add methods that you think are necessary for encapsulation) *Add an additional buy method that increases the purchase amount *Override the toString method. Return everything in a proper format. #implement a class that will represent a car Gallery, *For the instance variables, add the below ones. Make sure that these values cannot be accessed from other classes. name of the gallery Type here to search ot name of the gallery number of cars cars *Write at least two constructors (not the default one) *For this class, make sure you follow the encapsulation rules. (Add methods that you think are necessary for encapsulation) *Write one additional method to add cars to a gallery. *Write one additional method to search a car by the segment in this gallery. If you can find any car belonging to the given segment, display them. *Write one additional method to search a car by the price in this gallery. If you can find a car (or cars) smaller than or equal to a given price, display them. *Write another method to decide the top-selling car in this gallery and return it (which is the most purchased car) *Override the toString method. Return everything including the car properties. *Finally, use this class with a main method. Create a couple of cars. Then create a gallery with these cars. Buy them randomly. Search the cars.call the necessary methods and at the end show us which car is the top-selling car and which one is the most expensive one. Activate Window The general flow is up to you but make sure you call search methods. buy method add method and tostring methods ING O Type here to search 7 s 96 Uverride the lostring method. Return everything including the car properties. *Finally, use this class with a main method. Create a couple of cars. Then create a gallery with these cars. Buy them randomly. Search the cars, call the necessary methods and at the end show us which car is the top-selling car and which one is the most expensive one. The general flow is up to you but make sure you call search methods, buy method, method and tostring met WHEN YLI KOPY PASTE YOUR CODE TO THE BELO COPY THE CLASS CAR TADD THIS DASSES COPY THE GALERY CLASS TADD THIS DASH COPY YOUR MOON METHOD Activate Window Your answer: ENG 1345 1/2012 AI O Type here to search 8 M 5 00Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started