Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I don't know what im doing wrong Write a program that leads a persons tilst and last names, separated by a space. Then the program
I don't know what im doing wrong
Write a program that leads a persons tilst and last names, separated by a space. Then the program outputs last name, comma, first name. End with newline. Example output if the input is: Maya Jones Jones, Maya import java.util.Scanner; 1 test passed public class SpaceReplace { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); String firstName; String lastName; All tests passed firstName = "Maya"; lastName = "Jones"; System.out.print(lastName + ", " + firstName); 14 15 } } Run X Testing with: Maya Jones Run Run x Testing with: Maya Jones Output is nearly correct; but whitespace differs. See highlights below. Special character legend Your output Jones, Maya Expected output Jones, Maya X Testing with: Stan Li Output differs. See highlights below. Special character legend Your output Jones, Maya Expected output Li, StanStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started