0
Making a contact management system. Please help
The given program declares two variables, name and age. Complete the code to output "name is age years old", where name and age are the declared variable values. name = "James" age = "42"
20 Respuestas
+ 6
Samuel Adesanya , Pavan Kuncham ,
it is simpler to use this notation instead of using `+` and concatenation. we don't need to handle additional spaces in the string. just use commas to separate the arguments inside print() function:
print(name, "is", age, "years old")
+ 5
Please read the previous lesson again.
Compare for example print("a+b") and print("a"+"b").
+ 5
der james Show your complete code so we can check on what you tried.
+ 3
What have you tried so far?
Re-read the lessons and show your code attempt please.
+ 3
der james Your code is _Java_. This thread is about the _Python_ task. You can concatenate strings with +. Pay attention to blank spaces.
+ 2
print("name is "+name+" "+age+" years old")
+ 2
please i need the complete code from the beginning
+ 2
Achievement Tiffany
The question has been answered. Read the previous posts.
+ 1
I have read the lesson countless times and I've even gone through the comments below each lesson and I don't seem to be getting it, maybe I need a little help.
This is my attempt below:
name = "James"
age = "42"
print ("name+is+age+years+old")
+ 1
Lothar ok bro and thank you for extra information
+ 1
der james this is the updated code in java
public class Program {
public static void main(String[] args) {
String name = "Howard";
int age = 42;
System.out.println("name is "+name+" "+age+" years old");
}
}
0
The expected output is:
James is 42 years old
0
name = "James"
age = "42"
Print(name+" is"+age+" years old")
0
Somebody an idea? Not a single one of your Tips Do work
0
public class Program {
public static void main(String[] args) {
String name = "Howard";
int age = 42;
System.out.println(name"is"age"years old");
}
}
0
The example from pavan and Samuel does Not work either
0
Dont know what is wrong
0
Lisa do u got an answer for me?
0
Oh sorry okay
0
der james are you getting any errors while running the code that which you have posted