1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Delicious77 [7]
3 years ago
14

I need help to make this code to make it remove all instances of the specified letter from the original sentence

Computers and Technology
1 answer:
Agata [3.3K]3 years ago
5 0
Here is my solution. I did the following:

- changed the setRemover into a constructor, since the comment seems to hint that that is expected.
- changed the lookFor type into a String, so that it can work with the string replace overload. That's convenient if you want to replace with an emtpy string. The char type won't let you do that, you can then only replace one char with another.
- Added a static Main routine to use the class.

import java.lang.System.*;

public class LetterRemover 
{
   private String sentence;
   private String lookFor;

   public LetterRemover() {}
   
   // Constructor
   
   public LetterRemover(String s, char rem)
   {
       sentence = s;
       lookFor = String.valueOf(rem);
   }
   
   public String removeLetters()
   {       
       String cleaned = sentence.replace(lookFor, "");       
       return cleaned;
   }
   
   public String toString()
   {
       return sentence + " - letter to remove " + lookFor;
   }

   public static void main(String[] args) 
   {
        LetterRemover lr = new LetterRemover("This is the tester line.", 'e');
        System.out.println(lr.toString());
        String result = lr.removeLetters();        
        System.out.println("Resulting string: "+result);
   }
}

You might be interested in
Create a website on budget
kaheart [24]

Answer:I bet your attention automatically tuned into the video background, right?  It’s almost impossible to ignore it as it is moving.

There’s nothing wrong with you – it’s just human nature and how we subconsciously decide where to pay our attention to.

We are easily distracted by anything that moves – just like that dog that ignores everything in its world to chase that pesky little squirrel!

“Okay, you got me to look at your silly video, what does this have to do with my website design?”

What a great question and I’m glad you asked.

A video background on your website, if used properly, can help you capture your website visitors’ attention too!

Video background is one of the most popular website design trend that seems to be here to stay.

Marketers love video backgrounds because they make websites look modern and create a sense of artistry that static background images simply can’t match up to.

Many website conversion experts and regular people alike see their visitors stay on their websites longer and more likely to sign up or opt-in to their product / service offers.

I’ll admit – a 138% improvement sounds extraordinary and challenging to achieve every other day.

Keep in mind that such high figure is from tests ran by conversion / business optimization professionals who do this for a living. So it’s fair to say not everybody who runs a DIY website will see similar improvements, just by adding a video background to their website.

However, even a 10% – 20% improvement in engagement and conversion is not unreasonable for even a first-time website owners with no professional help  – if you use video background on your homepage the right way!

Imagine if you collected email newsletter subscribers so you can follow up with special promotions or share interesting discussions to build your brand.

Consider what a 20% increase in subscribers can do to your business? This can mean more sales and/or higher brand awareness!

All this can be done if you can capture your visitors’ attention more effectively – by using a video background.

This is not just a hypothetical idea. A lot of real life case studies have demonstrated how many businesses have succeeded by using video backgrounds to improve sales.

Like all things in life, there is a right way and a wrong way of doing things.

Even with something as groundbreaking as a video background, you can still screw it up and end up hurting your overall website design and experience – if you don’t abide by some basic rules.

So, understanding how to avoid basic mistakes when using a video background on your homepage can give you a much higher chance of succeeding in improving your web design.

In this guide, we will show you all the steps and best practices you should take to use video background effectively:Video background is most effective when you use it to (1) create a vibe, (2) to set a tone or (3) to induce an emotional reaction.

Let’s check out some examples:

Example #1: Businesses, Services, Organizations

Video backgrounds work for most professional websites, whether you are running a clinic, consultancy business, or design agency.

You can use a video background to show clips of the life of your staff or even the process of helping a customer. This gives your potential clients a chance to get to know you before even talking to you. It also paints a very vivid visual representation of what they can expect to experience from your business.Grain & Mortar is a design agency. This example is interesting because it shows you that you don’t always need to have a full page video background to get a similar benefit. They only display a video in the header section of the page that takes no more than half the screen real estate.

The video shows the daily collaboration of the staff (strategy sessions) and how they create design solutions for their clients.

At this moment, video background themes are somewhat limited in Shopify’s Theme Store. You do get more selection if you search for Shopify Video Background Themes in third party providers like Themeforest.

Do keep in mind all themes available in Shopify’s Theme Store are screened, approved and supported by Shopify.

In comparison, Shopify Themes from third party providers do not undergo Shopify’s direct screening process. While I am not saying third party themes are not as good, I just want you to be informed if you are considering whether to purchase from a third party provider.

Explanation:

lol i know this is alot just copy and paste it and can i have a brain list

3 0
3 years ago
​_____ refers to​ internet-based platforms that allow users to create their own content and share it with others who access thes
liberstina [14]
This would be considered a social media platform due to it allowing people to share content.<span />
6 0
3 years ago
Select
valentinak56 [21]

Answer:

return values.remove() + values.remove();

Explanation:

The appropriate expression to complete the method, which is designed to return the sum of the two smallest values in the parameter array number is indicated below in bold font :

public static int

sumTwoLowestElements(int[] numbers)

{

PriorityQueue values = new PriorityQueue<>();

for (int num: numbers)

{ values.add(num);

}

return values.remove() + values.remove();  

}

The return statementin programming is often used when a function is ready to return a value to its caller.

6 0
3 years ago
Consider the following class definitions.public class Bike{private int numWheels = 2;// No constructor defined}public class EBik
nadya68 [22]

Answer:

The answer is "Option A".

Explanation:

Please find the complete program in the attached file.

The given program includes a super-class Bike having a private integer numWheels parameter. The class EBike inherits the class Bike, EBike comprises one parameter function Object() which utilizes its variable number of the private integer Battery level of the battery parameter and the wrong choice can be defined as follows:

In choice B, it is wrong since there is no constructor with a single argument in the Bike class.

In choice C, it is wrong since there no need to call the base class constructor with the super keyword.

In choice, D is wrong because there no need to create a constructor of the base class.

In choice, E is wrong because it does not require the second EBike constructor parameter.

4 0
3 years ago
What are the four main content questions that need to be answered for every project you work on?
7nadin3 [17]

Answer: 1. What are the major deliverables ?

2. How will you get those deliverables before or by the deadline ?

3. Who is on the on the team and what role will they play ?

4. When will the team meet milestones on when will other members on the team play a role in. Contributing to or providing feedback on those deliverables ?

3 0
3 years ago
Other questions:
  • Sleeping is an effect of _______ , but agitation may cause a person to wake up
    7·2 answers
  • To define a c-string that will store students' last names of up to 25 characters in length, which is an appropriate statement?
    9·1 answer
  • Import java.util.scanner; public class sumofmax { public double findmax(double num1, double num2) { double maxval; // note: if-e
    10·1 answer
  • discuss the advantages and disadvantages that Excel has in helping navigate databases, big data, and data analytics.
    11·1 answer
  • True or false? The following deterministic finite-state automaton recognizes the set of all bit strings such that the first bit
    7·1 answer
  • Is a processor is be the same speed as the chips on the motherboard??​
    12·2 answers
  • True or false Encryption prevents hackers from hacking data?
    8·1 answer
  • 1. What was the very first “photo-realistic CGI character” to appear on-screen in a movie (released in 1985)?
    8·2 answers
  • Calculator is an example of
    14·1 answer
  • Discuss the role of the concept behind the "Internet of Things (IoT)" in today's digitally connected society.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!