SlideShare a Scribd company logo
ECE175 Computer Programming for Engineering Applications Homework Assignment 6
complete solutions correct answers key
Find the solution at
http://www.coursemerit.com/solution-details/15101/ECE175-Homework-Assignment-6-complete-solutions-correct-answers-key
Conventions: Name your C programs as hwxpy.c
where x corresponds to the homework number and y corresponds to the problem number.
Write comments to your programs. Programs with no comments will receive PARTIAL
credit. For each program that you turn in, at least the following information should be
included
- Author:
- Date created:
- Brief (two lines) description of the program:
Submission Instructions: Submit your .c files via D2L Dropbox.
Problem 1 (35 pts): IMEI (International Mobile Equipment Identifier)
Every mobile phone operating in wireless networks is characterized by a unique identifier
of 15 digits, called IMEI
(https://en.wikipedia.org/wiki/International_Mobile_Station_Equipment_Identity)
A method to check if the device is really made by the official manufacturer is to compare the
IMEI’s last digit, called Luhn digit, with a check digit. If the Luhn digit is equal to the check
digit, the device is most probably authentic. Otherwise, it is not authentic for sure.
The check digit is calculated as follows:
1) First, we calculate the SUM of the first IMEI’s 14 digits by adding
a) the digits in the odd positions (meaning even index for the array in C)
b) the double of the digits in the even positions. But if the double of the digit is a two-digit
number, we add each digit separately. For example, suppose that the value of the digit is 8,
its double is 16. We therefore add to the SUM the result of 1+6 = 7 (not 16).
2) If the last digit of the calculated SUM is 0, that is the check digit. If not, we subtract the
last digit of the calculated SUM from 10 and that is the check digit.
For example: let’s check the IMEI 357683036257378.
Note: the last digit of the given IMEI above is 8 which is the Luhn digit.
Apply the above algorithm (by hand) to the first 14 digits, we get
3 + (2x5) +7 + (2x6) + 8 + (2x3) + 0 + (2x3) + 6 + (2x2) + 5+ (2x7) + 3+ (2x7)
3 + (10) +7 + (12) + 8 + (6) + 0 + (6) + 6 + (4) + 5+ (14) + 3+ (14)
3 + (1+0) +7 + (1+2) + 8 + (6) + 0 + (6) + 6 + (4) + 5+ (1+4) + 3+ (1+4)
3 + (1) +7 + (3) + 8 + (6) + 0 + (6) + 6 + (4) + 5+ (5) + 3+ (5)
= 62
Then the check digit = 10 – 2 = 8.
Since the check digit (=8) is equal to the Luhn digit (=8), this IMEI is valid. 2
Write a C program that
- Prompt the user to enter the 15 digits of IMEI separated by spaces. The program should
store the digits in an integer array.
- Display the sum of the first 14 digits using the algorithm on the previous page
- Calculate and display the check digit, and
- Compare it to the Luhn digit. If they match, output with the message “IMEI is valid.” If not,
output with the message “IMEI is invalid”.
Sample Code Execution: Digits are entered by a user
Enter 15-digit barcode (separate each digit by space)
3 5 7 6 8 3 0 3 6 2 5 7 3 7 8
total sum of 14 digits = 62
check digit = 8
IMEI is valid
Enter 15-digit barcode (separate each digit by space)
3 5 7 6 1 3 0 0 4 4 4 8 4 8 5
total sum of 14 digits = 55
check digit = 5
IMEI is valid
Enter 15-digit barcode (separate each digit by space)
4 9 0 1 5 4 2 0 3 2 3 7 5 1 9
total sum of 14 digits = 52
check digit = 8
IMEI is invalid
Enter 15-digit barcode (separate each digit by space)
0 1 2 6 4 6 0 0 0 8 2 7 7 6 2
total sum of 14 digits = 38
check digit = 2
IMEI is valid
Enter 15-digit barcode (separate each digit by space)
3 5 2 2 5 5 0 1 0 1 3 2 8 3 7
total sum of 14 digits = 41
check digit = 9
IMEI is invalid 3
Problem 2 (35 pts): A two-
represent a terrain of land where each element is elevation information (i.e. height in feet).
For this problem, we want to determine number and location of peaks in the terrain, where
a peak is a point that has lower elevations all around. We also want to determine the highest
peak and its location.
How to decide whether a location (i, j) is a peak:
For 2-D
array
below,
each
element,
except
those on
the
boundarie
s (edges),
has
exactly 8
neighbori
ng cells
(e.g.
Above,
Below,
Left, Right,
and four
Diagonals)
. Diagonal
#1 11al1)
Above Diagonal
#2
Left (i, j) Right
Diagonal
#3
Below Diagonal
#4

