public static void main(String[] args) { // String input String name = JOptionPane.showInputDialog("Beep. Beep. Hello! I am your robot, what is my owner name? "); // Integer input int age = Integer.parseInt(JOptionPane.showInputDialog("Nice to beep you " + name + ". Your robot needs information about my owner. beep. Can I ask your *beep* age?")); //it will input the address String address = JOptionPane.showInputDialog("okay master robot " +name+ ", Where do we live? beep."); // Double input double yourValue = Double.parseDouble(JOptionPane.showInputDialog("okay! On a scale of 1 to 5. How good robot I am to you. beep.")); //string that will input the jewel she choose String travelMethod = JOptionPane.showInputDialog("What transportation do we have? is there a beep car"); // String input used in a question String word = JOptionPane.showInputDialog("As your robot, what word do you want to use to call me?"); // Math with int int travelTime = (age * 10) + 10; // Simulate travel time based on age // Math with double double wholeNumber1 = 100 * 1; // Calculate a percentage that will give to a charity double wholeNumber2 = yourValue * 5 ; //This will calculate the wealth that will give to my one I love and only // Story output String story = "Hello my master, " + name + ".\n" + "I will be your robot to help and guide you for the rest of your beep life. You are " + age + " Today so we will be together for a long time. beep.\n" + "I will always help you and if you want to call me just say the word " + word + " and I will be there.\n" + "I am much faster than your " + travelMethod + " that your using. beep.\n" + "If you don't need me, I will always wait for you here in " + address + ".\n" + "Don't think to much when will I break, my body materials will start to break " + travelTime + " years later so don't worry.\n" + "Don't forget to charge me because I only have " + wholeNumber1 + "% you can charge me when my battery is at " + wholeNumber2 + "%.\n" + "Thank you for trusting your *beep* robot " + name + "."; JOptionPane.showMessageDialog(null, story); // This story is about a robot that will help his/her owner for the rest of his/her/ life. // This is the conversation when they first meet, and luckily they both grow up. Although, the robot doesn't. // And this is the story of the robot and the owner. The end. } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter