I'm recieving a ton of errors on my Java doc for an assignment I have can anyone help me fix them?

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

I'm recieving a ton of errors on my Java doc for an assignment I have can anyone help me fix them? 

code:

package chapter.pkg6.part.pkg2.assignment;
/**
 *
 * @author matty
 */
public class Chapter6Part2Assignment {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // Method  
      long cardnumber = 4440967484181607L;
      
      System.out.println("Please enter the card number/n");
      
      System.out.println(cardnumber + " is " + (validitychk(cardnumber) ? "valid" : "invalid"));
       // Return true if the card number is valid

   public static boolean validitychk(long cnumber) {

      return (thesize(cardnumber)>=13&& thesize(cnumber)<= 16)&&(prefixmatch(cardnumber, 4)

         || prefixmatch(cardnumber,5) || prefixmatch(cnumber,37) || prefixmatch(cardnumber, 6))

         && ((sumdoubleeven(cnumber) + sumodd(cnumber)) % 10 == 0);
   }
   

 public static int sumdoubleeven(long cardnumber) {

      int sum = 0;

      String num = cardnumber + "";

      for (int i = thesize(cardnumber) - 2; i >= 0; i -= 2)

         sum += getDigit(Integer.parseInt(num.charAt(i) + "") * 2);

      return sum;

   }

   public static int getDigit(int cardnumber) {

      if (cardnumber < 9)

         return cardnumber;

      return cardnumber / 10 + cardnumber % 10;

   }
   
   public static int sumodd(long cardnumber) {

      int sum = 0;

      String num = cardnumber + "";

      for (int i = thesize(cardnumber) - 1; i >= 0; i -= 2)

         sum += Integer.parseInt(num.charAt(i) + "");

      return sum;
   }
  
   }

    
   I attached an image of the code and the error issue as well. 

 

### Java Program for Credit Card Validation

This code is a Java program used to validate a credit card number. It uses Luhn's algorithm, which involves checking the size and prefix of the card number.

#### Code Explanation

