Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random nickname generator #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions Java/Random nickname generator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

import java.util.Random;


public class Main {

public static void main(String[] args) {
Random num=new Random();
int numAssigned=1+num.nextInt(10);
String name="";
if (numAssigned==1) {

name = "Suryastra";
}

else if(numAssigned== 2) {
name = "Garudastra";

}

else if (numAssigned==3) {
name = "Nagastra";

}
else if (numAssigned==4) {
name = " Bhargavastra";
}
else if(numAssigned==5) {
name = "Agneyastra";
}

else if(numAssigned==6){
name="Vayavyastra";
}
else if(numAssigned==7) {
name = "Bhaumyastra";
}
else if(numAssigned==8) {
name = " Sammohanastra";
}
else if(numAssigned==9) {
name = "Pashupatastra";
}

else if(numAssigned==10) {
name = " Aindrastra";
}
else if(numAssigned==11) {
name = "Yamyadandastra";

}





System.out.println("Welcome,"+ name);

}
}