Write a program that takes a String containing a text using the method signature

String useProperGrammar(String text)
Your method should replace the word ‘2’ with ‘to’ and return the updated text.

For example,

useProperGrammar("can you go 2 the store?")
should return

"can you go to the store?"
This method should also print out the number of grammatical errors that were fixed.

For example, for useProperGrammar("back 2 back 2 back"), the method would also print:

Fixed 2 grammatical errors:
In the main method, ask the user to input a String, and print the results of useProperGrammar using the user input.

Answers

Answer 1

import java.util.*;

public class MyClass {

   public static String useProperGrammar(String message){

       String newMessage = "";

       int count = 0;

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

           if(message.charAt(i) == '2'){

               newMessage = newMessage + "to";

               count ++;

           

           }

           else{

               newMessage = newMessage + message.charAt(i);

           }

       

       }

       System.out.println("Fixed "+count+" grammatical error(s):");

       return newMessage;

   }

   public static void main(String args[]) {

     Scanner scan = new Scanner(System.in);

     System.out.println("Enter a string: ");

     String text = scan.nextLine();

     System.out.println(useProperGrammar(text));

   }

}

I hope this helps.


Related Questions

Evaluate a career in the telecommunications industry that most interests you. What about the career appeals to you?
What qualifications do you already possess to make you successful in this career? Which skills do you still need to
develop to pursue this career?
Your answer should be at least 150 words in length.

Answers

Answer:

Network administrator and programmer.

Am still in A-level, am doing Physics, chemistry, Maths and ICT.

I have an A in physics, B in Chemistry and Maths and A† in ICT

3. A year contains 365 days normally, so on
what number day does Christmas fall on?

Answers

Answer:

359 is December 25 in a 365 day year.

Explanation:

Answer:

For western christian churches, Christmas day always occurs on December 25, though some cultures observe the main celebration on the night prior, Christmas Eve.

Assume that x and y are boolean variables and have been properly initialized.(x && y) || !(x && y) The result of evaluating the expression above is best described as (A) always true (B) always false (C) true only when x is true and y is true (D) true only when x and y have the same value (E) true only when x and y have different values

Answers

Answer:

(A) Always true

Explanation:

Given

Boolean variables x and y

Required

What is (x && y) || !(x && y)

Irrespective of what x or y is, the x && y is always true

Take for instance:

x = true;

y = true;

x&&y will also be true because the values of x and y were not altered

And this is true for whatever boolean value x or y assume

Having said that:

x&&y = true

So, the expression is analysed as follows:

(x && y) || !(x && y)

Substitute true for x&&y

(true) || !(true)

!(true) = false

So, the expression becomes:

true || false

|| represents the OR operator; and it returns true if at least one of the conditions is true.

By this:

true || false = true

Option (A) Always true answers the question.

which data representation system is based on the digits 0-9 and is mostly easily interpreted In real wrold situations​

Answers

Answer:

Hexadecimal  data representation system is based on the digits 0-9 and is mostly easily interpreted In real word situations​ .

Explanation:

Hexadecimal manages sixteen different figures: most often the numbers 0–9 to describe values zero to nine, and (A–F) to describe values ten to fifteen. The modern hexadecimal system was first launched into the domain of computing by IBM in 1963. An older description, with 0-9 and u-z, was practiced in 1956 by the Bendix G-15 computer.

What is computer virus?​

Answers

Answer:

A piece of code which is capable of copying itself and typically has a detrimental effect, such as corrupting the system or destroying data.

Explanation:

A computer virus is a type of computer program that, when executed, replicates itself by modifying other computer programs and inserting its own code. When this replication succeeds, the affected areas are then said to be "infected" with a computer virus.

Simply, a computer virus is a harmful multiplying code that harms your computer and makes it slower, harder to use, and more vulnerable to other harmful unsafe software, apps, downloads and more.

How to get it?

You can get computer viruses just from going to unsafe websites downloading harmful files downloading harmful images downloading harmful videos clicking unsafe advertisements

