Write some code that reads in a name and an age and then prints the message "The age of NAME is AGE" on a line by itself, where NAME and AGE are replaced by the values read in for the variables name and age. For example, if your code read in "Rohit" and 70 then it would print out "The age of Rohit is 70" on a line by itself. There should NOT be a period in the output .
what i have is name=stdin.next(); System.out.println("Gabe"); age=stdin.nextInt(); System.out.println("20"); System.out.println("The age of + name + " is " + age");
This hw section says The output should be in the form, "the age of Gabe is 20" the quotes should be there, but when i compile it _ it says you should be using the + operator
So you want the quotes to be included in the output? If so you need to do something like: "\"hello\"" which would print "hello" WITH the quotations.
Join our real-time social learning platform and learn together with your friends!