0
Can you help me in this Input error please
in the output is not let me enter the last name The output: Enter first name: shaima Enter last name: Error: Database connection; cannot add the stduent , shaima https://code.sololearn.com/cW1von8azLLx/?ref=app
6 Answers
0
you are doing first input before print message about it
String firstnamestudent = input.nextLine();
System.out.println("Enter first name:");
so shaima is entered as last name
0
zemiak can you show me exaple becuse i change what you said but it is not work
0
//change code this way
System.out.println("Enter first name:");
String firstnamestudent = input.nextLine();
System.out.println("Enter last name:");
String lastnamestudent = input.nextLine();
0
zemiak not working
The output
Enter 1 if you want add student of 2 if want add new staff:
1
Enter first name:
Enter last name:
shaima
Error: Database connection; cannot add the stduent , shaima
0
if before switch is
int choice = input.nextInt();
change this to pair
int choice = input.nextInt();
input.nextLine();