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

Receiving an exception and code failing when trying to delete a line from a .txt file using java

I am trying to delete a specific line from my text file using java, My code is supposed to write the file to a temp file and skip writing the username (chosen to be deleted), it is then supposed to delete the original file and rename the new temp file to match the original. The… Read More Receiving an exception and code failing when trying to delete a line from a .txt file using java

R plotting a graph with confidence intervals

I have a dataframe that looks like this – df = data.frame(recall=c(0.55,0.62,0.43,0.61,0.19,0.14,0,0.19,0.33,0.33,0,0.33), type= c("Phone numbers","Phone numbers","Phone numbers","Phone numbers","Emails","Emails","Emails","Emails","URLs","URLs","URLs","URLs"), model=c("Cognition","TS-SAR","TS-ABINet","TS-RobustScanner", "Cognition","TS-SAR","TS-ABINet","TS-RobustScanner", "Cognition","TS-SAR","TS-ABINet","TS-RobustScanner"), lb=c(0.47,0.55,0.35,0.53, 0.07,0.04,0,0.07, 0.14,0.14,0,0.14), ub=c(0.63,0.7,0.51,0.69, 0.30,0.24,0,0.3, 0.52,0.52,0,0.52)) It consists of the results of 4 ‘text detection in image’ ML models. The recall column has the recall metric values for each model, based on the type… Read More R plotting a graph with confidence intervals

Why does my code terminate without executing nextLine() function while taking input for fullname?

I am trying to take input for two strings. One is for first name without any spaces and second one is for fullname that will include spaces between first-name and the last-name. As fname variable only holds one word so I used next() function there and nextLine() for full_name variable. But the code only takes… Read More Why does my code terminate without executing nextLine() function while taking input for fullname?

How can I specify a numeric pattern with dashes in Java

For this code, I’m trying to get the user to input a pattern of numbers like "####-##-###" including the dashes. I have this code but it’s returning an error. import java.util.regex.Pattern; import java.util.regex.Matcher; import java.util.Scanner; public class StudentNumber { public static void main(String[] args) { Scanner s = new Scanner(System.in); System.out.print("Enter your student number: ");… Read More How can I specify a numeric pattern with dashes in Java