1. Copy the file secret.txt (Code Listing 9.3) from the Student CD or as directed by your instructor. This file is only one line long. It contains 2 sentences. 2. Write a main method that will read the file secret.txt, separate it into word tokens. 3. You should process the tokens by taking the first letter of every fifth word, starting with the first word in the file. Convert these letters to uppercase and append them to a StringBuilder object to form a word which will be printed to the console to display the secret message.

Answers

Answer 1

Answer:

In Java:

import java.io.File;

import java.io.FileNotFoundException;

import java.util.Scanner;

public class FP {

 public static void main(String[] args) {

   try {

     File myObj = new File("secret.txt");

     Scanner scr= new Scanner(myObj);

     while (scr.hasNextLine()) {

       String data = scr.nextLine();        

       String[] tokens = data.split(" ");  

       for(int i =0;i<tokens.length;i+=5){

        tokens[i] = tokens[i].substring(0, 1).toUpperCase() + tokens[i].substring(1);        }

       StringBuilder newstring = null;

       newstring = new StringBuilder();  

        for(String abc:tokens){newstring.append(abc+" ");     }  

         System.out.print(newstring);      }

     scr.close();      

   } catch(Exception ex){

     System.out.println("An error occurred.");    }

 }

}

Explanation:

See attachment for complete program where comments were used to explain each line


Related Questions

You've just deployed a new Cisco router that connects several network segments in your organization. The router is physically located in a server room that requires an ID for access. You've backed up the router configuration to a remote location in an encrypted file. You access the router configuration interface from your notebook computer using a Telnet client with a user name of admin and a password of admin. You have used the MD5 hashing algorithm to protect the password. What should you do to increase the security of this device

Answers

Answer:

The answer is "Use SCP to back up the router configuration to a remote location".

Explanation:

In the SPC, it is the Secure Copy Protocol that allows information to be stored and securely transmitted. Its SCP doesn't encrypt its digital information by itself; it corresponds to both the Security module which provides authentication or security. It allows the safe transfer of personal documents from either a host machine to a remote server. Its transference protocol "FTP" is quite close, but it adds security and authentication.

How do you open an application on the macOS?

Answers

Click the Launchpad icon in the Dock, or pinch closed with your thumb and three fingers on your trackpad. Then click an app to open it. You can also type an app's name to find the app in Launchpad, then press the Return key to open it.

Answer:

you can simply click on 'application' in the sidebar to open your default application folder, which contain for each app on your system.you can double click any of the icons in here to open them or take you to do it if currently open.

Predict the future that social media will have on society or the environment.

Answers

Answer:

Social networks are becoming more and more popular. More than 80% of the 4.66 billion people on the planet with access to the internet are social network users… and this share is expected to grow!

Society will drift to technology and rely on it more.

Environment wouldn't be taken cared of, and may be damaged.

Explanation:

Answer:

The Influence of Social media is being used in ways that shape politics, business, world culture, education, careers, innovation, and more.

Explanation:

The Influence of Social media is being used in ways that shape politics, business, world culture, education, careers, innovation, and more.

What percentage of STEM-related degrees awarded in the 2002-2003 academic year were doctorates?

16.7 percent

0 34.8 percent

O 14.6 percent

O 12.9 percent

Answers

Answer:

34.8

Explanation:

I just took the test!

when was third battle of Panipat fought​

Answers

Answer:

January 14, 1761

Explanation:

write Python statement to do the following tasks (a) create a list that contain the name of 5 student of your class (b) add one more name to the list of 5 students (c)
delete the first name from the list of student​

Answers

Answer:

classroster = ["Bill", "Tyler", "Jake", "Sam", "Joe"]

print("Original Roster: " + str(classroster))

classroster.append("June")

print("Added student: " + str(classroster))

classroster.pop(0)

print("Removed the first student" + str(classroster))

Explanation:

We create a variable named classroster and assign it a list value by using []

We print text with the value of the variable classroster, but we used the str tag to make it a string value

We used classroster.append to add "June" to the end of the list.

We then print the classroster again

We use classroster.pop(0) to remove "Bill" on the list. If we wanted to remove "Tyler" from the list, we would use classroster.pop(1).

If we wanted to remove "Jake" we would use classroster.pop(2)

and so on. goodluck!

Write a while loop that produces the following output:
1
2
4
8


please i need help

Answers

Answer:

Explanation is being shown in the file to the link

What is one example of an emerging class of software

Answers

Answer:

"Push" Model web browsers.

Explanation:

identify when programmers use an Else statement.
O to use an If statement in its place to make the test answer true.
O to use an expression instead of a conditional statement to make the answer false
O to tell the program to take a different action when the If statement answer is false
O to tell the program to give different information when the test answer is true.

plz help it's an assignment question on edgunuity and i need help. which one is it.

Answers

Answer:

to tell the program to take a different action when the If statement answer is false

Explanation:

if x = 0:

     print('x equals 0')

else:

      print('x equals something else that isnt 0')

Answer:

C. I got it right on edge.

Explanation:

how and why Steve Jobs left Apple Computer.

Answers

Answer:

