Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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, Stan

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

Describe important components of self-regulated learning.

Answered: 1 week ago

Question

1. Are my sources credible?

Answered: 1 week ago

Question

3. Are my sources accurate?

Answered: 1 week ago

Question

1. Is it a topic you are interested in and know something about?

Answered: 1 week ago