```java
/**
 * Author: [Author Name]
 * Param: args the command line arguments
 */

public class Chapter6Part2Assignment {
   
    // Main method
    public static void main(String[] args) {
        long cardnumber = 4410976841816071L;
        
        System.out.println("Please enter the card number:\n");
        
        System.out.println(cardnumber + " is " + (validitychk(cardnumber) ? "valid" : "invalid"));
        // Return true if the card number is valid
    }

    public static boolean validitychk(long cnumber) {
        return (thesize(cnumber) >= 13 && thesize(cnumber) <= 16) && (prefixmatch(cnumber, 4)
            || prefixmatch(cnumber, 5) || prefixmatch(cnumber, 6) || prefixmatch(cnumber, 37))
            && ((sumdoubleeven(cnumber) + sumodd(cnumber)) % 10 == 0);
    }

    public static int sumdoubleeven(long cardnumber) {
        int sum = 0;
        String num = cardnumber + "";
        
        for (int i = thesize(cardnumber) - 2; i >= 0; i -= 2) {
            sum += getDigit(Integer.parseInt(num.charAt(i) + "") * 2);
        }
        
        return sum;
    }

    public static int getDigit(int cardnumber) {
        if (cardnumber < 9)
            return cardnumber;
        return cardnumber / 10 + cardnumber % 10;
    }

    public static int sumodd(long cardnumber) {
        int sum = 0;
        String num = cardnumber + "";
        
        for (int i = thesize(cardnumber) - 1; i >= 0; i -= 2)
            sum += Integer.parseInt(num.charAt(i) + "");
        
        return sum;
    }

    public static boolean prefixmatch(long cardnumber, int d) {
        return getprefix(cardnumber, thesize(d)) == d;
    }

    public static int thesize(long d) {
        String num = d + "";
        return num.length();
Transcribed Image Text:### Java Program for Credit Card Validation This code is a Java program used to validate a credit card number. It uses Luhn's algorithm, which involves checking the size and prefix of the card number. #### Code Explanation ```java /** * Author: [Author Name] * Param: args the command line arguments */ public class Chapter6Part2Assignment { // Main method public static void main(String[] args) { long cardnumber = 4410976841816071L; System.out.println("Please enter the card number:\n"); System.out.println(cardnumber + " is " + (validitychk(cardnumber) ? "valid" : "invalid")); // Return true if the card number is valid } public static boolean validitychk(long cnumber) { return (thesize(cnumber) >= 13 && thesize(cnumber) <= 16) && (prefixmatch(cnumber, 4) || prefixmatch(cnumber, 5) || prefixmatch(cnumber, 6) || prefixmatch(cnumber, 37)) && ((sumdoubleeven(cnumber) + sumodd(cnumber)) % 10 == 0); } public static int sumdoubleeven(long cardnumber) { int sum = 0; String num = cardnumber + ""; for (int i = thesize(cardnumber) - 2; i >= 0; i -= 2) { sum += getDigit(Integer.parseInt(num.charAt(i) + "") * 2); } return sum; } public static int getDigit(int cardnumber) { if (cardnumber < 9) return cardnumber; return cardnumber / 10 + cardnumber % 10; } public static int sumodd(long cardnumber) { int sum = 0; String num = cardnumber + ""; for (int i = thesize(cardnumber) - 1; i >= 0; i -= 2) sum += Integer.parseInt(num.charAt(i) + ""); return sum; } public static boolean prefixmatch(long cardnumber, int d) { return getprefix(cardnumber, thesize(d)) == d; } public static int thesize(long d) { String num = d + ""; return num.length();
### Error Analysis and Troubleshooting in Java Programming

**Output Log Details:**

The following is a transcript of an output log from a Java programming environment, specifically related to an error encountered during the execution of a code snippet.

```
run:
Please enter the card number
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: chapter.pkg6.part.pkg2.assignment.Chapter6Part2Assignment.thesize
    at chapter.pkg6.part.pkg2.assignment.Chapter6Part2Assignment.validciychk(Chapter6Part2Assignment.java:27)
    at chapter.pkg6.part.pkg2.assignment.Chapter6Part2Assignment.main(Chapter6Part2Assignment.java:22)
C:\Users\matty\AppData\Local\NetBeans\Cache\12.4\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\matty\AppData\Local\NetBeans\Cache\12.4\executor-snippets\run.xml:94: Java returned: 1
BUILD FAILED (total time: 3 seconds)
```

**Explanation and Key Points:**

1. **User Input Request:**
   - The program prompts the user with "Please enter the card number," indicating it expects an input, likely for processing thereafter.

2. **Error Description:**
   - An `Exception in thread "main"` occurs, which is a common type of error that indicates something went wrong during the execution of the main method of the program.
   - The specific error is `java.lang.RuntimeException` with a message stating "Uncompilable source code - Erroneous sym type."
     - This suggests there is an error in the code's syntax or logic that prevents successful compilation.

3. **Error Location:**
   - The error is traced back to the method `validciychk` in the file `Chapter6Part2Assignment.java` at line 27.
   - Another part of the code refers to `Chapter6Part2Assignment.main` at line 22, suggesting that the main method is also involved in the error cascade.

4. **File Path and Runtime:**
   - The file paths suggest that this is executed within the NetBeans IDE, with cache directories indicating where the run files are stored.
   - The message states "BUILD FAILED (total time: 3 seconds)" confirming that the build process was
Transcribed Image Text:### Error Analysis and Troubleshooting in Java Programming **Output Log Details:** The following is a transcript of an output log from a Java programming environment, specifically related to an error encountered during the execution of a code snippet. ``` run: Please enter the card number Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: chapter.pkg6.part.pkg2.assignment.Chapter6Part2Assignment.thesize at chapter.pkg6.part.pkg2.assignment.Chapter6Part2Assignment.validciychk(Chapter6Part2Assignment.java:27) at chapter.pkg6.part.pkg2.assignment.Chapter6Part2Assignment.main(Chapter6Part2Assignment.java:22) C:\Users\matty\AppData\Local\NetBeans\Cache\12.4\executor-snippets\run.xml:111: The following error occurred while executing this line: C:\Users\matty\AppData\Local\NetBeans\Cache\12.4\executor-snippets\run.xml:94: Java returned: 1 BUILD FAILED (total time: 3 seconds) ``` **Explanation and Key Points:** 1. **User Input Request:** - The program prompts the user with "Please enter the card number," indicating it expects an input, likely for processing thereafter. 2. **Error Description:** - An `Exception in thread "main"` occurs, which is a common type of error that indicates something went wrong during the execution of the main method of the program. - The specific error is `java.lang.RuntimeException` with a message stating "Uncompilable source code - Erroneous sym type." - This suggests there is an error in the code's syntax or logic that prevents successful compilation. 3. **Error Location:** - The error is traced back to the method `validciychk` in the file `Chapter6Part2Assignment.java` at line 27. - Another part of the code refers to `Chapter6Part2Assignment.main` at line 22, suggesting that the main method is also involved in the error cascade. 4. **File Path and Runtime:** - The file paths suggest that this is executed within the NetBeans IDE, with cache directories indicating where the run files are stored. - The message states "BUILD FAILED (total time: 3 seconds)" confirming that the build process was
Expert Solution
steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY