CodeGym
Promotion
CodeGym University
Learning
Course
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme
Question
  • Reviews
  • About us
Start
Start learning
Start learning now
  • All questions
Nitin
Level 5
  • 13.03.2019
  • 1153views
  • 1comment

The programm is correct but it is showing Typo error?

Question about the task A name is a name
Java Syntax,  Level 4,  Lesson 16
Resolved


Use the keyboard to enter a name.
Use the keyboard to enter a birth date (three numbers): yyyy, mm, dd.

Display the following:
"My name is *name*.
I was born on mm/dd/yyyy"

Example output:
My name is Kevin.
I was born on 2/15/1988

Requirements:
  • The program should read 4 lines from the keyboard.
  • The program should display lines on the screen.
  • The program should display text in accordance with the template specified in the task.
  • Display each statement on a new line.
package com.codegym.task.task04.task0443; /* A name is a name */ import java.io.*; public class Solution { public static void main(String[] args) throws Exception { //write your code here BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String x = reader.readLine(); int y = Integer.parseInt(reader.readLine()); int m = Integer.parseInt(reader.readLine()); int d = Integer.parseInt(reader.readLine()); System.out.println("My name is " + x + "."); System.out.println("I was born on " + d + "/" + m + "/" + y); } }
0
Comments (1)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Guadalupe Gagnon
Level 37 , Tampa, United States
13 March 2019, 13:25solution
it should be: I was born on mm/dd/yyyy your is: I was born on dd/mm/yyyy
+6
Learn
  • Registration
  • Java Course
  • Help with Tasks
  • Pricing
  • Game Projects
  • Java Syntax
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success Stories
  • Activity
  • Affiliate Program
Company
  • About us
  • Contacts
  • Reviews
  • Press Room
  • CodeGym for EDU
  • FAQ
  • Support
CodeGym CodeGym is an online course for learning Java programming from scratch. This course is a perfect way to master Java for beginners. It contains 1200+ tasks with instant verification and an essential scope of Java fundamentals theory. To help you succeed in education, we’ve implemented a set of motivational features: quizzes, coding projects, content about efficient learning and Java developer’s career.
Follow us
Interface language
Programmers Are Made, Not Born © 2023 CodeGym
MastercardVisa
Programmers Are Made, Not Born © 2023 CodeGym
This website uses cookies to provide you with personalized service. By using this website, you agree to our use of cookies. If you require more details, please read our Terms and Policy.