1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Musya8 [376]
3 years ago
12

Given main(), complete the Car class (in file Car.java) with methods to set and get the purchase price of a car (setPurchasePric

e(), getPurchasePrice()), and to output the car's information (printInfo()).
Ex: If the input is:
2011
18000
2018
where 2011 is the car's model year, 18000 is the purchase price, and 2018 is the current year, the output is:
Car's information:
Model year: 2011
Purchase price: 18000
Current value: 5770
Note: printInfo() should use three spaces for indentation.
Computers and Technology
1 answer:
mylen [45]3 years ago
4 0

Answer and Explanation:

public class Main {

int Carmodel;

int Purchaseprice;

int Currentyear;

Public void setPurchasePrice(int Purchaseprice){

this.Purchaseprice=Purchaseprice;

}

Public void getPurchasePrice(){

return Purchaseprice;

}

static void printInfo(int Carmodel int Currentyear ){

this.Carmodel=Carmodel;

this.Currentyear=Currentyear;

System.out.println(getPurchasePrice() Carmodel Currentyear);

}

}

The above java program defines a class that has three methods, a get method that returns purchase price of the object, a set method that sets purchase price of the object, and a print method that print out the information about the car object(model, year, price). The print method also takes arguments and assigns values of the arguments/parameters to the object, then prints all.

You might be interested in
A smart card is?
Tom [10]

Answer:

i think....(b)

Explanation:

please say yes or no answer....

8 0
3 years ago
How can I change it to accepted file types: .ppt, .pptx, .xls, .xlsx, .doc, .docx, .zip, .pdf, .accdb, .msg on Inkscape?
Alisiya [41]
Go to file>export as and it will allow you to change it to other files.
7 0
3 years ago
Read 2 more answers
Information about www
iragen [17]

Answer:

Here is your ans

Thanku you

4 0
3 years ago
When you right-click certain areas of the Word or other Office app windows, a command menu will appear. Group of answer choices
klasskru [66]

Answer:

The answer is "False".

Explanation:

In the word or other office application when we right-click on a certain area of the office, it will provide a common task, like double-click and pick objects.

  • The right mouse button also refers to use and open the pop-up menu, which changes depending on where you select.
  • It allows the computer to mouse additional features, typically known as an optional lowering screen, that's why the given statement is "false".
3 0
4 years ago
When a hostname is configured through the cisco cli, which three naming conventions are part of the guidelines? (choose three.)?
Advocard [28]
When a hostname is configured through the Cisco cli,  there are some naming <span>conventions are part of the guidelines that should be followed.

From these conventions:
1- the name of the host shouldn't contain any spaces.
2- the name of the host should always begin with a letter
3- the name of the host should be less than 64 characters in length.</span>
3 0
4 years ago
Other questions:
  • A mobile device is freezing almost daily. The device remains powered on and the screen illuminated. The user restarts the device
    13·1 answer
  • The Classic Triangle Testing Problem, (Myer's Triangle): A program reads three integer values. The three values are interpreted
    10·1 answer
  • Question 1<br> REVPAR and REVPOR are basically the same thing.<br> True<br> False
    11·1 answer
  • write a script that creates and calls a stored procedure named insert_category. first, code a statement that creates a procedure
    10·1 answer
  • A _____ is sent to companies that are hiring to get an interview. résumé brochure business report newsletter plz hurry need it n
    13·2 answers
  • What do you understand by storage devices ? Name any two storage devices.​
    11·2 answers
  • describe the impact of technology in your life . how does it affects your human relations with other people .​
    12·1 answer
  • Which tools do meteorologists use to collect data about the weather?
    13·2 answers
  • You are configuring a network and have been assigned the network address of 221.12.12.0. You want to subnet the network to allow
    7·1 answer
  • A ____ attack is much more substantial than a dos attack because of the use of multiple systems to simultaneously attack a singl
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!