and thats just a couple of examples, there's many many more but you get the idea.

Something that really sucks about computer viruses is that its hard to tell if something online is dangerous or not.

That's why people make specific softwares to protect your computer but even those can be unsafe or people could be trying to trick you.

Sometimes the computer will already have some sort of app or software to protect it from these harmful files, but make sure to pay attention when your on websites and check the urls and make sure it doesn't say anything along the lines of "unsafe" if it says that just simply exit the website and dont do anything further.

If your experiencing slowness, files you don't remember saving on your computer or extra files and apps that dont seem to belong, im sure there are places you can call online or in your local area to help with these issues.

Hope this helped!!

The challenge of preparing for ____________________ is in ensuring that employees do not feel that they are being prepared for termination.

Answers

Answer:

"Cross-training " seems to be the right response.

Explanation:

Cross-training seems to be the method of constructing a multi-professional workers staff with incentive plans to make sure that they must have the same tools to complete different occupational tasks throughout the organization. This will be a very broad approach besides randomized controlled training methods, both maximum and minimum frequency, for generations.

What sum will amounts to Rs 1227 in 9 months at 6%
e emple Interest 2.​

Answers

Answer:

given us,

principal (p)= Rs 1227

Time(t)= 9

Rate(r)= 6./.

Here,

simple interest= P×T×R/100

= 1227×9×6/100

= 66258/100

= 662.58

Explanation:

by using simple interest formula

The principal investment required to get a total amount, principal plus interest, of Rs 227.00 from simple interest at a rate of 6% per year for 0.75 years (9 months) is $1,174.16

Given Data

Final Amount A = Rs 1227

Time = 9 months

Rate = 6%

Principal = ?

Equation:

P = A / (1 + rt)

Calculation:

First, converting R percent to r a decimal

r = R/100 = 6%/100 = 0.06 per year.

Putting time into years for simplicity,

9 months / 12 months/year = 0.75 years

Solving our equation:

P = 1227 / ( 1 + (0.06 × 0.75)) = 1174.1626794258

P = $1,174.16

Learn more about simple interest here:

https://brainly.com/question/2294792

Several key people were involved in programming-language development in the 1970s and 1980s

Answers

Answer:

Brian Kernighan and Dennis Ritchie created the C programming language, and Bjarne Stroustrup took it to the next level by creating C++ in the 80's.

Answer:

Bjarne Stroustrup released C++ programming language in the1980s.

Bill Gates and Paul Allen released the first programming language for a personal computer.

Niklaus Wirth developed Pascal to teach programming.

Explanation:

1,3,4

Anna is creating a digital portfolio, including her professional work showcasing the designs she created. What should she add to each work?

A. brief description of the work and project details
B. only title of the work
C. only date and title of the work
D. only project details of the work

Answers

A. Brief description of the work and project details.

Fill in the blanks, so the print statement displays the result of the function call in order.

1 # This function compares two numbers and returns them
2 # in increasing order.
3 - def order_numbers(number1, number2):
4. if number2 > number1:
5 return numberi, number2
6 else:
7 return number2, number1
8
9 Run # 1) Fill in the blanks so the print statement displays the result # of the function call
10 ---, --- = order_numbers(100, 99) print(smaller, bigger)

Answers

Answer:

Rep;ace the blank with

smaller, bigger

So, the complete line is:

smaller,bigger=order_numbers(100,99)

Explanation:

From the question, we understand that the program is to return the order of a number from least to highest

This has been well implemented in order_numbers function

Because the order function returns two values, the order_function must be called in order to accept two values and the syntax is:

value1,value2 = function(return-value1,return-value2)

In this case, the statement is:

smaller,bigger=order_numbers(100,99)

So, in the next line of the main, the values of smaller and bigger are printed:

print(smaller,bigger)

See attachment

The five types of personal computers are: desktops, laptops, tablets, smartphones, and ________.
a) microcomputers.
b) wearables.
c) macrocomputers.
d) midranges.

Answers

Answer:

B. Wearables.

Explanation:

