Ask coding questions

← Back to all posts
Qwerty Ask 2#
[deleted]

This is the code of Hi! I'm Qwerty.
There are 3 errors.
Hint: Check the link to see my original Hi! I'm Qwerty
https://replit.com/@Youloob/Hi-Im-Qwerty?v=1

Answered by Coder100 (17013) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (17013)

There's a lot more than three...

Formatting

Should be consistent, so you should have:

class Main
{
  public static void main(...)
  {

Security

Don't forget to do read.close at the end

Strings

Don't forget to encapsulate "

Classes

Don't forget to call the constructor using new

Methods

Java is different from C#. Methods are likeThis and not LikeThis. So, it is nextInt, not NextInt

All together

import java.util.Scanner;
class Main
{
  public static void main(String[] args)
  {
    System.out.println(" Hi Unknown Person");
    Scanner read = new Scanner(System.in);
    System.out.print("Enter your name so I know who you are: ");
    String nameKid = read.next();
    System.out.print("Enter your age. Yeah. : ");
    int ageKid = read.nextInt();
    System.out.println("Hi uh. I forgot your name. Oh! It's " +  nameKid + " I'm  " +  ageKid + " to! " + ", A tornado is coming your way! Run! ");
    read.close();
  }
}
[deleted]

oh

[deleted]

Can someone lend me their codes so I can make Qwerty Asks #3?

[deleted]

No homework.

SixBeeps (5062)

Line 11, you forgot the starting "

[deleted]

I'm a starter in coding so I'm gonna say ???

ch1ck3n (1626)

Please don't post homework here