001-001-004
Variable Declaration: My Recipe Card
Easy
Problem Description
Variable Declaration and Input
In this problem, you will create a program that reads a dish name, servings, and cooking time from keyboard input, stores them in variables, and displays the result in card format to standard output.
You can declare variables of different types (String, int) and read values from keyboard input using Scanner.
Key Points
- Use
Stringfor text,intfor integers - Use
sc.nextLine()to read strings,sc.nextInt()to read integers - Concatenate strings and variables with the
+operator for output
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up