SlideShare una empresa de Scribd logo
1 de 2
Here’s a simple strategy to encode a message: before each letter of the message, add a
number and series of letters. The number should correspond to the number of letters that will
precede the message's actual, meaningful letter. For example, the word “hey― could be
coded with “0h2abe1zy”. To read the message, you would: skip 0, find the ‘h’ skip 2
(‘a’ and ‘b’), find ‘e’ skip 1 (‘z’), find ‘y’ Write a function called
“decode―, which takes a string in this code format and returns the decoded word. You may
assume that coded strings are always legally encoded with this system.
Solution
import java.util.*;
public class Decode {
public static void main(String ar[])
{
String code,decode="";
Scanner s=new Scanner(System.in);
System.out.print("enter any one code ");
code=s.next();
int l=code.length();
for(int i=0;i<l;i++)
{
if(Character.isDigit(code.charAt(i))==true)
{
String c=""+code.charAt(i);
int n=Integer.parseInt(c);
decode+=code.charAt(i+1+n);
}
}
System.out.print(decode);
}
}
Input :
0h2abe1zy
Output:
hey

Más contenido relacionado

Similar a Heres a simple strategy to encode a message- before each letter of the.docx

Conditional Statementfinal PHP 02
Conditional Statementfinal PHP 02Conditional Statementfinal PHP 02
Conditional Statementfinal PHP 02Spy Seat
 
Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van KetwichCreating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van KetwichWillem van Ketwich
 
Python Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayPython Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayUtkarsh Sengar
 
Develop an encryption and decryption algorithm Your program should a.pdf
Develop an encryption and decryption algorithm  Your program should a.pdfDevelop an encryption and decryption algorithm  Your program should a.pdf
Develop an encryption and decryption algorithm Your program should a.pdfdeepaksatrker
 
I need help getting my code to work (code is at the bottom)1.3.pdf
I need help getting my code to work (code is at the bottom)1.3.pdfI need help getting my code to work (code is at the bottom)1.3.pdf
I need help getting my code to work (code is at the bottom)1.3.pdfpratyushraj61
 
Exploit Research and Development Megaprimer: Unicode Based Exploit Development
Exploit Research and Development Megaprimer: Unicode Based Exploit DevelopmentExploit Research and Development Megaprimer: Unicode Based Exploit Development
Exploit Research and Development Megaprimer: Unicode Based Exploit DevelopmentAjin Abraham
 
writing self-modifying code and utilizing advanced assembly techniques
writing self-modifying code and utilizing advanced assembly techniqueswriting self-modifying code and utilizing advanced assembly techniques
writing self-modifying code and utilizing advanced assembly techniquesRussell Sanford
 
Eight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programsEight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programsAleksandr Yampolskiy
 
第二讲 Python基礎
第二讲 Python基礎第二讲 Python基礎
第二讲 Python基礎juzihua1102
 
第二讲 预备-Python基礎
第二讲 预备-Python基礎第二讲 预备-Python基礎
第二讲 预备-Python基礎anzhong70
 
Please correct my code for me i am lost Thanks i submitted.pdf
Please correct my code for me i am lost Thanks i submitted.pdfPlease correct my code for me i am lost Thanks i submitted.pdf
Please correct my code for me i am lost Thanks i submitted.pdfkitty811
 
Arm yourself with Domain Driven Security. It's time to slay some security trolls
Arm yourself with Domain Driven Security. It's time to slay some security trollsArm yourself with Domain Driven Security. It's time to slay some security trolls
Arm yourself with Domain Driven Security. It's time to slay some security trollsOmegapoint Academy
 
Threshold Cryptography and Distributed Key Generation
Threshold Cryptography and Distributed Key GenerationThreshold Cryptography and Distributed Key Generation
Threshold Cryptography and Distributed Key GenerationLeonid Beder
 
Test driven development
Test driven developmentTest driven development
Test driven developmentXebia India
 
Introduction to Boost regex
Introduction to Boost regexIntroduction to Boost regex
Introduction to Boost regexYongqiang Li
 
Cybersecurity Research Paper
Cybersecurity Research PaperCybersecurity Research Paper
Cybersecurity Research PaperShubham Gupta
 

Similar a Heres a simple strategy to encode a message- before each letter of the.docx (20)

Conditional Statementfinal PHP 02
Conditional Statementfinal PHP 02Conditional Statementfinal PHP 02
Conditional Statementfinal PHP 02
 
Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van KetwichCreating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
 
Python Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayPython Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard Way
 
Compiler
CompilerCompiler
Compiler
 
Develop an encryption and decryption algorithm Your program should a.pdf
Develop an encryption and decryption algorithm  Your program should a.pdfDevelop an encryption and decryption algorithm  Your program should a.pdf
Develop an encryption and decryption algorithm Your program should a.pdf
 
I need help getting my code to work (code is at the bottom)1.3.pdf
I need help getting my code to work (code is at the bottom)1.3.pdfI need help getting my code to work (code is at the bottom)1.3.pdf
I need help getting my code to work (code is at the bottom)1.3.pdf
 
Exploit Research and Development Megaprimer: Unicode Based Exploit Development
Exploit Research and Development Megaprimer: Unicode Based Exploit DevelopmentExploit Research and Development Megaprimer: Unicode Based Exploit Development
Exploit Research and Development Megaprimer: Unicode Based Exploit Development
 
Tranning-2
Tranning-2Tranning-2
Tranning-2
 
writing self-modifying code and utilizing advanced assembly techniques
writing self-modifying code and utilizing advanced assembly techniqueswriting self-modifying code and utilizing advanced assembly techniques
writing self-modifying code and utilizing advanced assembly techniques
 
Eight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programsEight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programs
 
First c program
First c programFirst c program
First c program
 
TeraSort
TeraSortTeraSort
TeraSort
 
第二讲 Python基礎
第二讲 Python基礎第二讲 Python基礎
第二讲 Python基礎
 
第二讲 预备-Python基礎
第二讲 预备-Python基礎第二讲 预备-Python基礎
第二讲 预备-Python基礎
 
Please correct my code for me i am lost Thanks i submitted.pdf
Please correct my code for me i am lost Thanks i submitted.pdfPlease correct my code for me i am lost Thanks i submitted.pdf
Please correct my code for me i am lost Thanks i submitted.pdf
 
Arm yourself with Domain Driven Security. It's time to slay some security trolls
Arm yourself with Domain Driven Security. It's time to slay some security trollsArm yourself with Domain Driven Security. It's time to slay some security trolls
Arm yourself with Domain Driven Security. It's time to slay some security trolls
 
Threshold Cryptography and Distributed Key Generation
Threshold Cryptography and Distributed Key GenerationThreshold Cryptography and Distributed Key Generation
Threshold Cryptography and Distributed Key Generation
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Introduction to Boost regex
Introduction to Boost regexIntroduction to Boost regex
Introduction to Boost regex
 
Cybersecurity Research Paper
Cybersecurity Research PaperCybersecurity Research Paper
Cybersecurity Research Paper
 

Más de tpaula2

How can I calculate the missing amounts for each of the independent ca.docx
How can I calculate the missing amounts for each of the independent ca.docxHow can I calculate the missing amounts for each of the independent ca.docx
How can I calculate the missing amounts for each of the independent ca.docxtpaula2
 
How can other countries respond to international piracy-Solutiona-) St.docx
How can other countries respond to international piracy-Solutiona-) St.docxHow can other countries respond to international piracy-Solutiona-) St.docx
How can other countries respond to international piracy-Solutiona-) St.docxtpaula2
 
How do I block a certain range of IP addresses in a CENTOS server from.docx
How do I block a certain range of IP addresses in a CENTOS server from.docxHow do I block a certain range of IP addresses in a CENTOS server from.docx
How do I block a certain range of IP addresses in a CENTOS server from.docxtpaula2
 
How can we reduce software requirement errors -SolutionIf we want to r.docx
How can we reduce software requirement errors -SolutionIf we want to r.docxHow can we reduce software requirement errors -SolutionIf we want to r.docx
How can we reduce software requirement errors -SolutionIf we want to r.docxtpaula2
 
How do arrays compare with variables and how do they differ- Give a si.docx
How do arrays compare with variables and how do they differ- Give a si.docxHow do arrays compare with variables and how do they differ- Give a si.docx
How do arrays compare with variables and how do they differ- Give a si.docxtpaula2
 
How can the use of Internet search engines to locate information about.docx
How can the use of Internet search engines to locate information about.docxHow can the use of Internet search engines to locate information about.docx
How can the use of Internet search engines to locate information about.docxtpaula2
 
How change in a corporation-'s natural and societal environments can a.docx
How change in a corporation-'s natural and societal environments can a.docxHow change in a corporation-'s natural and societal environments can a.docx
How change in a corporation-'s natural and societal environments can a.docxtpaula2
 
How can you prevent intruders from accessing your wireless network- a).docx
How can you prevent intruders from accessing your wireless network- a).docxHow can you prevent intruders from accessing your wireless network- a).docx
How can you prevent intruders from accessing your wireless network- a).docxtpaula2
 
How are standing waves similar to beats and how are they different- Ty.docx
How are standing waves similar to beats and how are they different- Ty.docxHow are standing waves similar to beats and how are they different- Ty.docx
How are standing waves similar to beats and how are they different- Ty.docxtpaula2
 
How are corporate abuse of power corporate fraud- and corporate econom.docx
How are corporate abuse of power corporate fraud- and corporate econom.docxHow are corporate abuse of power corporate fraud- and corporate econom.docx
How are corporate abuse of power corporate fraud- and corporate econom.docxtpaula2
 
How can biometric technology be used to fight cybercrime and cyber rel.docx
How can biometric technology be used to fight cybercrime and cyber rel.docxHow can biometric technology be used to fight cybercrime and cyber rel.docx
How can biometric technology be used to fight cybercrime and cyber rel.docxtpaula2
 
Holmes- CPA- assisted Williams Corporation in preparing its financial.docx
Holmes- CPA- assisted Williams Corporation in preparing its financial.docxHolmes- CPA- assisted Williams Corporation in preparing its financial.docx
Holmes- CPA- assisted Williams Corporation in preparing its financial.docxtpaula2
 
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docx
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docxHNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docx
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docxtpaula2
 
Hi- Can you answer this question- Please show all your work and show i.docx
Hi- Can you answer this question- Please show all your work and show i.docxHi- Can you answer this question- Please show all your work and show i.docx
Hi- Can you answer this question- Please show all your work and show i.docxtpaula2
 
Hi! I think the answer is C Outsource the software- I juyst wanted to.docx
Hi! I think the answer is C Outsource the software- I juyst wanted to.docxHi! I think the answer is C Outsource the software- I juyst wanted to.docx
Hi! I think the answer is C Outsource the software- I juyst wanted to.docxtpaula2
 
Hi all! someone help me pls Fraud examination I need to write an essay.docx
Hi all! someone help me pls Fraud examination I need to write an essay.docxHi all! someone help me pls Fraud examination I need to write an essay.docx
Hi all! someone help me pls Fraud examination I need to write an essay.docxtpaula2
 
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docx
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docxHerbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docx
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docxtpaula2
 
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docx
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docxHere is a list of the main characters in Shakespeare-'s Romeo and Juli.docx
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docxtpaula2
 
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docxtpaula2
 
1- How does having a scope and WBS help project teams during project e.docx
1- How does having a scope and WBS help project teams during project e.docx1- How does having a scope and WBS help project teams during project e.docx
1- How does having a scope and WBS help project teams during project e.docxtpaula2
 

Más de tpaula2 (20)

How can I calculate the missing amounts for each of the independent ca.docx
How can I calculate the missing amounts for each of the independent ca.docxHow can I calculate the missing amounts for each of the independent ca.docx
How can I calculate the missing amounts for each of the independent ca.docx
 
How can other countries respond to international piracy-Solutiona-) St.docx
How can other countries respond to international piracy-Solutiona-) St.docxHow can other countries respond to international piracy-Solutiona-) St.docx
How can other countries respond to international piracy-Solutiona-) St.docx
 
How do I block a certain range of IP addresses in a CENTOS server from.docx
How do I block a certain range of IP addresses in a CENTOS server from.docxHow do I block a certain range of IP addresses in a CENTOS server from.docx
How do I block a certain range of IP addresses in a CENTOS server from.docx
 
How can we reduce software requirement errors -SolutionIf we want to r.docx
How can we reduce software requirement errors -SolutionIf we want to r.docxHow can we reduce software requirement errors -SolutionIf we want to r.docx
How can we reduce software requirement errors -SolutionIf we want to r.docx
 
How do arrays compare with variables and how do they differ- Give a si.docx
How do arrays compare with variables and how do they differ- Give a si.docxHow do arrays compare with variables and how do they differ- Give a si.docx
How do arrays compare with variables and how do they differ- Give a si.docx
 
How can the use of Internet search engines to locate information about.docx
How can the use of Internet search engines to locate information about.docxHow can the use of Internet search engines to locate information about.docx
How can the use of Internet search engines to locate information about.docx
 
How change in a corporation-'s natural and societal environments can a.docx
How change in a corporation-'s natural and societal environments can a.docxHow change in a corporation-'s natural and societal environments can a.docx
How change in a corporation-'s natural and societal environments can a.docx
 
How can you prevent intruders from accessing your wireless network- a).docx
How can you prevent intruders from accessing your wireless network- a).docxHow can you prevent intruders from accessing your wireless network- a).docx
How can you prevent intruders from accessing your wireless network- a).docx
 
How are standing waves similar to beats and how are they different- Ty.docx
How are standing waves similar to beats and how are they different- Ty.docxHow are standing waves similar to beats and how are they different- Ty.docx
How are standing waves similar to beats and how are they different- Ty.docx
 
How are corporate abuse of power corporate fraud- and corporate econom.docx
How are corporate abuse of power corporate fraud- and corporate econom.docxHow are corporate abuse of power corporate fraud- and corporate econom.docx
How are corporate abuse of power corporate fraud- and corporate econom.docx
 
How can biometric technology be used to fight cybercrime and cyber rel.docx
How can biometric technology be used to fight cybercrime and cyber rel.docxHow can biometric technology be used to fight cybercrime and cyber rel.docx
How can biometric technology be used to fight cybercrime and cyber rel.docx
 
Holmes- CPA- assisted Williams Corporation in preparing its financial.docx
Holmes- CPA- assisted Williams Corporation in preparing its financial.docxHolmes- CPA- assisted Williams Corporation in preparing its financial.docx
Holmes- CPA- assisted Williams Corporation in preparing its financial.docx
 
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docx
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docxHNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docx
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docx
 
Hi- Can you answer this question- Please show all your work and show i.docx
Hi- Can you answer this question- Please show all your work and show i.docxHi- Can you answer this question- Please show all your work and show i.docx
Hi- Can you answer this question- Please show all your work and show i.docx
 
Hi! I think the answer is C Outsource the software- I juyst wanted to.docx
Hi! I think the answer is C Outsource the software- I juyst wanted to.docxHi! I think the answer is C Outsource the software- I juyst wanted to.docx
Hi! I think the answer is C Outsource the software- I juyst wanted to.docx
 
Hi all! someone help me pls Fraud examination I need to write an essay.docx
Hi all! someone help me pls Fraud examination I need to write an essay.docxHi all! someone help me pls Fraud examination I need to write an essay.docx
Hi all! someone help me pls Fraud examination I need to write an essay.docx
 
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docx
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docxHerbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docx
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docx
 
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docx
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docxHere is a list of the main characters in Shakespeare-'s Romeo and Juli.docx
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docx
 
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx
 
1- How does having a scope and WBS help project teams during project e.docx
1- How does having a scope and WBS help project teams during project e.docx1- How does having a scope and WBS help project teams during project e.docx
1- How does having a scope and WBS help project teams during project e.docx
 

Último

Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 

Último (20)

Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 

Heres a simple strategy to encode a message- before each letter of the.docx

  • 1. Here’s a simple strategy to encode a message: before each letter of the message, add a number and series of letters. The number should correspond to the number of letters that will precede the message's actual, meaningful letter. For example, the word “hey― could be coded with “0h2abe1zy”. To read the message, you would: skip 0, find the ‘h’ skip 2 (‘a’ and ‘b’), find ‘e’ skip 1 (‘z’), find ‘y’ Write a function called “decode―, which takes a string in this code format and returns the decoded word. You may assume that coded strings are always legally encoded with this system. Solution import java.util.*; public class Decode { public static void main(String ar[]) { String code,decode=""; Scanner s=new Scanner(System.in); System.out.print("enter any one code "); code=s.next(); int l=code.length(); for(int i=0;i<l;i++) { if(Character.isDigit(code.charAt(i))==true) { String c=""+code.charAt(i); int n=Integer.parseInt(c); decode+=code.charAt(i+1+n); } } System.out.print(decode); } } Input : 0h2abe1zy