More Related Content

What's hot

Chapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsChapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
SSE_AndyLi
 
07Decoders121
07Decoders12107Decoders121
07Decoders121
Tatyana Remayeva
 
GSP 215 Inspiring Innovation/tutorialrank.com
GSP 215 Inspiring Innovation/tutorialrank.comGSP 215 Inspiring Innovation/tutorialrank.com
GSP 215 Inspiring Innovation/tutorialrank.com
jonhson129
 
GSP 215 Enhance teaching/tutorialrank.com
 GSP 215 Enhance teaching/tutorialrank.com GSP 215 Enhance teaching/tutorialrank.com
GSP 215 Enhance teaching/tutorialrank.com
jonhson300
 
Computer architecture data representation
Computer architecture  data representationComputer architecture  data representation
Computer architecture data representation
Anil Pokhrel
 
Synthesized report on the comparison of lut and splitting method for decrypti...
Synthesized report on the comparison of lut and splitting method for decrypti...Synthesized report on the comparison of lut and splitting method for decrypti...
Synthesized report on the comparison of lut and splitting method for decrypti...
eSAT Journals
 
Basic electronics
Basic electronicsBasic electronics
Basic electronics
Mantra VLSI
 
GSP 215 Effective Communication - tutorialrank.com
GSP 215  Effective Communication - tutorialrank.comGSP 215  Effective Communication - tutorialrank.com
GSP 215 Effective Communication - tutorialrank.com
Bartholomew35
 
Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
Balakrishna Chowdary
 
Chapter 01 Basic Principles of Digital Systems
Chapter 01 Basic Principles of Digital SystemsChapter 01 Basic Principles of Digital Systems
Chapter 01 Basic Principles of Digital Systems
SSE_AndyLi
 
Implementation of character translation integer and floating point values
Implementation of character translation integer and floating point valuesImplementation of character translation integer and floating point values
Implementation of character translation integer and floating point values
غزالة
 
Arithmetic for Computers
Arithmetic for ComputersArithmetic for Computers
Arithmetic for Computers
MD. ABU TALHA
 
1.3 Complex Numbers
1.3 Complex Numbers1.3 Complex Numbers
1.3 Complex Numbers
smiller5
 
GSP 215 RANK Achievement Education--gsp215rank.com
GSP 215 RANK Achievement Education--gsp215rank.comGSP 215 RANK Achievement Education--gsp215rank.com
GSP 215 RANK Achievement Education--gsp215rank.com
claric169
 
GSP 215 RANK Become Exceptional--gsp215rank.com
GSP 215 RANK Become Exceptional--gsp215rank.comGSP 215 RANK Become Exceptional--gsp215rank.com
GSP 215 RANK Become Exceptional--gsp215rank.com
claric119
 
Decoding Parity Code Error(S): Analysis Of Algorithmic Method Of Hamming Code...
Decoding Parity Code Error(S): Analysis Of Algorithmic Method Of Hamming Code...Decoding Parity Code Error(S): Analysis Of Algorithmic Method Of Hamming Code...
Decoding Parity Code Error(S): Analysis Of Algorithmic Method Of Hamming Code...
inventionjournals
 
Unsigned and Signed fixed point Addition and subtraction
Unsigned and Signed  fixed point Addition and subtractionUnsigned and Signed  fixed point Addition and subtraction
Unsigned and Signed fixed point Addition and subtraction
ciyamala kushbu
 

What's hot (20)

Chapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsChapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
 
07Decoders121
07Decoders12107Decoders121
07Decoders121
 
GSP 215 Inspiring Innovation/tutorialrank.com
GSP 215 Inspiring Innovation/tutorialrank.comGSP 215 Inspiring Innovation/tutorialrank.com
GSP 215 Inspiring Innovation/tutorialrank.com
 
GSP 215 Enhance teaching/tutorialrank.com
 GSP 215 Enhance teaching/tutorialrank.com GSP 215 Enhance teaching/tutorialrank.com
GSP 215 Enhance teaching/tutorialrank.com
 
Computer architecture data representation
Computer architecture  data representationComputer architecture  data representation
Computer architecture data representation
 
Synthesized report on the comparison of lut and splitting method for decrypti...
Synthesized report on the comparison of lut and splitting method for decrypti...Synthesized report on the comparison of lut and splitting method for decrypti...
Synthesized report on the comparison of lut and splitting method for decrypti...
 
Basic electronics
Basic electronicsBasic electronics
Basic electronics
 
Digital Logic Rcs
Digital Logic RcsDigital Logic Rcs
Digital Logic Rcs
 
GSP 215 Effective Communication - tutorialrank.com
GSP 215  Effective Communication - tutorialrank.comGSP 215  Effective Communication - tutorialrank.com
GSP 215 Effective Communication - tutorialrank.com
 
09 Arithmetic
09  Arithmetic09  Arithmetic
09 Arithmetic
 
05 multiply divide
05 multiply divide05 multiply divide
05 multiply divide
 
Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
 
Chapter 01 Basic Principles of Digital Systems
Chapter 01 Basic Principles of Digital SystemsChapter 01 Basic Principles of Digital Systems
Chapter 01 Basic Principles of Digital Systems
 
Implementation of character translation integer and floating point values
Implementation of character translation integer and floating point valuesImplementation of character translation integer and floating point values
Implementation of character translation integer and floating point values
 
Arithmetic for Computers
Arithmetic for ComputersArithmetic for Computers
Arithmetic for Computers
 
1.3 Complex Numbers
1.3 Complex Numbers1.3 Complex Numbers
1.3 Complex Numbers
 
GSP 215 RANK Achievement Education--gsp215rank.com
GSP 215 RANK Achievement Education--gsp215rank.comGSP 215 RANK Achievement Education--gsp215rank.com
GSP 215 RANK Achievement Education--gsp215rank.com
 
GSP 215 RANK Become Exceptional--gsp215rank.com
GSP 215 RANK Become Exceptional--gsp215rank.comGSP 215 RANK Become Exceptional--gsp215rank.com
GSP 215 RANK Become Exceptional--gsp215rank.com
 
Decoding Parity Code Error(S): Analysis Of Algorithmic Method Of Hamming Code...
Decoding Parity Code Error(S): Analysis Of Algorithmic Method Of Hamming Code...Decoding Parity Code Error(S): Analysis Of Algorithmic Method Of Hamming Code...
Decoding Parity Code Error(S): Analysis Of Algorithmic Method Of Hamming Code...
 
Unsigned and Signed fixed point Addition and subtraction
Unsigned and Signed  fixed point Addition and subtractionUnsigned and Signed  fixed point Addition and subtraction
Unsigned and Signed fixed point Addition and subtraction
 

Similar to Ece175 computer programming for engineering applications homework assignment 6 complete solutions correct answers key

1 ECE 175 Computer Programming for Engineering Applica.docx
1  ECE 175 Computer Programming for Engineering Applica.docx1  ECE 175 Computer Programming for Engineering Applica.docx
1 ECE 175 Computer Programming for Engineering Applica.docx
oswald1horne84988
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans incnayakq
 
Design and implementation of single bit error correction linear block code sy...
Design and implementation of single bit error correction linear block code sy...Design and implementation of single bit error correction linear block code sy...
Design and implementation of single bit error correction linear block code sy...
TELKOMNIKA JOURNAL
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
PVS-Studio
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
Andrey Karpov
 
ch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.pptch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.ppt
Mahyuddin8
 
