Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write C code Please answer carefully and faaaast within 60 minutes A student ID of a university uses 15 digits student ID Formatd,dyd,dade do dod

Write C code
Please answer carefully and faaaast within 60 minutes
image text in transcribed
A student ID of a university uses 15 digits student ID Formatd,dyd,dade do dod dodaod11d12d1d1adus Example 9 7 8 0 1 3 2 1 3 0 8 OOO 6 0 The last digit d15 is a checksum, which is calculated from the other digits using the following formula: 10- (d1 +3d2 +d3 + 3d4 +d5 + 3d6+d7+ 3d8 + d9+ 3d10 +011+3d12+d13+3d14)%10. If the checksum is 10, replace it with 0. 1. Write a function named readString that takes only an array of character as parameter named data, reads a string of size 13 from the user, and sore it the array data. The function should ask the user to enter a proper string of until the user enters a string of size 15 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 3. 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 a 15-digit student ID Displays valid student ID if digit 15 equals the checksum calculated in part2 or invalid otherwise

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions