what are the outputs from print statement respectively, If you give the user inputs below for the following program? inputs # 1: inputChar: i inputString: Wish you have a very happy holiday input #2: inputChar: e inputString: Wish you a merry Christmas import java.util.Scanner; public class LabProgram { } public static void main(String[] args) { Scanner input = new Scanner(System.in); char inputChar; String inputString: int numChars = 0; int i = 0; inputChar=input.next().charAt(0); inputString = input.nextLine(); while (i
what are the outputs from print statement respectively, If you give the user inputs below for the following program? inputs # 1: inputChar: i inputString: Wish you have a very happy holiday input #2: inputChar: e inputString: Wish you a merry Christmas import java.util.Scanner; public class LabProgram { } public static void main(String[] args) { Scanner input = new Scanner(System.in); char inputChar; String inputString: int numChars = 0; int i = 0; inputChar=input.next().charAt(0); inputString = input.nextLine(); while (i
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 8RQ
Related questions
Question
Computer Science
Java Please
![what are the outputs from print statement respectively, If you give the user inputs below for the following program?
inputs #1:
inputChar: i
inputString: Wish you have a very happy holiday
input #2:
inputChar: e
inputString: Wish you a merry Christmas
import java.util.Scanner;
public class LabProgram {
}
public static void main(String[] args) {
}
Scanner input = new Scanner(System.in);
char inputChar;
String inputString;
int numChars = 0;
int i = 0;
inputChar = input.next().charAt(0);
inputString = input.nextLine();
while (i <inputString.length()) {
}
if (inputString.charAt(i) == inputChar) {
numChars = numChars + 1;
}
i=i+1;
System.out.println(numChars);](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F41a11f92-ec66-4681-9866-6ecb7ea598eb%2F560ba064-9cca-4911-9be9-0baefec5e4a0%2Fxjo99lb_processed.png&w=3840&q=75)
Transcribed Image Text:what are the outputs from print statement respectively, If you give the user inputs below for the following program?
inputs #1:
inputChar: i
inputString: Wish you have a very happy holiday
input #2:
inputChar: e
inputString: Wish you a merry Christmas
import java.util.Scanner;
public class LabProgram {
}
public static void main(String[] args) {
}
Scanner input = new Scanner(System.in);
char inputChar;
String inputString;
int numChars = 0;
int i = 0;
inputChar = input.next().charAt(0);
inputString = input.nextLine();
while (i <inputString.length()) {
}
if (inputString.charAt(i) == inputChar) {
numChars = numChars + 1;
}
i=i+1;
System.out.println(numChars);
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,