CODING QUESTIONS.pptx
CODING QUESTIONS.pptxCODING QUESTIONS.pptx
CODING QUESTIONS.pptx
rani marri
 
Cis 115 Education Organization / snaptutorial.com
Cis 115 Education Organization / snaptutorial.comCis 115 Education Organization / snaptutorial.com
Cis 115 Education Organization / snaptutorial.com
Baileya126
 
C # (2)
C # (2)C # (2)
Devry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functions
noahjamessss
 
Devry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functions
govendaagoovenda
 
Nossi Ch 1
Nossi Ch 1Nossi Ch 1
Nossi Ch 1
lesaturner
 
Cis 115 Effective Communication / snaptutorial.com
Cis 115  Effective Communication / snaptutorial.comCis 115  Effective Communication / snaptutorial.com
Cis 115 Effective Communication / snaptutorial.com
Baileyao
 
Cis 115 Education Organization -- snaptutorial.com
Cis 115   Education Organization -- snaptutorial.comCis 115   Education Organization -- snaptutorial.com
Cis 115 Education Organization -- snaptutorial.com
DavisMurphyB99
 
CIS 115 Education Specialist / snaptutorial.com
CIS 115  Education Specialist / snaptutorial.comCIS 115  Education Specialist / snaptutorial.com
CIS 115 Education Specialist / snaptutorial.com
McdonaldRyan138
 
I need help coming up with a MIPS program for this.1.3. Overvi.pdf
I need help coming up with a MIPS program for this.1.3. Overvi.pdfI need help coming up with a MIPS program for this.1.3. Overvi.pdf
I need help coming up with a MIPS program for this.1.3. Overvi.pdf
pratyushraj61
 

Similar to Ece175 computer programming for engineering applications homework assignment 6 complete solutions correct answers key (20)

1 ECE 175 Computer Programming for Engineering Applica.docx
1  ECE 175 Computer Programming for Engineering Applica.docx1  ECE 175 Computer Programming for Engineering Applica.docx
1 ECE 175 Computer Programming for Engineering Applica.docx
 
17 Jo P May 08
17 Jo P May 0817 Jo P May 08
17 Jo P May 08
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans inc
 
Design and implementation of single bit error correction linear block code sy...
Design and implementation of single bit error correction linear block code sy...Design and implementation of single bit error correction linear block code sy...
Design and implementation of single bit error correction linear block code sy...
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
 
ch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.pptch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.ppt
 
Final Report
Final ReportFinal Report
Final Report
 
Algorithms with-java-1.0
Algorithms with-java-1.0Algorithms with-java-1.0
Algorithms with-java-1.0
 
CODING QUESTIONS.pptx
CODING QUESTIONS.pptxCODING QUESTIONS.pptx
CODING QUESTIONS.pptx
 
Number Systems
Number  SystemsNumber  Systems
Number Systems
 
Cis 115 Education Organization / snaptutorial.com
Cis 115 Education Organization / snaptutorial.comCis 115 Education Organization / snaptutorial.com
Cis 115 Education Organization / snaptutorial.com
 
C # (2)
C # (2)C # (2)
C # (2)
 
Devry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functions
 
Devry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functions
 
Nossi Ch 1
Nossi Ch 1Nossi Ch 1
Nossi Ch 1
 
Cis 115 Effective Communication / snaptutorial.com
Cis 115  Effective Communication / snaptutorial.comCis 115  Effective Communication / snaptutorial.com
Cis 115 Effective Communication / snaptutorial.com
 
Cis 115 Education Organization -- snaptutorial.com
Cis 115   Education Organization -- snaptutorial.comCis 115   Education Organization -- snaptutorial.com
Cis 115 Education Organization -- snaptutorial.com
 
CIS 115 Education Specialist / snaptutorial.com
CIS 115  Education Specialist / snaptutorial.comCIS 115  Education Specialist / snaptutorial.com
CIS 115 Education Specialist / snaptutorial.com
 
I need help coming up with a MIPS program for this.1.3. Overvi.pdf
I need help coming up with a MIPS program for this.1.3. Overvi.pdfI need help coming up with a MIPS program for this.1.3. Overvi.pdf
I need help coming up with a MIPS program for this.1.3. Overvi.pdf
 

More from Song Love

Psyc 355 lab project overview and instructions complete solutions correct ans...
Psyc 355 lab project overview and instructions complete solutions correct ans...Psyc 355 lab project overview and instructions complete solutions correct ans...
Psyc 355 lab project overview and instructions complete solutions correct ans...
Song Love
 
Economics 248 assignment 2 (version a) complete solutions correct answers key
Economics 248 assignment 2 (version a) complete solutions correct answers keyEconomics 248 assignment 2 (version a) complete solutions correct answers key
Economics 248 assignment 2 (version a) complete solutions correct answers key
Song Love
 
Acc330 cumulative project complete solutions correct answers key
Acc330 cumulative project complete solutions correct answers keyAcc330 cumulative project complete solutions correct answers key
Acc330 cumulative project complete solutions correct answers key
Song Love
 
Itm310 problem solving #7 complete solutions correct answers key
Itm310 problem solving #7 complete solutions correct answers keyItm310 problem solving #7 complete solutions correct answers key
Itm310 problem solving #7 complete solutions correct answers key
Song Love
 
Case study instructions director’s request for p cs complete solutions correc...
Case study instructions director’s request for p cs complete solutions correc...Case study instructions director’s request for p cs complete solutions correc...
Case study instructions director’s request for p cs complete solutions correc...
Song Love
 
Tutorial 8 based on lectures 22 24 (tg) complete solutions correct answers key
Tutorial 8 based on lectures 22 24 (tg) complete solutions correct answers keyTutorial 8 based on lectures 22 24 (tg) complete solutions correct answers key
Tutorial 8 based on lectures 22 24 (tg) complete solutions correct answers key
Song Love
 
Statistics 141 homework 6 complete solutions correct answers key
Statistics 141 homework 6 complete solutions correct answers keyStatistics 141 homework 6 complete solutions correct answers key
Statistics 141 homework 6 complete solutions correct answers key
Song Love
 
Liberty university busi 313 quiz 4 complete solutions correct answers slideshare
Liberty university busi 313 quiz 4 complete solutions correct answers slideshareLiberty university busi 313 quiz 4 complete solutions correct answers slideshare
Liberty university busi 313 quiz 4 complete solutions correct answers slideshare
Song Love
 
Liberty university busi 313 quiz 3 complete solutions correct answers slideshare
Liberty university busi 313 quiz 3 complete solutions correct answers slideshareLiberty university busi 313 quiz 3 complete solutions correct answers slideshare
Liberty university busi 313 quiz 3 complete solutions correct answers slideshare
Song Love
 
Liberty university busi 313 quiz 2 complete solutions correct answers slideshare
Liberty university busi 313 quiz 2 complete solutions correct answers slideshareLiberty university busi 313 quiz 2 complete solutions correct answers slideshare
Liberty university busi 313 quiz 2 complete solutions correct answers slideshare
Song Love
 
Liberty university busi 311 quiz 8 complete solutions correct answers slideshare
Liberty university busi 311 quiz 8 complete solutions correct answers slideshareLiberty university busi 311 quiz 8 complete solutions correct answers slideshare
Liberty university busi 311 quiz 8 complete solutions correct answers slideshare
Song Love
 
Liberty university busi 311 quiz 7 complete solutions correct answers slideshare
Liberty university busi 311 quiz 7 complete solutions correct answers slideshareLiberty university busi 311 quiz 7 complete solutions correct answers slideshare
Liberty university busi 311 quiz 7 complete solutions correct answers slideshare
Song Love
 
Liberty university busi 311 quiz 5 complete solutions correct answers slideshare
Liberty university busi 311 quiz 5 complete solutions correct answers slideshareLiberty university busi 311 quiz 5 complete solutions correct answers slideshare
Liberty university busi 311 quiz 5 complete solutions correct answers slideshare
Song Love
 
