Answer:
public class Car {
//Member variables
private int yearModel;
private String make;
private int speed;
//Constructor
public Car(int yearModel, String make, int speed) {
this.yearModel = yearModel;
this.make = make;
this.speed = speed;
}
//Accessor Methods getters and setters
public int getYearModel() {
return yearModel;
}
public void setYearModel(int yearModel) {
this.yearModel = yearModel;
}
public String getMake() {
return make;
}
public void setMake(String make) {
this.make = make;
}
public int getSpeed() {
return speed;
}
public void setSpeed(int speed) {
this.speed = speed;
}
//Accelerate function
public void accelerate(){
this.speed+=5;
}
// Brake function
public void brake(){
this.speed-=5;
}
}
Explanation:
- As required by the question, The class Car is created using Java programming language
- The members variables, the constructor, The accessor methods are all created as required by the question (Please pay attention to the comments added to the code)
- The accelerate and brake functions that add and subtract 5 from the speed member variable respectively are also created.
Answer:
which type of questions is this
Answer:
Following are the code to this question:
def binarynumber(num):#defining a method binarynumber that accepts a parameter num
x=""#defining a string variable x
if (num!=0):#defining if condition to check number not equal to 0
while (num>=1):#defining a loop that check value is grater then equal to one
if (num %2==0):#defining if condition to check num is even
x=x+"0" #add string value 0 in num variable
num=num/2 #divide the value by 2
else:#defining else block
x=x+"1"#add string value 1 in num variable
num=(num-1)/2#first subtract 1 into num variable then divide the value by 2
else:
x="0"#assign string value 0 in num variable
return "".join(reversed(x))#return value
num = int (input ("Enter any number: "))#defining num variable that input the integer value
print (binarynumber(num))#using print method to call method binarynumber with passing num parameter
Output:
Enter any number: 12
1100
Explanation:
- In the above python code a method "binarynumber" is declared, in which the "num" variable passes as the parameter inside the method a string variable "x" is declared that stores all converted values.
- Inside the method and if the block is declared that checks number value is not equal to 0 if this condition is false then it will add string value and reverse its value.
- Or if the condition is true it defines a while loop that calculates the given number binary digits and returns its value.
- At the last step, the num variable is declared that inputs the integer value from the user end and calls the method by using the print method.
Well the fact that jails are overcrowded is one factor that shows it's not working. Some people need help from past traumas, abuse, etc. Not everyone that acts out needs to be incarcerated, they need rehabilitation or counseling. Definitely depends on the crime committed. Therefore substance abuse users would be in rehabilitation. Even Juveniles in detention centers don't benefit from incarceration for certain offenses. There is no rehabilitation in incarceration. There are more criminals in jail and incarceration in my opinion, only for some offenders, is the last option. Now for Sex Offenders, Murderers and Criminals with violent crimes my opinion is completely opposite. Some of those offenders should be dealt with according to their crime. Also, all of the people that have been pardoned and them lessening time for drug traffickers and actual drug dealers (not necessarily users) is just a bad thing to pardon them or let them out because they don't have any violent crimes. Isn't dealing drugs, that are killing people every single day just as bad as a violent crime. In my opinion they can sit and rot for the longevity of their sentence. Some need help and I would fully support that only under some circumstances. Others I would rather not have to live amongst them.
Lacking a response to my question, I'll assume there's no "correct' answer here.
Joaquin could contact the university's graphic arts department, or if he's interested in the programming side of it, the computer science department, and ask if they have any information on the topic. If he's already majoring to become an animator, then he should talk to one of his professors to see if they know someone in the business that would speak with Joaquin.
The faster and better way would be to go to reddit, or some site at which animators congregate (most probably found through Google), read the forums, and create if he's not finding a suitable answer.