Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/School-Work / School Work/4.18.1- LAB- Contains the character.java |
| Date | Not specified in source |
| Repository | Janady13/School-Work |
| Revision | 4a666c890caf7c43c47d0572dbcc287373c7a78e |
| Branch | main |
| Path or archive member | School Work/4.18.1- LAB- Contains the character.java |
| Original SHA-256 | d554c115b2d4212a203dadce1f9d8f170faf74dd1c097439558800314f983366 |
| Git blob SHA | 21ee61c8221273169952cd201e32f8fa5838a6df |
| Reading-copy SHA-256 | d554c115b2d4212a203dadce1f9d8f170faf74dd1c097439558800314f983366 |
Every recorded occurrence
These 2 records contain identical original source bytes. Their paths and revisions remain part of the archive.
| Original record | Branch or archive | Revision / identifier | Original location |
|---|---|---|---|
| Janady13/School-Work / School Work/4.18.1- LAB- Contains the character.java | main | 4a666c890caf7c43c47d0572dbcc287373c7a78e | Open original |
| Janady13/School-Work / School Work/School-Work/School Work/4.18.1- LAB- Contains the character.java | main | 4a666c890caf7c43c47d0572dbcc287373c7a78e | Open original |
Recovered source transcript
Download complete source text ↓44 lines · 1.1 KB
import java.util.Scanner;
public class LabProgram {
public static void main(String[] args) {
//creating object for scanner class
Scanner sc=new Scanner(System.in);
int n;
char c;
//reading an integer using scanner object
n=sc.nextInt();
//declaring a string array of size 'n'
String[] s=new String[n];
//Taking input for list of words from user
for(int i=0; i<n;i++)
{
s[i]=sc.next();
}
//reading input for character variable c
c=sc.next().charAt(0);
//Traversing through each string and checking whether
//the character is present or not.
for(int i=0; i<n;i++)
{
String str=s[i];
for(int j=0; j<str.length();j++)
{
//If character is present then string is printed
if(str.charAt(j)==c)
{
//printing the string along with comma
System.out.print(str+",");
break;
}
}
}
//Printing new line at the end of output
System.out.println();
}
}