Liberty university busi 311 quiz 4 complete solutions correct answers slideshare
Liberty university busi 311 quiz 4 complete solutions correct answers slideshareLiberty university busi 311 quiz 4 complete solutions correct answers slideshare
Liberty university busi 311 quiz 4 complete solutions correct answers slideshare
Song Love
 
Liberty university busi 311 quiz 3 complete solutions correct answers slideshare
Liberty university busi 311 quiz 3 complete solutions correct answers slideshareLiberty university busi 311 quiz 3 complete solutions correct answers slideshare
Liberty university busi 311 quiz 3 complete solutions correct answers slideshare
Song Love
 
Psyc 355 spss homework 2 complete solutions correct answers key
Psyc 355 spss homework 2 complete solutions correct answers keyPsyc 355 spss homework 2 complete solutions correct answers key
Psyc 355 spss homework 2 complete solutions correct answers key
Song Love
 
1 3 my statlab module one problem set complete solutions correct answers key
1 3 my statlab module one problem set complete solutions correct answers key1 3 my statlab module one problem set complete solutions correct answers key
1 3 my statlab module one problem set complete solutions correct answers key
Song Love
 
Liberty university psyc 101 quiz 14 solutions answers slideshare
Liberty university psyc 101 quiz 14 solutions answers slideshareLiberty university psyc 101 quiz 14 solutions answers slideshare
Liberty university psyc 101 quiz 14 solutions answers slideshare
Song Love
 
Liberty university psyc 101 quiz 13 solutions answers slideshare
Liberty university psyc 101 quiz 13 solutions answers slideshareLiberty university psyc 101 quiz 13 solutions answers slideshare
Liberty university psyc 101 quiz 13 solutions answers slideshare
Song Love
 
Liberty university psyc 101 quiz 12 solutions answers slideshare
Liberty university psyc 101 quiz 12 solutions answers slideshareLiberty university psyc 101 quiz 12 solutions answers slideshare
Liberty university psyc 101 quiz 12 solutions answers slideshare
Song Love
 

More from Song Love (20)

Psyc 355 lab project overview and instructions complete solutions correct ans...
Psyc 355 lab project overview and instructions complete solutions correct ans...Psyc 355 lab project overview and instructions complete solutions correct ans...
Psyc 355 lab project overview and instructions complete solutions correct ans...
 
Economics 248 assignment 2 (version a) complete solutions correct answers key
Economics 248 assignment 2 (version a) complete solutions correct answers keyEconomics 248 assignment 2 (version a) complete solutions correct answers key
Economics 248 assignment 2 (version a) complete solutions correct answers key
 
Acc330 cumulative project complete solutions correct answers key
Acc330 cumulative project complete solutions correct answers keyAcc330 cumulative project complete solutions correct answers key
Acc330 cumulative project complete solutions correct answers key
 
Itm310 problem solving #7 complete solutions correct answers key
Itm310 problem solving #7 complete solutions correct answers keyItm310 problem solving #7 complete solutions correct answers key
Itm310 problem solving #7 complete solutions correct answers key
 
Case study instructions director’s request for p cs complete solutions correc...
Case study instructions director’s request for p cs complete solutions correc...Case study instructions director’s request for p cs complete solutions correc...
Case study instructions director’s request for p cs complete solutions correc...
 
Tutorial 8 based on lectures 22 24 (tg) complete solutions correct answers key
Tutorial 8 based on lectures 22 24 (tg) complete solutions correct answers keyTutorial 8 based on lectures 22 24 (tg) complete solutions correct answers key
Tutorial 8 based on lectures 22 24 (tg) complete solutions correct answers key
 
Statistics 141 homework 6 complete solutions correct answers key
Statistics 141 homework 6 complete solutions correct answers keyStatistics 141 homework 6 complete solutions correct answers key
Statistics 141 homework 6 complete solutions correct answers key
 
Liberty university busi 313 quiz 4 complete solutions correct answers slideshare
Liberty university busi 313 quiz 4 complete solutions correct answers slideshareLiberty university busi 313 quiz 4 complete solutions correct answers slideshare
Liberty university busi 313 quiz 4 complete solutions correct answers slideshare
 
Liberty university busi 313 quiz 3 complete solutions correct answers slideshare
Liberty university busi 313 quiz 3 complete solutions correct answers slideshareLiberty university busi 313 quiz 3 complete solutions correct answers slideshare
Liberty university busi 313 quiz 3 complete solutions correct answers slideshare
 
Liberty university busi 313 quiz 2 complete solutions correct answers slideshare
Liberty university busi 313 quiz 2 complete solutions correct answers slideshareLiberty university busi 313 quiz 2 complete solutions correct answers slideshare
Liberty university busi 313 quiz 2 complete solutions correct answers slideshare
 
Liberty university busi 311 quiz 8 complete solutions correct answers slideshare
Liberty university busi 311 quiz 8 complete solutions correct answers slideshareLiberty university busi 311 quiz 8 complete solutions correct answers slideshare
Liberty university busi 311 quiz 8 complete solutions correct answers slideshare
 
Liberty university busi 311 quiz 7 complete solutions correct answers slideshare
Liberty university busi 311 quiz 7 complete solutions correct answers slideshareLiberty university busi 311 quiz 7 complete solutions correct answers slideshare
Liberty university busi 311 quiz 7 complete solutions correct answers slideshare
 
Liberty university busi 311 quiz 5 complete solutions correct answers slideshare
Liberty university busi 311 quiz 5 complete solutions correct answers slideshareLiberty university busi 311 quiz 5 complete solutions correct answers slideshare
Liberty university busi 311 quiz 5 complete solutions correct answers slideshare
 
Liberty university busi 311 quiz 4 complete solutions correct answers slideshare
Liberty university busi 311 quiz 4 complete solutions correct answers slideshareLiberty university busi 311 quiz 4 complete solutions correct answers slideshare
Liberty university busi 311 quiz 4 complete solutions correct answers slideshare
 
Liberty university busi 311 quiz 3 complete solutions correct answers slideshare
Liberty university busi 311 quiz 3 complete solutions correct answers slideshareLiberty university busi 311 quiz 3 complete solutions correct answers slideshare
Liberty university busi 311 quiz 3 complete solutions correct answers slideshare
 
Psyc 355 spss homework 2 complete solutions correct answers key
Psyc 355 spss homework 2 complete solutions correct answers keyPsyc 355 spss homework 2 complete solutions correct answers key
Psyc 355 spss homework 2 complete solutions correct answers key
 
1 3 my statlab module one problem set complete solutions correct answers key
1 3 my statlab module one problem set complete solutions correct answers key1 3 my statlab module one problem set complete solutions correct answers key
1 3 my statlab module one problem set complete solutions correct answers key
 
Liberty university psyc 101 quiz 14 solutions answers slideshare
Liberty university psyc 101 quiz 14 solutions answers slideshareLiberty university psyc 101 quiz 14 solutions answers slideshare
Liberty university psyc 101 quiz 14 solutions answers slideshare
 
Liberty university psyc 101 quiz 13 solutions answers slideshare
Liberty university psyc 101 quiz 13 solutions answers slideshareLiberty university psyc 101 quiz 13 solutions answers slideshare
Liberty university psyc 101 quiz 13 solutions answers slideshare
 
Liberty university psyc 101 quiz 12 solutions answers slideshare
Liberty university psyc 101 quiz 12 solutions answers slideshareLiberty university psyc 101 quiz 12 solutions answers slideshare
Liberty university psyc 101 quiz 12 solutions answers slideshare
 

Recently uploaded

AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 

Recently uploaded (20)

AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 

