![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 13.11.2019 17:31 nina7163
Write a program that prompts the user to enter a social security number in the format ddd-dd-, where d is a digit. your program should check whether the input is valid.
hint: use chatat() and isdigit() methods.
ex.
input: 111-11-
output: valid ssn
input: 11-11-
output: invalid ssn
i know that i can solve this problem by looping through the characters of the string in the ssn but i want to make the code i wrote beneath work. i am having a problem on my second to last if- statement. in that statement it says that all of my variables d1-d9 "cannot be resolved to variable." i initially thought that this might be a problem with scope of my variables but i dont belive it is. why am i getting an error and what can i do to make this code work
import java. util. scanner;
public class checkssn {
public static void main(string [] args) {
scanner kbd_in = new scanner(system. in);
system. out. print(" enter your social security numer in the format ddd-dd-: ");
string social = kbd_in.();
system. out. println(" you have entered: "+ social);
kbd_in. close();
![ansver](/tpl/images/cats/User.png)
Answers: 1
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 11:00, najerajulio
What is the foundation for proper monitoring, load balancing and routing in distributed systems
Answers: 3
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 13:30, 21megoplin
In which phase does software coding and testing happen in the spiral model? the spiral model does not have a separate testing phase. both, software coding and testing occurs during the phase.
Answers: 3
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 01:00, kkruvc
Mastercard managers are motivated to increase (1) the number of individuals who have and use a mastercard credit card, (2) the number of banks and other clents who issue mastercards to customers and/or employees, and (3) the number of locations that accept mastercard payments. discuss how mastercard could use its data warehouse to it expand each of these customer bases.
Answers: 3
You know the right answer?
Write a program that prompts the user to enter a social security number in the format ddd-dd-, where...
Questions in other subjects:
![Konu](/tpl/images/cats/himiya.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 20.09.2020 18:01
![Konu](/tpl/images/cats/fizika.png)
![Konu](/tpl/images/cats/ekonomika.png)
![Konu](/tpl/images/cats/biologiya.png)
Biology, 20.09.2020 18:01
![Konu](/tpl/images/cats/biologiya.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/himiya.png)
![Konu](/tpl/images/cats/mat.png)