Hi, I have done the programming and it says my program is working fine but not according to the expectation. will anyone please guide me what else should I do .. below is my programming

  /*String a = "My name is Amigo.";
    String b = ""
    String c = "My salary for the first year will be $60,000";
    String d = "My salary for the first year will be $80,000";
    String e = "My salary for the first year will be $100,000";
    String f = "My salary for the first year will be $120,000";
    String g = "My salary for the first year will be $150,000";
    String h = "";
    String i = "Kiss my shiny metal ass!";*/
    System.out.println("My name is Amigo.");
    System.out.println("");
    System.out.println("My salary for the first year will be $60,000");
    System.out.println("My salary for the first year will be $80,000");
    System.out.println("My salary for the first year will be $100,000");
    System.out.println("My salary for the first year will be $120,000");
    System.out.println("My salary for the first year will be $150,000");
    System.out.println("");
    System.out.println("Kiss my shiny metal ass!");

I HAVE TRIED BOTH WAYS TO SOLVE THIS. BOTH WAYS ARE FINE BUT NOT ACCORDING TO EXPECTATION. First one was the upper part but i have made a comment mark because im not using it for the next test. then I tried the next way, which is direct printing.

}

}

asked 12 Apr '15, 03:18

shariq15's gravatar image

shariq15
1215
accept rate: 0%


The task was to write a program that displays display:

"My name is Amigo.

My salary for the first year will be $60,000
My salary for the second year will be $80,000
My salary for the third year will be $100,000
My salary for the fourth year will be $120,000
My salary for the fifth year will be $150,000

Kiss my shiny metal ass!"

And you wrote "for the first year" on each line. BTW, you don't need quotation marks in empty System.out.println().

link

answered 12 Apr '15, 06:11

Andrey's gravatar image

Andrey
1323
accept rate: 35%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×42
×7

Asked: 12 Apr '15, 03:18

Seen: 1,623 times

Last updated: 12 Apr '15, 06:11