Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are hired by a college to write a Java program to use a so-called check sum technique for catching typing errors of student ID.
You are hired by a college to write a Java program to use a so-called check sum technique for catching typing errors of student ID. The college assigns a seven-digit number to each student. The seventh digit (i.e., the rightmost digit) is determined from the other digits with the use of the following formula: 7th digit = (1 *(1st digit) * 2 * (2nd digit) * ... * 6 * (6th digit)) % 10 Your program should prompt users to enter a 7-digit number as a student ID, and then display the validity of the entered ID by matching the actual 7th digit with the computed 7th digit. For example, the entered ID 1 2 3 4 5 6 7 is invalid because the computed 7th digit is 1 (= 1 + 1 + 2 + 2 + 3 + 3 + 4 + 4 + 5 + 5 + 6 + 6) 10) and is different from the actual 7th digit which is 7. However, if the entered ID is 1 2 3 4 5 6 1 your program shall display a message of acceptance. User interface specifications: Input The program prompts for a 7-digit student ID. You can assume users will enter 7 consecutive digital characters. Output Display a message to report the validity of the entered student ID. The output should be descriptive and friendly to end users
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started