Am I missing a bracket??? Or is there a bracket out of place??? Error missing Cl
ID: 3582060 • Letter: A
Question
Am I missing a bracket??? Or is there a bracket out of place???
Error missing Class Enum Expected.... cant find the issue ... please help!!!!
public static void Main()
{
private int findIndex(String[] phishingWords, tangible.RefObject<String> str)
{
int i;
for (i = 0; i < 30; i++)
{
if (strcmp(phishingWords[i], str.argValue) == 0)
{
System.out.printf(" %-25s %-30s %-30s ", "Word", "Number of Occurrence", "Point Total");
System.out.print(" -------------------------------------------------------------------- ");
for (i = 0; i < 30; i++)
{
if (numOccurrences[i] != 0)
{
System.out.printf(" %-30s %-30d %-30d ", phishingWords[i], numOccurrences[i], pointTotal[i]);
}
}
System.out.printf(" Point total for the entire message: %d ", totalPointTotal);
//Return index if matches
return i;
}
}
return -1;
}
String[] phishingWords = {"amazon", "official", "bank", "security", "urgent", "alert", "important", "information", "ebay", "password", "credit", "verify", "confirm", "account", "bill", "immediately", "address", "telephone", "ssn", "charity", "check", "secure", "personal", "confidential", "atm", "warning", "fraud", "citibank", "irs", "paypal"};
int[] phishingPoints = {2, 2, 1, 1, 1, 1, 1, 2, 3, 3, 3, 1, 1, 1, 1, 1, 2, 2, 3, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1};
int[] numOccurrences = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int[] pointTotal = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int totalPointTotal = 0;
FILE fp;
String str = new String(new char[30]);
int index;
int i;
fp = fopen("data.txt", "r");
while (!feof(fp))
{
fscanf(fp, " %s ", str);
tangible.RefObject<String> tempRef_str = new tangible.RefObject<String>(str);
index = findIndex(phishingWords, tempRef_str);
str = tempRef_str.argValue;
if (index != -1)
{
numOccurrences[index] += 1;
pointTotal[index] += phishingPoints[index];
totalPointTotal += pointTotal[index];
}
}
//Closing file
fclose(fp);
return 0;
}
Explanation / Answer
Please follow the data and description :
You miss the class declaration.
public class Example {
public static void main(Strin[] args) {.........}
}
The format needs to be implemented as the above as in java every code needs to be implemented inside a class that makes the code wrapped up into a single unit so that it could follow the OOP principles.
Hope this is helpful.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.