Jobs was forced out of Apple in 1985 after a long power struggle with the company's board and its then-CEO John Sculley. ... He was largely responsible for helping revive Apple, which had been on the verge of bankruptcy.

Explanation:

There’s a saying in Hollywood that a film is written three times.
First in the __________.
Next, in __________.
And finally, in __________.

Answers

Answer: first in the screen play next in production and finally in the edit

Explanation:

Where do you enter characters for a simple search?
Choose the answer.
Navigation Pane
Replace dialog box
Clipboard
Find Pane

Answers

Answer:



Navigation Pane

Identify what a computer needs to
communicate sound:
Driver
Digital sound
Mouse
Keyboard
DONE

Answers

Digital sound because you want be able to hear

Answer:

A B

Explanation:

I got it right

What is the solution to the equation ?

Answers

There’s no solution to the equation
The correct answer is option D. No solution

Jennifer has written a short story for children. What should be her last step before she submits the story for publication?

Answers

Answer: proofreading

Explanation:

The options include:

A. proofreading

B) editing

C) accepting track changes

D) rejecting track changes

Jennifer's last step before she submits the story for publication should be proofreading. Proofreading simply refers to the checking of errors in an article, story or text before such article or text is published.

Proofreading is the final stage when one is writing before it's published. When a story is proofread, spelling, formatting issues, punctuation marks and every other mistakes are checked and removed.

Who was responsible for the development of the rocket motor?
-Technical Societies
-Robert H. Goddard
-Germans
-Wernher von Braun
I WILL MARK YOU BRAINLIEST ‼️‼️

Answers

Answer: Robert H. Goddard

Explanation: he developed and flew the first liquid-propellant rocket

Answer:

-Technical Societies

Explanation:

Rocket enthusiasts and rocket clubs were active in Germany, the US, Russia, and other countries. Experimental rockets were designed, tested, and sometimes flown. Some of the experiments used liquid fuel, though solid-fuel rockets were also developed. In 1932, the rocket motor was developed as a reusable method for the flight of a rocket.

I'm in need of an answer im not just wasting points for your benefit anymore..

Chris has handed over the screenplay to the sound designer to design the sounds in the movie. He told the sound designer that he has deany Indicated each sound in every scene. How do you think Chris indicated the sound effects in the screenplay?
OA by making the word indicating sound boldface
OB by capitalizing the word indicating sound
OC. by highlighting the word indicating sound
OD. by underlining the word indicating sound​

Answers

Answer:

i would say A, to me it just makes sense

Explanation:

Answer:

B) by capitalizing the word indicating sound

Explanation:

In most scripts for screenplays, words indicating a certain sound for a scene is usually in uppercase letters.

- 2022 Edmentum

a conditional statement begins with the word 'when" true or false

Answers

Answer:

False

Explanation:

Conditional statements always begin with 'if'.

who plays oblox .............................

Answers

Answer:

Me

Explanation:

MEEEE!!! i love scary games

Please help! Answers that do not relate to this topic will be REPORTED!
A. What do input and output have in common?
1. the characteristic of being modal
2. the ability to be either relative or absolute
3. unidirectional flow of data and sequential access


B. Which of these is NOT a level at which reading and writing of data can take place?

1. characters

2. bytes

3. paths

4. fields


C. If a program closes abnormally, where may information be retained?
1. in a buffer
2. in a socket
3. in a modal window


D. Fill in the blank with the correct response.

If one is reading and writing objects to a file, one is making use of ______, which is a simplified process in Java.

Answers

Answer:

answer for number A is

2. the ability to be  either relative or absolute

B. 2 bytes

C. in a buffer

Explanation:

Why did the editors choose to rearrange the intercutting between Luke’s story and the Imperials? What effect did this have on the final film?

Answers

Answer:

Though it has its merit, know that the rule is not mandatory. ... A jump cut is a cut in film editing in which two sequential shots of the ... An intercut is a type of edit where two or more actions in distinct ...

The ________________________ option allows one to start a numbered list on any number desired. [Set Starting Number Values]
Question 7 options:

Number Formats

Change List Level

Define New Number Format

Set Numbering Value

Answers

Answer:

Set Numbering Value.

Explanation:

Microsoft Word refers to a word processing software application or program developed by Microsoft Inc. to enable its users to type, format and save text-based documents.

In Microsoft Word 2019, the users are availed with the ability to edit the word document in the following view type;

I. View Mode.

II. Print Mode.

III. Drift Layout.

A numbered list can be defined as a list of items that are ordered numerically or sorted sequentially.

Basically, it is best suited for steps or procedures that are to be done sequentially or in order i.e in an ascending order. Thus, a numbered list is an ordered list that starts from 1.

The Set Numbering Value option allows one to start a numbered list on any number desired. To automatically create a numbered list in Microsoft Word, you should press 1 followed by a period, leave a space, type a text and then press the enter button.

7.6 lesson practice edhesive please help!!

Answers

Answer:

how can i help ?????????????????????????????????????

Explanation:

what is two features of the minicomputer?​

Answers

Answer:

