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
Yanka [14]
3 years ago
15

Design a class named Car that has the following fields:

Computers and Technology
1 answer:
snow_tiger [21]3 years ago
4 0

Answer:

// The class car is defined

public  class Car {

  // instance variable yearModel

  private int yearModel;

  // instance variable make

  private String make;

  // instance variable speed

  private int speed;

 

  // empty constructor

  // with instances inside it

  // the instances are from the question

  public Car(){

      yearModel = 2000;

      make = "Nissan";

      speed = 4;

  }  

  // overloaded constructor

  // constructor defined with three arguments

  public Car(int yearModel, String make, int speed) {

      // the arguments are assigned to the object's variable

      this.yearModel = yearModel;

      this.make = make;

      this.speed =speed;

  }

  // setter(mutator) method

  public void setYearModel(int yearModel){

      this.yearModel = yearModel;

  }

  // setter(mutator) method

  public void setMake(String make){

      this.make = make;

  }

  // setter(mutator) method

  public void setSpeed(int speed){

      this.speed = speed;

  }

  // getter(accessor) method

  public int getYearModel(){

      return yearModel;

   }

  // getter(accessor) method

  public String getMake(){

      return make;

   }

  // getter(accessor) method

  public int getSpeed(){

      return speed;

   }  

  // toString is override to display the car object properties

  public String toString(){

      return "Car's year model: " + getYearModel() + ", make: " + getMake() + ", speed: " + getSpeed();

  }

}

Explanation:

The code is well commented.

You might be interested in
Numerous engineering and scientific applications require finding solutions to a set of equations. Ex: 8x + 7y = 38 and 3x - 5y =
Gre4nikov [31]

The brute strength method determines if each x and y value satisfies both conditions. To do this, we must iterate through each result in the specified range and insert them into both models.

<h3>What are Elegant mathematical technique?</h3>

ALGORITHM :

1. Take the values of all coefficients and SET flag = FALSE

2. Run a FOR loop for x in range (-10, 11). 11 won't be included.

2a. Inside the first FOR, start the y FOR loop in range(-10,11). 11 won't be included

2b. Inside the y FOR loop, check IF for a particular value of x and y both the equations satisfied.

2c. If yes, set flag TRUE and print values of x and y.

2d. ELSE the flag stays FALSE.

END FOR Y

END FOR X

3. Check if flag = FALSE, then print NO SOLUTION

PYTHON CODE :

a=int(input()) #taking input for each coefficient

b=int(input())

c= int(input())

a1= int(input())

b1= int(input())

c1= int(input())

flag = False

for x in range(-10,11): #checking for all values of x in range -10 to 10

for y in range(-10,11): #checking for all values of x in range -10 to 10

if (a  x + b  y – c == 0) and (a1*x + b1*y - c1 == 0) : #checking if the x and y values satisfy the equation

flag = True #setting the flag if solution is found

print('Solution : x = {-10, 10}, y = {-10, 10}'.format(x,y)) #if they satisfy print x & y

if flag = False : #if flag stays false, that means there is no solution

print('No solution')

OUTPUT : The output is given below.

More about the Elegant mathematical technique link is given below.

brainly.com/question/27934739

#SPJ1

4 0
2 years ago
Brainliest
olya-2409 [2.1K]

Answer:

browsing history

Explanation:

....

6 0
2 years ago
Read 2 more answers
Holi alguien sabe como cambiar el gamertag en XBox App (para iOS)?
Schach [20]

Answer:

Hola, cambiar tu gamertag (el nombre o apodo que te identifica en los juegos de XBox en línea) es muy sencillo. Simplemente debes ingresar al menú principal de tu aplicación XBox App, y una vez allí seleccionar la imagen que te identifica como usuario. Al clickear allí, podrás seleccionar la opción Personalizar, donde se desplegará un menú de opciones dentro de las cuales se encontrará la de cambiar tu gamertag o nombre de usuario. Recuerda que solo podrás cambiar tu gamertag en forma gratuita una única vez.

3 0
2 years ago
Which type of network involves buildings in multiple cities connecting to each other?
NeX [460]

Answer:

Power lines

Explanation:

Because their everywhere

4 0
3 years ago
In addition to good design sense, what else do web designers need to be proficient in?
ELEN [110]

In addition to good design sense, web designers need to be proficient in front-end coding languages.

A web designer refers to an individual who is saddled with the responsibility of writing executable codes (instructions) for the design and development of a website, especially by using a hypertext markup language (HTML).

Generally, it is expected that all web designers a good design sense in website development. Additionally, web designers need to be proficient in front-end coding languages, so as to ensure the graphical display and user-interface (UI/UX) are attractive and properly rendered.

Some examples of front-end coding languages include:

  • CSS
  • HTML
  • Javascript
  • React
  • JQuerry
  • Vue

Read more on web design here: brainly.com/question/8391970

7 0
2 years ago
Other questions:
  • Wich of these is an example of magnetic storage
    11·1 answer
  • A user of the wireless network is unable to gain access to the network. The symptoms are:1.) Unable to connect to both internal
    6·1 answer
  • ____ is the only automated disk-to-disk tool that allows you to copy data to a slightly smaller target drive than the original s
    5·1 answer
  • A vacuum tube that contains a grid can be classified as a A. rectifier B. triode C. pentode D. diode
    12·1 answer
  • To check if your operating system is up to date, click Start then click Control Panel and choose _______________. Select one: a.
    11·1 answer
  • ou use productivity apps on your iPad tablet device while traveling between client sites. You're concerned that you may lose you
    11·1 answer
  • Write the function powersOf3ToN(n) that takes a possibly-negative float or int n, and returns a list of the positive powers of 3
    10·1 answer
  • (14) Click on the
    7·2 answers
  • (C) Describe about the different types of computer<br> peripherals and memory devices.
    9·1 answer
  • Select the three subjects studied in sports biomechanics.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!