ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/School-Work / School Work/WordFrequencies.java

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/School-Work / School Work/WordFrequencies.java
DateNot specified in source
RepositoryJanady13/School-Work
Revision4a666c890caf7c43c47d0572dbcc287373c7a78e
Branchmain
Path or archive memberSchool Work/WordFrequencies.java
Original SHA-256fafed41f2682dc0e499b96d8f9578615f9f379f2b4afe64c25b14b7a4835370c
Git blob SHA25c1f1e51c11e02964e071fcaee3e8f7fe54de6d
Reading-copy SHA-256fafed41f2682dc0e499b96d8f9578615f9f379f2b4afe64c25b14b7a4835370c

Original source ↗

Recovered source transcript

import java.util.Scanner; public class LabProgram { // main method public static void main(String[] args) { // creating an object of scanner class named sc Scanner sc = new Scanner(System.in); // taking the number of words to be given input from the user and storing it in variable n int n = sc.nextInt(); // creating an array of string of size n named arr String arr[] = new String[n]; // loop to take the words input from the user for (int i = 0; i < n; i++) // taking the word input from the user and storing it at i th location in array arr arr[i] = sc.next(); // for-each loop to count the frequency of each word for (String s : arr) // calling method getWordFrequency, passing array arr, number of elements in arr and the current word as argument and printing the value returned by the function System.out.println(s + " " + getWordFrequency(arr, n, s)); // closing the object of scanner class sc.close(); } // defining method getWordFrequency that takes a string array, size of string array and a string as parameter public static int getWordFrequency(String[] wordsList, int listSize, String currWord) { // declaring and initializing an integer variable named count to 0 int count = 0; // for loop to count to the frequency of the value in variable currWord in array wordsList for (int i = 0; i < listSize; i++) // checking if the value at i th location in array wordsList is equal to the value in variable currWord, ignoring the case if (wordsList[i].equalsIgnoreCase(currWord)) // if they are equal then value in variable count is incremented by 1 count++; // returning the value in variable count return count; } }

Search equations, builds, manuscript text, and recovered sources.