Ece175 computer programming for engineering applications homework assignment 6 complete solutions correct answers key

  • 1. ECE175 Computer Programming for Engineering Applications Homework Assignment 6 complete solutions correct answers key Find the solution at http://www.coursemerit.com/solution-details/15101/ECE175-Homework-Assignment-6-complete-solutions-correct-answers-key Conventions: Name your C programs as hwxpy.c where x corresponds to the homework number and y corresponds to the problem number. Write comments to your programs. Programs with no comments will receive PARTIAL credit. For each program that you turn in, at least the following information should be included - Author: - Date created: - Brief (two lines) description of the program: Submission Instructions: Submit your .c files via D2L Dropbox. Problem 1 (35 pts): IMEI (International Mobile Equipment Identifier) Every mobile phone operating in wireless networks is characterized by a unique identifier of 15 digits, called IMEI (https://en.wikipedia.org/wiki/International_Mobile_Station_Equipment_Identity) A method to check if the device is really made by the official manufacturer is to compare the IMEI’s last digit, called Luhn digit, with a check digit. If the Luhn digit is equal to the check digit, the device is most probably authentic. Otherwise, it is not authentic for sure. The check digit is calculated as follows: 1) First, we calculate the SUM of the first IMEI’s 14 digits by adding a) the digits in the odd positions (meaning even index for the array in C) b) the double of the digits in the even positions. But if the double of the digit is a two-digit number, we add each digit separately. For example, suppose that the value of the digit is 8, its double is 16. We therefore add to the SUM the result of 1+6 = 7 (not 16). 2) If the last digit of the calculated SUM is 0, that is the check digit. If not, we subtract the last digit of the calculated SUM from 10 and that is the check digit. For example: let’s check the IMEI 357683036257378. Note: the last digit of the given IMEI above is 8 which is the Luhn digit. Apply the above algorithm (by hand) to the first 14 digits, we get 3 + (2x5) +7 + (2x6) + 8 + (2x3) + 0 + (2x3) + 6 + (2x2) + 5+ (2x7) + 3+ (2x7) 3 + (10) +7 + (12) + 8 + (6) + 0 + (6) + 6 + (4) + 5+ (14) + 3+ (14) 3 + (1+0) +7 + (1+2) + 8 + (6) + 0 + (6) + 6 + (4) + 5+ (1+4) + 3+ (1+4) 3 + (1) +7 + (3) + 8 + (6) + 0 + (6) + 6 + (4) + 5+ (5) + 3+ (5) = 62 Then the check digit = 10 – 2 = 8. Since the check digit (=8) is equal to the Luhn digit (=8), this IMEI is valid. 2
  • 2. Write a C program that - Prompt the user to enter the 15 digits of IMEI separated by spaces. The program should store the digits in an integer array. - Display the sum of the first 14 digits using the algorithm on the previous page - Calculate and display the check digit, and - Compare it to the Luhn digit. If they match, output with the message “IMEI is valid.” If not, output with the message “IMEI is invalid”. Sample Code Execution: Digits are entered by a user Enter 15-digit barcode (separate each digit by space) 3 5 7 6 8 3 0 3 6 2 5 7 3 7 8 total sum of 14 digits = 62 check digit = 8 IMEI is valid Enter 15-digit barcode (separate each digit by space) 3 5 7 6 1 3 0 0 4 4 4 8 4 8 5 total sum of 14 digits = 55 check digit = 5 IMEI is valid Enter 15-digit barcode (separate each digit by space) 4 9 0 1 5 4 2 0 3 2 3 7 5 1 9 total sum of 14 digits = 52 check digit = 8 IMEI is invalid Enter 15-digit barcode (separate each digit by space) 0 1 2 6 4 6 0 0 0 8 2 7 7 6 2 total sum of 14 digits = 38 check digit = 2 IMEI is valid Enter 15-digit barcode (separate each digit by space) 3 5 2 2 5 5 0 1 0 1 3 2 8 3 7 total sum of 14 digits = 41 check digit = 9 IMEI is invalid 3
  • 3. Problem 2 (35 pts): A two- represent a terrain of land where each element is elevation information (i.e. height in feet). For this problem, we want to determine number and location of peaks in the terrain, where a peak is a point that has lower elevations all around. We also want to determine the highest peak and its location. How to decide whether a location (i, j) is a peak: For 2-D array below, each element, except those on the boundarie s (edges), has exactly 8 neighbori ng cells (e.g. Above, Below, Left, Right, and four Diagonals) . Diagonal #1 11al1) Above Diagonal #2 Left (i, j) Right Diagonal #3 Below Diagonal #4