It is smaller in size than a mainframe computer. It is less expensive than a super and mainframe computer. It is not much more powerful than the mainframe and supercomputer, but powerful than microcomputers. It supports multiprocessing and multi-tasking.

Explanation:

What do macOS and Windows use to prevent us from accidentally deleting files?

Answers

macOS and Windows use a Trash can—or Recycle Bin—to prevent you from accidentally deleting files. When you delete a file, it is moved to the Trash can.

is an evaluation method that uses a program that tests another program.
O A customer satisfaction survey
O A test case
O Automated testing
O Print debugging

Answers

automated testing !!!!$

Answer:

automated testing

Explanation:

got it right on edge

why auto-updates can reduce the risk of a cyberattack?

Answers

Answer:

They help keep your software up to date.

Explanation:

Using Windows for example: With automatic updates, you don't have to search for updates online or worry about missing critical fixes or device drivers for your PC.

You can read more about it here: https://support.microsoft.com/en-us/windows/windows-update-faq-8a903416-6f45-0718-f5c7-375e92dddeb2

I hope this helps you!

A citation and its ____________________ can be entered at the same time. [Insert Citations]
Question 4 options:

name

date

source

table of contents

Answers

Answer: source

Explanation:

A citation and its source can be entered at the same time. Hence option c is correct.

What is citation?

Citation is defined as how you disclose to your readers that a particular passage in your work was taken from another source. Identifying the sources you used to obtain your knowledge can demonstrate to the reader that you did thorough investigation. to recognize and respect other scholars' work by giving them due credit.

Select the phrase or sentence you wish to cite by clicking at the end of it, and then select Insert Citations from the Citations & Bibliography group on the References tab. Choose the citation you want to use from the list provided under "Insert Citation."

Thus, a citation and its source can be entered at the same time. Hence option c is correct.

To learn more about citation, refer to the link below:

https://brainly.com/question/1272936

#SPJ2

Choose the term that best fits each definition.
interpret(s) where a user wants to move the mouse through motions or eye movements.
allow(s) users to enter text and control the computer with their voice.
use(s) a synthesized voice to read text on the screen.
Text-to-speech
tracking devices
Speech input software

Answers

Answer: See explanation

Explanation:

The term that fits each definition include:

The mouse through motions or eye movements = tracking devices

Allow(s) users to enter text and control the computer with their voice = Speech input software

Use(s) a synthesized voice to read text on the screen = Text to speech

Sergio knows that to meet the project requirements, it is essential to have

Answers

Answer:

I need a better explanation??

Other Questions
Given the graph below find the slope. Pls helppp I dont understand also if you can can you show the works pls if you can tho A rectangular balcony is 10 feet long and 4 feet wide. What is its area? the net of the rectangular pyramid is shown which expression can be used to find the surface area of the pyramid? choose all that apply what is the difference b/w combustion and synthesis reaction ?explain with example What things did Elizabeth bring with her when she and her family escaped? What does Elizabeth think about freedom? Who was Harriet Tubman, and why was she Elizabeths hero? Why did Elizabeth feel hope while she waited by the river? I need help with this answer I would like help ! How would you describe the size of our sun compared to a red dwarf and a supergiant?The sun is the same size as a red dwarf.The sun is the same size as a supergiant.The sun is smaller than the red dwarf and the supergiant.O The sun is larger than a red dwarf but smaller than a supergiant. Please find the circumference, will give brainliest! The following is a metaphor. True or FalseHer mouth was like a fountain, always runningTrueFalse how many integers between 36 and 100 have a remainder of 3 when divided by 22? is cyber bullying against the 1st amendment? Describe at least three factors that contributed to the origin of the Holocaust andprovide at least 3 examples of how the Holocaust changed the lives of peopleimpacted by the Holocaust. Use relevant evidence from 3 or more sources to supportyour response and provide insight that is not simply a summary of the source beingcited. What is the value of p in the equation8p +2 = 4p - 1021) 12) -13) 34) -3 How did the society and culture of Japan change during the Edo period?Select all that apply. A new art form and industry arose from precise color printing.A new art form and industry arose from precise color printing. , ,Kabuki theater became popular and dramatized all kinds of stories.Kabuki theater became popular and dramatized all kinds of stories. , ,The ruling classes converted to Zen Buddhism and adopted the tea ceremony.The ruling classes converted to Zen Buddhism and adopted the tea ceremony. , ,Leaders stopped supporting the arts in favor of military expansion.Leaders stopped supporting the arts in favor of military expansion. , , How many bases of RNA represent an amino acid? List some ways you are able to communicate or have conversations with a potential employer before meeting them in person. A low price point is an example of a ________. Choose one. The measures of three line segments are given in each set.Which set of line segments cannot form a triangle?20.2 m, 20.4 m, 20.6 m32.8 m, 48.2 m, 81.1 m12.8 m, 25.7 m, 35.9 m35.6 m, 49.9 m, 83.2 m For every quarter spent, Reggie receives 75 food pebbles to feed the fish at a hatchery. Reggie has thrown 600 food pebbles into the fish pools. How many quarters did Reggie spend at the hatchery?