Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help writing code MatLab An ISBN (International Standard Book Number) consists of 10 digits: d_1 d_2 d_3 d_4 d_5 d_6 d_7 d_8 d_9 d_10. The

Help writing code MatLab image text in transcribed
An ISBN (International Standard Book Number) consists of 10 digits: d_1 d_2 d_3 d_4 d_5 d_6 d_7 d_8 d_9 d_10. The last digit d_10 is a checksum, which is calculated from the other nine digits using the following formula: d_10 = (d_1 middot 1 + d_2 middot 2 + d_3 middot 3 + d_4 middot 4 + d_5 middot 5 + d_6 middot 6 + d_7 middot 7 + d_8 middot 8 + d_9 middot 9) mod 11 where mod is short for modulus. If the checksum is 10, then the last digit is denoted X. according to the ISBN convention (recall that X is the Roman Numeral for 10). Begin by downloading the file isbn-9Numbers.txt from Blackboard. Open the file and note that there are a thousand 9-digit isbn numbers. Insert your student ID number as the first entry and the last entry to this file. If your student ID only has 8 digits, then begin It with the number 9. For program 5. write a script that reads each line from isbn-9Numbers.txt. determines the 10^th number, and outputs to both the monitor and a file named isbn-10Numbers.txt with the isbn-10 number in the correct format. That is. a dash after the first, third, and ninth numbers. So that you may troubleshoot your code, a second file, isbn- 9SevenNumbers.txt has been provided (the first 7 numbers in the original file). DO NOT TURN IN isbn-9SevenNumbers.txt. Considerations: You must include your student ID number as the first and last entry of the isbn-9Numbers.txt file. 2. For each line of isbn-9Numbers.txt, read in your input as a string, using a for-loop to step through each character. Before you may use each 'digit' in the isbn-10 formula above, you must convert the character to a number using the str2num() command. To concatenate multiple values of a character string, use the: (colon). That is. if your variable name is isbn10. then isbn10 = (isbn(1). *-*. isbn(2:3)]: would create the first part of your isbn-10 number. When outputting, be sure to include a newline such that each isbn-10 number is on its own line. Name your file ISBN.m. Include header comments and be sure to include the Honor Code statement. On Blackboard, turn in ISBN.m. isbn-9Numbers.txt. and isbn- 10Numbers.txt Do not forget to comment your code

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_2

Step: 3

blur-text-image_3

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

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions

Question

8. Describe how cultural spaces are formed.

Answered: 1 week ago

Question

U11 Informing Industry: Publicizing Contract Actions 317

Answered: 1 week ago

Question

LO2 Explain the nature of the psychological contract.

Answered: 1 week ago