These are tagged to be a category now in the technology as they are seen to make up the fifth type of personal computers in the question above. These are seen to be attached on the body or sometimes embedded to our outfit and also in other cases hung on a part of our body. They are counted to range from fitness trackers to smart watches, headsets etc. They are said to posses microprocessors which aid their functional ability through its use of the internet.

Answer:

Explanation:

B. Wearables.

Explanation:

These are tagged to be a category now in the technology as they are seen to make up the fifth type of personal computers in the question above. These are seen to be attached on the body or sometimes embedded to our outfit and also in other cases hung on a part of our body. They are counted to range from fitness trackers to smart watches, headsets etc. They are said to posses microprocessors which aid their functional ability through its use of the internet.

As a sysadmin you will find yourself doing business with a variety of third party vendors which of these are likely to be rented or bought from a vendors

Answers

Answer:

Printing devices

Video, Audio devices

Communication machines

Explanation:

Printing devices - Sysadmin needs this type of devices for print important data and information.

Video, Audio devices - Sysadmin needs this type of devices for better communication and interaction.

Communication(fax) machines - Sysadmin needs this type of devices for written communication and interaction and deals.

Which of the following options allow you to access a computer remotely?

a. NTP
b. SSH
c. Server
d. VPN

Answers

Answer:

b. SSH

Explanation:

Secure Shell (SSH) is a protocol that allows you to access a computer remotely by providing safe network communications via an unsecured network.

Secure Shell (SSH) protocol can be used to perform essential functions such as protected file transfers, remote access to private network systems, devices, and applications.

Thus, option "B" is the right answer.

The Chief Information Officer (CIO) has determined the company’s new PKI will not use OCSP. The purpose of OCSP still needs to be addressed. Which of the following should be implanted?A. Build an online intermediate CA.B. Implement a key escrow.C. Implement stapling.D. Install a CRL.

Answers

Answer:

B. Implement a key escrow.

Explanation:

A key escrow can be defined as a data security method of storing very essential cryptographic keys.

Simply stated, key escrow involves a user entrusting his or her cryptographic key to a third party for storage.

As a standard, each cryptographic key stored or kept in an escrow system are directly linked to the respective users and are encrypted in order to prevent breach, theft or unauthorized access.

Hence, the cryptographic keys kept in an escrow system are protected and would not be released to anyone other than the original user (owner).

In this scenario, the Chief Information Officer (CIO) has determined the company's new public key infrastructure (PKI) will not use online certificate status protocol (OCSP). However, the purpose of online certificate status protocol (OCSP) still needs to be addressed. Thus, what should be implemented is a key escrow because the online certificate status protocol (OCSP) is an internet protocol used for maintaining the security of a server and obtaining a digital certificate that has been revoked.

Write a 200 word essay about how a computer is made.

Good luck.​

Answers

Answer:

Essay about how a computer is made is written below in detailed explanation.

Explanation:

After so many discoveries and inventions, Humans ultimately made the computer. And, today some personalities in the world can't exist a bit without a computer.

The computer is an electric device that is utilized for collecting and processing data. The hard work can be completed in a shorter time with the guidance of computers. With the assistance of the computer, we can do all the stuff in today's world.. Because of this, the computer performs a vital purpose in this contemporary life.

A software is made from​

Answers

Answer:

Two or more languages are used for making one particular software.

Application software helps run the computer and coordinates instructions with the hardware.
A. True
B. False

Answers

Answer:

A. True

Explanation:

_______and ________ enables computers to communicate and it can pass information between two networks.

Answers

Answer:

Internet Protocol and Transmission Control Protocol        

Explanation:

Internet protocol, which is also known as IP and Transmission Control Protocol, which is also known as TCP are the two important protocols that enables the computers to communicate various information and data and allow it to pass between two networks. It allows computers to connect to each other.  They are developed by Bob Kahn and Vint Cerf.

A business owns a printer but the printer is used for cloud printing purposes. What type of resource is this?

Answers

I’m confused , what are the choices ?

Sara would like to begin creating macros in Excel 2016. Where can she find the ability to launch the Macro dialog box?

Insert tab in the Macros group
Formulas tab in the Macros group
Developer tab in the Code group
Developer tab in the Add-ins group

Answers

Answer:

C) Developer tab in the Code group

Explanation:

A group of students is performing an investigation to measure how much liquid water is produced from a 10 L sample of snow. What must occur in order for the students to perform this investigation?

Answers

Answer:

the temperature of the sample must change

Explanation:

If you wanted to divide an integer variable by 2, which of the following lines of code would you use? total = int + 2 total = int * N total int / 2 total = int. 2

Answers

Answer:

Yes

Explanation:

Because all answers are intotal (2)

What is the last usable host IP address on the 192.168.32.9/30 network?

Answers

Answer:

192.168.32.10

Explanation:

HOPE THIS HELPS:)

do you agree or disagree with the assertion that edutech transforms teachung and learning ​

Answers

Answer:I agree!

Explanation:

Agree

Suppose a webpage contains a single text field. We want to make the page such that a user can immediately start typing in the text field without clicking on it. What is correct way using?
1. .
2. .
3. .
4. Can't be done with only HTML5, need help of Javascript or something else.

Answers

Answer:

The answer is "Option 2".

Explanation:

In HTML5, text inputs use an autofocus attribute, which, when the page is loaded, uses a template to concentrate primarily on text fields. This attribute is a Boolean property that represents the HTML autofocus attribute, showing if the related <select> element will receive an output focus whenever the page loads if it is overruled by the user. An only form-associated entity can have this property specified in a text.

A certain instructor assigns a 50-point problem and calculates an integer score 0-50 and assigns a letter grade according to the scale 40 - 50 is an A, 30 - 39 is a B, 20 - 29 is a C, 10 - 19 is a D and 0 - 9 is an F. Write a Python function called letter_grade which takes one argument, an integer, and RETURNS the appropriate letter grade.

Answers

Answer:

Following are the code to this question:

def letter_grade(x): #defining a method letter_grade that accepts one parameter

   if x>=50 and x<=40:#defining if block that check value of x greater than 50 and less than 40

       print("A")#print value

   if x>=30 and x<=39:#defining if block that check value of x greater than 30 and less than 39

       print("B")#print value

   if x>=20 and x<=29:#defining if block that check value of x greater than 20 and less than 29

       print("C")#print value

   if x>=10 and x<=19:#defining if block that check value of x greater than 10 and less than 19

       print("D")#print value

   if x>=0 and x<=9:#defining if block that check value of x greater than 0 and less than 9

       print("F")#print value

letter_grade(30) #calling the method letter_grade

Output:

B

Explanation:

In the above Python code, a method "letter_grade" is declared, that accepts an integer variable in its parameter, and defined the multiple if block to check the given value, which can be defined as follows:

In the first, if block, it checks the value of x greater than 50 and less than 40 , if the condition is true it will print the value "A".In the second, if block, it checks the value of x greater than 30 and less than 39,  if the condition is true it will print the value "B".In the third, if block, it checks the value of x greater than 20 and less than 29,  if the condition is true it will print the value "C".  In the fourth, if block, it checks the value of x greater than 10 and less than 19,  if the condition is true it will print the value "D".In the fifth, if block, it checks the value of x greater than 0 and less than 9,  if the condition is true it will print the value "F".

And at the last it call the method.

Your organization uses a federated identity provider to login to your Oracle Cloud Infrastructure (OCI) environment. As a developer, you are writing a script to automate some operation and want to use OCI CLI to do that. Your security team doesn't allow storing private keys on local machines. How can you authenticate with OCI CLI?

Answers

Answer:

Run OCI session authenticate and provide your credentials

Explanation:

The OCI CLI when in combination with a shell script can be fastly used in the creation of shareable scripts. It uses API keys, private and public scheme as it's default authentication. The command to use is the oci set up keys, to create these keys. Since you cannot store private keys, you run OCI authentication and then you give your credentials

PLZ HELP THIS ENDS TODAY
During slide show mode, hitting the B key will do which of these?

End your presentation

Blank the screen with black screen

Move back one page

Move to the first page of your presentation

Answers

Answer:

B or Period. Pressing the B key or period key pauses the slideshow and displays a black screen, which you can write on. Press the B or period key again to resume the slideshow.

Answer: It blanks the screen black.

You should use the arrow keys.

Explanation:

I tried it.

Ship, CruiseShip, and CargoShip ClassesDesign a Ship class that has the following members:a. a member variable for the name of the ship (a string)b. a member variable for the year that the ship was built (a string)c. A constructor and appropriate accessors and mutatorsd. A virtual print function that displays the ship's name and the year it was built.

Answers

Answer:

def shipvari(ship);

Cruiseship="" #defining a string

YearBuilt= ""

for i in range(ship);

if Cruiseship="";

print(CruiseShip)

Give the rest a try!

Which interpersonal skill is the most important for a telecom technician to develop?

active listening

teamwork

conflict resolution

social awareness

Answers

Answer:

active listening is interpersonal

Answer:

active listening

Explanation:

edg2021

telecom technicians go to homes and officies to listen to the consumers demands to fix their internet and other telecommmunication issues. They mostly work alone and simply need to be aware of the issue and what they are doing to fix it.

Other Questions
what does this sign suggest about the nazi government's policies toward jews Based on paragraph 22, what is one motivation for the Emperor's actions? A. his fear of being made ridiculous in the eyes of his subjects B. his determination to be loved and respected by his subjects C. his desire to understand the needs of his subjects D. his need to feel superior to all of his subjects The First Political Parties, do you agree with Washington that parties would divide America, or do you think that they were bound to form despite his warning? Just do 3 sentences Which of the following statements is false regarding Form 8949 - Sales and Other Dispositions of Capital Assets?A. The taxpayer uses Form 8949 to report sales and exchanges of capital assetsB. Form 8949 allows the taxpayer and the IRS to reconcile amounts that were reported to him or her and the IRS on Form 1099-B or 1099-S (or substitute statement) with the amounts he or she reports on his or her income tax returnC. If all Forms 1099-B the taxpayer received (and all substitute statements) show basis was reported to the IRS and if no correction or adjustment is needed, the taxpayer must always file Form 8949 and attach a statement of these transactionsD. Corporations and partnerships use Form 8949 to report undistributed long-term capital gains from Form 2439 will give brainly show work23-54-2(6-1) 2,704 rounded to the nearest thousand What is the check digit (d) for the UPC barcode number2-91273-05213-d?A. 5B. 7C. 9D. 0 What is 67/100 as a decimal representation and a percent representation Help how do I do this? andrew needs to call his 8 baseball teammates to make plans for a party at the end of the season if each call takes 5 minutes how much time will he spend making the calls?A. 1/3 hour B.40/100 hour C.2/3 hour D.3/4 hour First to guess my Hogwarts House based on the clues given correctly, will get brainliest.Good Luck!Clues:I am very creativeI have friends in most of the housesOne of my fellow house-members from one of the movies dated a Hufflepuff 37. Using the reaction of nitrogen gas and hydrogen gas to make ammonia gas(NH3), if you have 7 L of nitrogen, and all the hydrogen you need, how manyliters of ammonia gas can you make? Organism that can that can breed/produce fertile offspring_________A-Ecosystem B-organism C-Ecology D-speciesE-abioticF-BioticG-communityH-population how to solve using Substitution or Elimination??? Help!!!y=3x-1y=2x+2 Which statement describes a feature of The Cruisers?Actions on stage help show what happens in the story.The narration describes the main characters thoughts.Dialogue tags come before the words a character says.Stage directions explain how the characters move. BRO I NEED HELP THIS DUE IN 4 MINS! Determine what regions make up the given probabilities - shade the Venn Diagram, Solve for x. Round your answer to the nearest tenth. Frankenstein summary from chapter 7 to 16 i am going insane right now but i love it