QuestionQuestion

Write a C program which determines the validation character for the following 10 character account codes.
Compute the validation character by summing the pairs, divide the sum by 26 to obtain the whole remainder. Finally, use the remainder to determine the validation character. Use the following set of test data to exercise your program and produce four column report below with appropriate alignment.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

#define getPairSum(d1,d2) (d1 - '0')*10 + (d2-'0') // programmer defined MACRO definition

char * getNumber(int num) {
    char * inputCode = (char *) calloc(11, sizeof (char));
    int unsuccessful = 1;
    // ask for a legal input
    while (unsuccessful == 1) {
       printf("Enter the account input code #%d (limit 10 numbers): ", num);
       scanf("%s", inputCode);

       // the length should be 10
       if (strlen(inputCode) == 10) {
            int i;
            unsuccessful = 0;
            // there should be digit only
            for (i = 0; i < 10; i++) {
                if (!isdigit(inputCode[i])) {...

By purchasing this solution you'll be able to access the following files:
Solution.c.

$18.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available C-Family Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats