subject

Identify grammar/logic errors in the following codes and correct them.
the following is someone’s definition (with quite some errors) for the checking class.
public class checking {
//only one attribute (for simplicity, nothing wrong here)
private double balance;
public void checking(double inibalance){
setbalance(inibalance);
}
// define getter and setter
public string getbalance(){
return balance;
}
public void setbalance(double newbalance){
double balance = 0;
if(newbalance> 0){ //validity check
balance = newbalance;
}
else{
system. out. println("your input is invalid! ");
}
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:30
An endless cycle of creation and response on the internet is called
Answers: 1
question
Computers and Technology, 22.06.2019 18:00
Write a method named addall that could be placed inside the hashintset class. this method accepts another hashintset as a parameter and adds all elements from that set into the current set, if they are not already present. for example, if a set s1 contains [1, 2, 3] and another set s2 contains [1, 7, 3, 9], the call of s1.addall(s2); would change s1 to store [1, 2, 3, 7, 9] in some order. you are allowed to call methods on your set and/or the other set. do not modify the set passed in. this method should run in o(n) time where n is the number of elements in the parameter set passed in.
Answers: 2
question
Computers and Technology, 23.06.2019 18:30
Write a program that prints the day number of the year, given the date in the form month-day-year. for example, if the input is 1-1-2006, the day number is 1; if the input is 12-25-2006, the day number is 359. the program should check for a leap year. a year is a leap year if it is divisible by 4, but not divisible by 100. for example, 1992 and 2008 are divisible by 4, but not by 100. a year that is divisible by 100 is a leap year if it is also divisible by 400. for example, 1600 and 2000 are divisible by 400. however, 1800 is not a leap year because 1800 is not divisible by 400.
Answers: 3
question
Computers and Technology, 25.06.2019 06:20
If you want to change the speed of a layer's horizontal scrolling, what should you change? a. the x coefficient b. the y coefficient c. the virtual width d. the order of the game's layers select the best answer from the choices provided
Answers: 2
You know the right answer?
Identify grammar/logic errors in the following codes and correct them.
the following is someon...
Questions
question
Computers and Technology, 03.08.2021 07:40
question
English, 03.08.2021 07:40
question
Mathematics, 03.08.2021 07:40
Questions on the website: 13722367