Answer to Question #260804 in Java | JSP | JSF for Dreaper

Question #260804

Using this online IDE, perform the following.

1. Initialize four (4) variables based on the table below.

Data type Variable NameValue

String firstName Your first name.

String lastName Your last name.

char mi Your middle initial

int faveNumber Your favorite number

String faveCartChar Your favorite cartoon or anime character

2. Create statements that would print an output similar to the sample below. Use '+' to combine words and variable names. 


1
Expert's answer
2021-11-03T17:30:49-0400


public class App {


	public static void main(String[] args) {


		String firstName = "Peter";
		String lastName = "Smith";
		char mi = 'F';
		int faveNumber = 7;
		String faveCartChar = "Finn";
		
		String output="My name is "+firstName+" "+mi+" "+lastName+". "+faveNumber+" is my favorite number. I love "+faveCartChar+"!";
		
		System.out.println(output);
		
	}


}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS