SlideShare a Scribd company logo
1 of 1
Download to read offline
IN JAVA
BJP5 Exercise 6.19: leetSpeak Language/Type: Java file processing Scanner Author: Marty
Stepp (on 2019/09/19) Write a method leetSpeak that accepts two parameters: a Scanner
representing an input file, and a PrintStream representing an output file. Your method should
convert the input file's text to "leet speak" (aka 1337 speak), an internet dialect where various
letters are replaced by other letters/numbers. Output the leet version of the text to the given
output file. Preserve the original line breaks from the input. Also wrap each word of input in
parentheses. Perform the following replacements: For example, if the input file lincoln.txt
contains the following text: four score and seven years ago our fathers brought forth on this
continent a new nation And your method is called in the following way: Scanner input = new
Scanner(new File("lincoln.txt")); PrintStream output = new PrintStream(new File("leet.txt"));
leetSpeak(input, output); Then after the call, the output file leet.txt should contain the following
text: (four) (scor3) (4nd) (s3v3n)(y34rz)(4g) (Our) (f47h3rz) (brough7) (for7h) (0n) (7hiz)
(c0n7in3n7) (4) (n3w) (n47ion) You may assume that each token from the input file is separated
by exactly one space. Hint: You may want to use the String object's replace method, which is
used as follows: String str = "mississippi"; str = str.replace("s", "*"); // str = "mi**i**ippi" Type
your solution here:

More Related Content

Similar to IN JAVA BJP5 Exercise 6.19 leetSpeak LanguageType Java file pr.pdf

Prof. Chethan Raj C, BE, M.Tech (Ph.D) Dept. of CSE. System Software & Operat...
Prof. Chethan Raj C, BE, M.Tech (Ph.D) Dept. of CSE. System Software & Operat...Prof. Chethan Raj C, BE, M.Tech (Ph.D) Dept. of CSE. System Software & Operat...
Prof. Chethan Raj C, BE, M.Tech (Ph.D) Dept. of CSE. System Software & Operat...Prof Chethan Raj C
 
Build process ppt.pptx
Build process ppt.pptxBuild process ppt.pptx
Build process ppt.pptxSHIVANISRECECE
 
Compiler Engineering Lab#5 : Symbol Table, Flex Tool
Compiler Engineering Lab#5 : Symbol Table, Flex ToolCompiler Engineering Lab#5 : Symbol Table, Flex Tool
Compiler Engineering Lab#5 : Symbol Table, Flex ToolMashaelQ
 
File management in C++
File management in C++File management in C++
File management in C++apoorvaverma33
 
Chapter28 data-file-handling
Chapter28 data-file-handlingChapter28 data-file-handling
Chapter28 data-file-handlingDeepak Singh
 
AI UNIT-4 Final (2).pptx
AI UNIT-4 Final (2).pptxAI UNIT-4 Final (2).pptx
AI UNIT-4 Final (2).pptxprakashvs7
 
XPath - A practical guide
XPath - A practical guideXPath - A practical guide
XPath - A practical guideTobias Schlitt
 
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
python-online&offline-training-in-kphb-hyderabad (1) (1).pdfpython-online&offline-training-in-kphb-hyderabad (1) (1).pdf
python-online&offline-training-in-kphb-hyderabad (1) (1).pdfKosmikTech1
 

Similar to IN JAVA BJP5 Exercise 6.19 leetSpeak LanguageType Java file pr.pdf (20)

Python Course.docx
Python Course.docxPython Course.docx
Python Course.docx
 
I18n
I18nI18n
I18n
 
Spsl iv unit final
Spsl iv unit  finalSpsl iv unit  final
Spsl iv unit final
 
Spsl iv unit final
Spsl iv unit  finalSpsl iv unit  final
Spsl iv unit final
 
Prof. Chethan Raj C, BE, M.Tech (Ph.D) Dept. of CSE. System Software & Operat...
Prof. Chethan Raj C, BE, M.Tech (Ph.D) Dept. of CSE. System Software & Operat...Prof. Chethan Raj C, BE, M.Tech (Ph.D) Dept. of CSE. System Software & Operat...
Prof. Chethan Raj C, BE, M.Tech (Ph.D) Dept. of CSE. System Software & Operat...
 
Python-files
Python-filesPython-files
Python-files
 
File Handling in C
File Handling in CFile Handling in C
File Handling in C
 
Lab 1 Essay
Lab 1 EssayLab 1 Essay
Lab 1 Essay
 
Build process ppt.pptx
Build process ppt.pptxBuild process ppt.pptx
Build process ppt.pptx
 
Compiler Engineering Lab#5 : Symbol Table, Flex Tool
Compiler Engineering Lab#5 : Symbol Table, Flex ToolCompiler Engineering Lab#5 : Symbol Table, Flex Tool
Compiler Engineering Lab#5 : Symbol Table, Flex Tool
 
File management in C++
File management in C++File management in C++
File management in C++
 
Chapter28 data-file-handling
Chapter28 data-file-handlingChapter28 data-file-handling
Chapter28 data-file-handling
 
AI UNIT-4 Final (2).pptx
AI UNIT-4 Final (2).pptxAI UNIT-4 Final (2).pptx
AI UNIT-4 Final (2).pptx
 
XPath - A practical guide
XPath - A practical guideXPath - A practical guide
XPath - A practical guide
 
Filehandling
FilehandlingFilehandling
Filehandling
 
Python unit1
Python unit1Python unit1
Python unit1
 
Python fundamentals
Python fundamentalsPython fundamentals
Python fundamentals
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
python-online&offline-training-in-kphb-hyderabad (1) (1).pdfpython-online&offline-training-in-kphb-hyderabad (1) (1).pdf
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
 

More from arkmuzikllc

Here is selection filepublic class Selection { public static in.pdf
Here is selection filepublic class Selection {  public static in.pdfHere is selection filepublic class Selection {  public static in.pdf
Here is selection filepublic class Selection { public static in.pdfarkmuzikllc
 
Help me with these multiple-choice questions. Please dont use chat .pdf
Help me with these multiple-choice questions. Please dont use chat .pdfHelp me with these multiple-choice questions. Please dont use chat .pdf
Help me with these multiple-choice questions. Please dont use chat .pdfarkmuzikllc
 
Hello I am stuck in my code I know is everything is goid but I think.pdf
Hello I am stuck in my code I know is everything is goid but I think.pdfHello I am stuck in my code I know is everything is goid but I think.pdf
Hello I am stuck in my code I know is everything is goid but I think.pdfarkmuzikllc
 
HeadWallRam Inc. has expanded its reach globally and needs to re-lay.pdf
HeadWallRam Inc. has expanded its reach globally and needs to re-lay.pdfHeadWallRam Inc. has expanded its reach globally and needs to re-lay.pdf
HeadWallRam Inc. has expanded its reach globally and needs to re-lay.pdfarkmuzikllc
 
HINT For i = 1 , . . . ,n, let S[i] be the max sum ending with A[i].pdf
HINT For i = 1 , . . . ,n, let S[i] be the max sum ending with A[i].pdfHINT For i = 1 , . . . ,n, let S[i] be the max sum ending with A[i].pdf
HINT For i = 1 , . . . ,n, let S[i] be the max sum ending with A[i].pdfarkmuzikllc
 
Hi, I need some assistance with this UML use case diagram. I manage .pdf
Hi, I need some assistance with this UML use case diagram. I manage .pdfHi, I need some assistance with this UML use case diagram. I manage .pdf
Hi, I need some assistance with this UML use case diagram. I manage .pdfarkmuzikllc
 
Give an NFA that recognizes the language (10 + 110 + 101) and then .pdf
Give an NFA that recognizes the language (10 + 110 + 101) and then .pdfGive an NFA that recognizes the language (10 + 110 + 101) and then .pdf
Give an NFA that recognizes the language (10 + 110 + 101) and then .pdfarkmuzikllc
 
Goal Create a hypothetical threat assessment based on vulnerabilities.pdf
Goal Create a hypothetical threat assessment based on vulnerabilities.pdfGoal Create a hypothetical threat assessment based on vulnerabilities.pdf
Goal Create a hypothetical threat assessment based on vulnerabilities.pdfarkmuzikllc
 
import React, { useEffect } from react;import { BrowserRouter as.pdf
import React, { useEffect } from react;import { BrowserRouter as.pdfimport React, { useEffect } from react;import { BrowserRouter as.pdf
import React, { useEffect } from react;import { BrowserRouter as.pdfarkmuzikllc
 
im solving tha m-puzzel sliding tail problem where m = n^2 - 1 I ha.pdf
im solving tha m-puzzel sliding tail problem where m = n^2 - 1 I ha.pdfim solving tha m-puzzel sliding tail problem where m = n^2 - 1 I ha.pdf
im solving tha m-puzzel sliding tail problem where m = n^2 - 1 I ha.pdfarkmuzikllc
 
Im creating a skip list program for my Algorithms and Advanced Data.pdf
Im creating a skip list program for my Algorithms and Advanced Data.pdfIm creating a skip list program for my Algorithms and Advanced Data.pdf
Im creating a skip list program for my Algorithms and Advanced Data.pdfarkmuzikllc
 
if any additional information is required let me know Work through t.pdf
if any additional information is required let me know Work through t.pdfif any additional information is required let me know Work through t.pdf
if any additional information is required let me know Work through t.pdfarkmuzikllc
 
I need help with providing a 2 page overview of the case study provi.pdf
I need help with providing a 2 page overview of the case study provi.pdfI need help with providing a 2 page overview of the case study provi.pdf
I need help with providing a 2 page overview of the case study provi.pdfarkmuzikllc
 
I keep getting NullPointerExcepetion, can someone help me with spinL.pdf
I keep getting NullPointerExcepetion, can someone help me with spinL.pdfI keep getting NullPointerExcepetion, can someone help me with spinL.pdf
I keep getting NullPointerExcepetion, can someone help me with spinL.pdfarkmuzikllc
 
I have been tasked to write a code for a Singly Linked list that inc.pdf
I have been tasked to write a code for a Singly Linked list that inc.pdfI have been tasked to write a code for a Singly Linked list that inc.pdf
I have been tasked to write a code for a Singly Linked list that inc.pdfarkmuzikllc
 
I am trying to pass a date to a function in postgres.My function w.pdf
I am trying to pass a date to a function in postgres.My function w.pdfI am trying to pass a date to a function in postgres.My function w.pdf
I am trying to pass a date to a function in postgres.My function w.pdfarkmuzikllc
 
How can an event such as the terrorist attacks of September 2001 aff.pdf
How can an event such as the terrorist attacks of September 2001 aff.pdfHow can an event such as the terrorist attacks of September 2001 aff.pdf
How can an event such as the terrorist attacks of September 2001 aff.pdfarkmuzikllc
 
Hey! Could I possibly get some help with this Its a little confusi.pdf
Hey! Could I possibly get some help with this Its a little confusi.pdfHey! Could I possibly get some help with this Its a little confusi.pdf
Hey! Could I possibly get some help with this Its a little confusi.pdfarkmuzikllc
 

More from arkmuzikllc (18)

Here is selection filepublic class Selection { public static in.pdf
Here is selection filepublic class Selection {  public static in.pdfHere is selection filepublic class Selection {  public static in.pdf
Here is selection filepublic class Selection { public static in.pdf
 
Help me with these multiple-choice questions. Please dont use chat .pdf
Help me with these multiple-choice questions. Please dont use chat .pdfHelp me with these multiple-choice questions. Please dont use chat .pdf
Help me with these multiple-choice questions. Please dont use chat .pdf
 
Hello I am stuck in my code I know is everything is goid but I think.pdf
Hello I am stuck in my code I know is everything is goid but I think.pdfHello I am stuck in my code I know is everything is goid but I think.pdf
Hello I am stuck in my code I know is everything is goid but I think.pdf
 
HeadWallRam Inc. has expanded its reach globally and needs to re-lay.pdf
HeadWallRam Inc. has expanded its reach globally and needs to re-lay.pdfHeadWallRam Inc. has expanded its reach globally and needs to re-lay.pdf
HeadWallRam Inc. has expanded its reach globally and needs to re-lay.pdf
 
HINT For i = 1 , . . . ,n, let S[i] be the max sum ending with A[i].pdf
HINT For i = 1 , . . . ,n, let S[i] be the max sum ending with A[i].pdfHINT For i = 1 , . . . ,n, let S[i] be the max sum ending with A[i].pdf
HINT For i = 1 , . . . ,n, let S[i] be the max sum ending with A[i].pdf
 
Hi, I need some assistance with this UML use case diagram. I manage .pdf
Hi, I need some assistance with this UML use case diagram. I manage .pdfHi, I need some assistance with this UML use case diagram. I manage .pdf
Hi, I need some assistance with this UML use case diagram. I manage .pdf
 
Give an NFA that recognizes the language (10 + 110 + 101) and then .pdf
Give an NFA that recognizes the language (10 + 110 + 101) and then .pdfGive an NFA that recognizes the language (10 + 110 + 101) and then .pdf
Give an NFA that recognizes the language (10 + 110 + 101) and then .pdf
 
Goal Create a hypothetical threat assessment based on vulnerabilities.pdf
Goal Create a hypothetical threat assessment based on vulnerabilities.pdfGoal Create a hypothetical threat assessment based on vulnerabilities.pdf
Goal Create a hypothetical threat assessment based on vulnerabilities.pdf
 
import React, { useEffect } from react;import { BrowserRouter as.pdf
import React, { useEffect } from react;import { BrowserRouter as.pdfimport React, { useEffect } from react;import { BrowserRouter as.pdf
import React, { useEffect } from react;import { BrowserRouter as.pdf
 
im solving tha m-puzzel sliding tail problem where m = n^2 - 1 I ha.pdf
im solving tha m-puzzel sliding tail problem where m = n^2 - 1 I ha.pdfim solving tha m-puzzel sliding tail problem where m = n^2 - 1 I ha.pdf
im solving tha m-puzzel sliding tail problem where m = n^2 - 1 I ha.pdf
 
Im creating a skip list program for my Algorithms and Advanced Data.pdf
Im creating a skip list program for my Algorithms and Advanced Data.pdfIm creating a skip list program for my Algorithms and Advanced Data.pdf
Im creating a skip list program for my Algorithms and Advanced Data.pdf
 
if any additional information is required let me know Work through t.pdf
if any additional information is required let me know Work through t.pdfif any additional information is required let me know Work through t.pdf
if any additional information is required let me know Work through t.pdf
 
I need help with providing a 2 page overview of the case study provi.pdf
I need help with providing a 2 page overview of the case study provi.pdfI need help with providing a 2 page overview of the case study provi.pdf
I need help with providing a 2 page overview of the case study provi.pdf
 
I keep getting NullPointerExcepetion, can someone help me with spinL.pdf
I keep getting NullPointerExcepetion, can someone help me with spinL.pdfI keep getting NullPointerExcepetion, can someone help me with spinL.pdf
I keep getting NullPointerExcepetion, can someone help me with spinL.pdf
 
I have been tasked to write a code for a Singly Linked list that inc.pdf
I have been tasked to write a code for a Singly Linked list that inc.pdfI have been tasked to write a code for a Singly Linked list that inc.pdf
I have been tasked to write a code for a Singly Linked list that inc.pdf
 
I am trying to pass a date to a function in postgres.My function w.pdf
I am trying to pass a date to a function in postgres.My function w.pdfI am trying to pass a date to a function in postgres.My function w.pdf
I am trying to pass a date to a function in postgres.My function w.pdf
 
How can an event such as the terrorist attacks of September 2001 aff.pdf
How can an event such as the terrorist attacks of September 2001 aff.pdfHow can an event such as the terrorist attacks of September 2001 aff.pdf
How can an event such as the terrorist attacks of September 2001 aff.pdf
 
Hey! Could I possibly get some help with this Its a little confusi.pdf
Hey! Could I possibly get some help with this Its a little confusi.pdfHey! Could I possibly get some help with this Its a little confusi.pdf
Hey! Could I possibly get some help with this Its a little confusi.pdf
 

Recently uploaded

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
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
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
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
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
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
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
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
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 

Recently uploaded (20)

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
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
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
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 ...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
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
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
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...
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 

IN JAVA BJP5 Exercise 6.19 leetSpeak LanguageType Java file pr.pdf

  • 1. IN JAVA BJP5 Exercise 6.19: leetSpeak Language/Type: Java file processing Scanner Author: Marty Stepp (on 2019/09/19) Write a method leetSpeak that accepts two parameters: a Scanner representing an input file, and a PrintStream representing an output file. Your method should convert the input file's text to "leet speak" (aka 1337 speak), an internet dialect where various letters are replaced by other letters/numbers. Output the leet version of the text to the given output file. Preserve the original line breaks from the input. Also wrap each word of input in parentheses. Perform the following replacements: For example, if the input file lincoln.txt contains the following text: four score and seven years ago our fathers brought forth on this continent a new nation And your method is called in the following way: Scanner input = new Scanner(new File("lincoln.txt")); PrintStream output = new PrintStream(new File("leet.txt")); leetSpeak(input, output); Then after the call, the output file leet.txt should contain the following text: (four) (scor3) (4nd) (s3v3n)(y34rz)(4g) (Our) (f47h3rz) (brough7) (for7h) (0n) (7hiz) (c0n7in3n7) (4) (n3w) (n47ion) You may assume that each token from the input file is separated by exactly one space. Hint: You may want to use the String object's replace method, which is used as follows: String str = "mississippi"; str = str.replace("s", "*"); // str = "mi**i**ippi" Type your solution here: