60 750
Assignments Done
97,8%
Successfully Done
In April 2018

Answer to Question #60078 in UNIX/Linux Programming for g ram

Question #60078
Objectives
CS515
2
¨ Understand data representation
¤ number system: decimal and hex
¤ text and binary data
¨ Learn to use printf
Requirements
CS515
3
¨ Title: my_student_id
¨ Requirements
¤ Implement a program to print out your student id in
various format
¤ Usage: my_student_id
Sample Output
CS515
4
¨ Let’s say your student id is 12345js
$ my_student_id
decimal = 49 hex = 31 char = 1
decimal = 50 hex = 32 char = 2
decimal = 51 hex = 33 char = 3
decimal = 52 hex = 34 char = 4
decimal = 53 hex = 35 char = 5
decimal = 106 hex = 6a char = j
decimal = 115 hex = 73 char = s
Deliverables
CS515
5
¨ Deliverables
¤ Source code
¤ Test log
n A screen dump of your testing
Expert's answer
Dear g ram, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

BabyManisha
25.05.16, 12:27

#!/bin/bash

echo "Enter Student Id:"
read my_student_id
printf "Student id is : $my_student_id \n"
for (( i=1 ; i<=${#my_student_id}; i++ ))
do
var=`expr substr $my_student_id $i 1`
printf "decimal = %d\t" "'$var"
printf "hex = %x\t" "'$var"
printf "char = $var \n"
done

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions