Mini java chatbot

I am new to Java and trying to make a simple mini chatbot, that answers to 3 questions with user input and if/else statement. I do not know if I am correct, but I got this far: import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Hello… Read More Mini java chatbot

Java Script: How to check if value is number with typeof operator

How do I check in the if statement if _energyLevel is a number? I need to use the typeOf operator for that. Thanks for your help 🙂 const robot = { _model: ‘1E78V2’, _energyLevel: 100, get energyLevel(){ if(this._energyLevel === typeof(number)){ return `My current energy level is ${_energyLevel}` }else{ } } }; >Solution : typeof operator… Read More Java Script: How to check if value is number with typeof operator