Question: FOR JAVA PLEASE: SIMPLE CODE: 1 . 4 2 LAB: Input and formatted output: Right - facing arrow Given two input integers for an arrowhead
FOR JAVA PLEASE: SIMPLE CODE: LAB: Input and formatted output: Rightfacing arrow
Given two input integers for an arrowhead and arrow body, print a rightfacing arrow.
Ex: If the input is:
the output is:
import java.util.Scanner;
public class LabProgram
public static void mainString args
Scanner scnr new Scanner
System.in;
int baseChar;
int headChar;
Type your code here.
I used the following code: import java.util.Scanner;
public class LabProgram
public static void mainString args
Scanner scnr new ScannerSystemin;
System.out.printEnter the base character: ;
char baseChar scanner.nextcharAt;
System.out.printEnter the head character: ;
char headChar scanner.nextcharAt;
System.out.println headChar;
System.out.println headChar headChar;
for int i ; i ; i
for int j ; j ; j
System.out.printbaseChar;
if i i
System.out.printlnheadChar headChar headChar;
else
System.out.printlnheadChar headChar headChar headChar;
System.out.println headChar headChar;
System.out.println headChar;
scanner.close;
I received the following errors:LabProgram.java:: error: cannot find symbol
char baseChar scanner.nextcharAt;
symbol: variable scanner
location: class LabProgram
LabProgram.java:: error: cannot find symbol
char headChar scanner.nextcharAt;
symbol: variable scanner
location: class LabProgram
LabProgram.java:: error: cannot find symbol
scanner.close;
symbol: variable scanner
location: class LabProgram
errors
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
