SlideShare a Scribd company logo
Grand Assignment
Case Study-1
Encryption/Decryption
A company wants to transmit data over the telephone, but is concerned that its phones can be tapped. All
the data are transmitted as four digit integers. The company has asked you to write a pro- gram that
encrypts that data so that it can be transmitted more securely. Your program should read a four
digit integer and encrypt it as follows: Replace each digit by (the sum of that digit plus 7)
modulus 10. Then, swap the 1st
digit with the 3rd
, swap the 2nd
digit with 4th
and print the
encrypted integer.
Write a separate program that inputs an encrypted four digit integer and decrypts it to form the original
number?
Case study-2
Encryption A Text Message
The user will input a regular message or text. Your program will convert it into text message with
the following
rules:
Case 1
If the word contains `ee 'consecutively, change to `i '
Example:- meet into mit
Case 2
If the word starts with `qu 'or `c ', convert it to `kw 'or `k 'respectively
Example:- quit into kwit , cast into kast
Case 3
If the word end with `y ', change to `i '
Example:- jury into juri
Case 4
If the word contains vowel followed by a consonant, eliminate the vowel
Example:- text into txt
Case 5
If word contains with `ate ', change it to`8 '; and contains with `ite ', change `i ' to `y 'and eliminate `e '.
Example:- mates into m8, category into k8gori , site into syt , liter into lytr
Case 6
If the word contains same letter consecutively, eliminate one of it; if word contains `eas 'change to `I '
eliminate the next letter if vowel.
Example :- mass into mas , mirror into mirror , lease into lis , pleasant into plisnt , measure into misr
Case 7
If the word contains `ote ', change it to `ow 'and eliminate `e '; if word contains `at ', `ot 'or `ut 'change to
`@'
Example :- emote into emowt , hotshot into h@sh@
Case 8
If the word contains `ck', change to `k'; if word contains `sh' change to `sy'; if word contains `ou' change
to `aw'; if word contains `ks', `cts'change to `x.'
Example :- quick into kwik , checker into chekr , shoot into syut , loud into lawd , licks into lix , insects
into nsex
Case 9
If the word contains `oo ', change to `u '; if word contains `ex' or `ix ', change to `x '; if word contains `el
'or `il ', change to `l 'if not in front of the word.
Example:- book into buk , expert into xprt , gel into gl , illness into ilnes
Grand Assignment
Case 10
If the word contains `the ',`tha ', `da ', `de 'or `di ', change to `d'; if word contains `if 'or `ef 'change to `f 'if
not in front of the word and will not follow by `e ', otherwise change to `y ' and eliminate `e '
Example:- delimiter into dlimitr , there into dr , radar into radr , radix into radx , eects into efex ,
lift into lft , life into lyf
Case 11
If the word contains `ove ', change `o 'to `u 'and eliminate `e '; if word contains `ar ', `ur ', or `er 'change to
`r '; if word contains `to ', `too 'or `tu 'change to `2 '; if contains `wan ', `won 'change to `1 '; if `tre ', tree
'change to `3 '; if `for ', `fore ', `fur 'change to `4 '
Example :- love into luv , discover into dskuvr
Case 12
If the word contains `is 'or `es ', change to `s'; if contains `be', `bee'or `bi', change to `b'if the letter after it
is consonant, otherwise, change it to `by '; if contains `ti ', `te 'or `ty 'change to `t 'if the word is not
ends on it, otherwise, change to `ti '; if contains `yo 'or `yu ', change to `u '; if contains `ey 'or
`ay ', change to `i '; if contains `inâ?• or `en ', change to `n '.
Example :-beautiful into byutful , beauty into byuti , miss or mess into ms , message into msg ,
binary into bnari , bending into bndng , your into ur ,mbru into embryo
Case 13
If word contains numbers change to digit.
Example :- times three to tyms
Case 14
Eliminate all the vowels in the word if not in the above rule if not one syllable word.
Example :- eliminate into elmn8 , make into make
Example
Input: the quick brown fox jumps over the lazy dog
Output: d kwikbrwnfxjmpsovr d lzy dog
Input: life is so beautiful
Output: lyf s so butful
Input: I love you
Output: I luv u
Input: one moment please
Output: 1 mmntplis
Input: Later than the sunset, later than the rain.
Output: L8r dn d snst, l8r dn d rain
Instructor
Sunawar Khan
Deadline: - Dec 21, 2017
Code never lies, comments sometimes do.

More Related Content

More from International Islamic University

Merge sort
Merge sortMerge sort
Linear timesorting
Linear timesortingLinear timesorting
Facial Expression Recognitino
Facial Expression RecognitinoFacial Expression Recognitino
Facial Expression Recognitino
International Islamic University
 
Data transmission
Data transmissionData transmission
Basic organization of computer
Basic organization of computerBasic organization of computer
Basic organization of computer
International Islamic University
 
Sorting techniques
Sorting techniquesSorting techniques
Linear search-and-binary-search
Linear search-and-binary-searchLinear search-and-binary-search
Linear search-and-binary-search
International Islamic University
 
Storage devices
Storage devicesStorage devices
Operating system concept
Operating system conceptOperating system concept
Operating system concept
International Islamic University
 
Old Papers Computers
Old Papers ComputersOld Papers Computers
Old Papers Computers
International Islamic University
 
Process Scheduling
Process SchedulingProcess Scheduling

More from International Islamic University (20)

Merge sort
Merge sortMerge sort
Merge sort
 
Linear timesorting
Linear timesortingLinear timesorting
Linear timesorting
 
Facial Expression Recognitino
Facial Expression RecognitinoFacial Expression Recognitino
Facial Expression Recognitino
 
Lecture#4
Lecture#4Lecture#4
Lecture#4
 
Lecture#3
Lecture#3 Lecture#3
Lecture#3
 
Lecture#2
Lecture#2 Lecture#2
Lecture#2
 
Arrays
ArraysArrays
Arrays
 
Pcb
PcbPcb
Pcb
 
Data transmission
Data transmissionData transmission
Data transmission
 
Basic organization of computer
Basic organization of computerBasic organization of computer
Basic organization of computer
 
Sorting techniques
Sorting techniquesSorting techniques
Sorting techniques
 
Linear search-and-binary-search
Linear search-and-binary-searchLinear search-and-binary-search
Linear search-and-binary-search
 
Fundamentals of-algorithm
Fundamentals of-algorithmFundamentals of-algorithm
Fundamentals of-algorithm
 
Fundamentals of-algorithm
Fundamentals of-algorithmFundamentals of-algorithm
Fundamentals of-algorithm
 
What is computer
What is computerWhat is computer
What is computer
 
Storage devices
Storage devicesStorage devices
Storage devices
 
Operating system concept
Operating system conceptOperating system concept
Operating system concept
 
Strings in c++
Strings in c++Strings in c++
Strings in c++
 
Old Papers Computers
Old Papers ComputersOld Papers Computers
Old Papers Computers
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
 

Recently uploaded

special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 

Recently uploaded (20)

special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 

Case study

  • 1. Grand Assignment Case Study-1 Encryption/Decryption A company wants to transmit data over the telephone, but is concerned that its phones can be tapped. All the data are transmitted as four digit integers. The company has asked you to write a pro- gram that encrypts that data so that it can be transmitted more securely. Your program should read a four digit integer and encrypt it as follows: Replace each digit by (the sum of that digit plus 7) modulus 10. Then, swap the 1st digit with the 3rd , swap the 2nd digit with 4th and print the encrypted integer. Write a separate program that inputs an encrypted four digit integer and decrypts it to form the original number? Case study-2 Encryption A Text Message The user will input a regular message or text. Your program will convert it into text message with the following rules: Case 1 If the word contains `ee 'consecutively, change to `i ' Example:- meet into mit Case 2 If the word starts with `qu 'or `c ', convert it to `kw 'or `k 'respectively Example:- quit into kwit , cast into kast Case 3 If the word end with `y ', change to `i ' Example:- jury into juri Case 4 If the word contains vowel followed by a consonant, eliminate the vowel Example:- text into txt Case 5 If word contains with `ate ', change it to`8 '; and contains with `ite ', change `i ' to `y 'and eliminate `e '. Example:- mates into m8, category into k8gori , site into syt , liter into lytr Case 6 If the word contains same letter consecutively, eliminate one of it; if word contains `eas 'change to `I ' eliminate the next letter if vowel. Example :- mass into mas , mirror into mirror , lease into lis , pleasant into plisnt , measure into misr Case 7 If the word contains `ote ', change it to `ow 'and eliminate `e '; if word contains `at ', `ot 'or `ut 'change to `@' Example :- emote into emowt , hotshot into h@sh@ Case 8 If the word contains `ck', change to `k'; if word contains `sh' change to `sy'; if word contains `ou' change to `aw'; if word contains `ks', `cts'change to `x.' Example :- quick into kwik , checker into chekr , shoot into syut , loud into lawd , licks into lix , insects into nsex Case 9 If the word contains `oo ', change to `u '; if word contains `ex' or `ix ', change to `x '; if word contains `el 'or `il ', change to `l 'if not in front of the word. Example:- book into buk , expert into xprt , gel into gl , illness into ilnes
  • 2. Grand Assignment Case 10 If the word contains `the ',`tha ', `da ', `de 'or `di ', change to `d'; if word contains `if 'or `ef 'change to `f 'if not in front of the word and will not follow by `e ', otherwise change to `y ' and eliminate `e ' Example:- delimiter into dlimitr , there into dr , radar into radr , radix into radx , eects into efex , lift into lft , life into lyf Case 11 If the word contains `ove ', change `o 'to `u 'and eliminate `e '; if word contains `ar ', `ur ', or `er 'change to `r '; if word contains `to ', `too 'or `tu 'change to `2 '; if contains `wan ', `won 'change to `1 '; if `tre ', tree 'change to `3 '; if `for ', `fore ', `fur 'change to `4 ' Example :- love into luv , discover into dskuvr Case 12 If the word contains `is 'or `es ', change to `s'; if contains `be', `bee'or `bi', change to `b'if the letter after it is consonant, otherwise, change it to `by '; if contains `ti ', `te 'or `ty 'change to `t 'if the word is not ends on it, otherwise, change to `ti '; if contains `yo 'or `yu ', change to `u '; if contains `ey 'or `ay ', change to `i '; if contains `inâ?• or `en ', change to `n '. Example :-beautiful into byutful , beauty into byuti , miss or mess into ms , message into msg , binary into bnari , bending into bndng , your into ur ,mbru into embryo Case 13 If word contains numbers change to digit. Example :- times three to tyms Case 14 Eliminate all the vowels in the word if not in the above rule if not one syllable word. Example :- eliminate into elmn8 , make into make Example Input: the quick brown fox jumps over the lazy dog Output: d kwikbrwnfxjmpsovr d lzy dog Input: life is so beautiful Output: lyf s so butful Input: I love you Output: I luv u Input: one moment please Output: 1 mmntplis Input: Later than the sunset, later than the rain. Output: L8r dn d snst, l8r dn d rain Instructor Sunawar Khan Deadline: - Dec 21, 2017 Code never lies, comments sometimes do.