English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Write a program called emailaddress that read from the standard input, keyboard input, a users first name and last name. The program should then generate an email address based on the following scheme: take the last name and make the first letter capital letter and the rest of the last name all lower case letter. Take this new last name and appended to it the first letter of the first name in lower case letter. Finally append @hotmail.com to the end of the string. Display the newly generated email address. You can assume no blanks in the first or last name.

Sample input:
Please enter first name:
Shereef
Please enter last name
abualmaati

Sample output:
Your user name is: Abualmaatis@hotmail.com

2007-03-12 18:51:02 · 1 answers · asked by LULU 1 in Computers & Internet Programming & Design

1 answers

I've tried to code in Answers and Yahoo won't allow full code. I love java. I can only show you the outline

class Emailaddress {
public static void main (String args[]) {
String fname,lname = null;
String maddrs ="@hotmail.com";
System.out.println("Wut is ur n...
try{
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String s;
while((s=br.readLine()) != null
fname = s.toLowerCase();
}
// repeat above block
...
String l = s.toLowerCase();
String c = s.charAt(0);
c = c.toUpperCase();
String f = lname.substring(1);
lname = c + f;
}
String mailaddy = lname+fname+mail
System.out.print("your name + mailaddy

good luck

2007-03-12 19:33:03 · answer #1 · answered by Anonymous · 0 0

fedest.com, questions and answers