Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c A national ID of a country uses 11 digits. national ID Formatd, d d d d d d d d, dood Example 978

image text in transcribedin c
A national ID of a country uses 11 digits. national ID Formatd, d d d d d d d d, dood Example 978 0 1 3 2 1 3 0 8 The last digit d11 is a checksum, which is calculated from the other digits using the following formula: 10 - (d1 + 3d2+d3 +34 +d5 +3d6 +d7 + 3d8+d9 +3d10)%10. If the checksum is 10, replace it with o. 1. Write a function named readString that takes only an array of character as parameter named data, reads a string of size 11 from the user, and sorelt the array data. The function should ask the user to enter a proper string of until the user enters a string of size 11 2. Write a function named checksum that takes only one input parameters str of type char" (null-terminated C strings of characters) and calculates and returns the check sum from the first 10 digits Write the main function that Prints your full name and Student ID Define a proper variable to store a c-string Properly call the function readString to read an 11-digit national ID displays valid national ID if the digit 11 equals the checksum calculated in part2 or invalid otherwise 4. Add your name, your University ID number and section number as a comment at the beginning of this program. 3. . . . . Sample Run: Name: Abdullah Aref ID:1122333 Please Enter a 11 Digit national ID:97801321308 Valid ID

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

More Books

Students also viewed these Databases questions

Question

LO1 Understand risk management and identify its components.

Answered: 1 week ago