Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ddcc2e9

Browse files
Personal Information
1 parent 5384583 commit ddcc2e9

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.challenges;
2+
3+
/*
4+
Write a program that displays the following information, each on a separate line:
5+
• Your name
6+
• Your address, with city, state, and ZIP
7+
• Your telephone number
8+
• Your college major
9+
Although these items should be displayed on separate output lines,
10+
use only a single println statement in your program.
11+
*/
12+
13+
public class PersonalInformation {
14+
public static void main(String [] args) {
15+
16+
//Declare Variables
17+
18+
String name = "Nishant Nirmal";
19+
String street = "Model Colony";
20+
String city = "Pune";
21+
String state = "Maharashtra";
22+
String zip = "410016";
23+
String telephone = "8734920289";
24+
String collegeMajor = "Computer Science";
25+
26+
System.out.println(name + "\n" + street + ", " + city + ", " + state + " - " + zip + "\n" + telephone + "\n" + collegeMajor);
27+
}
28+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /