Return a version of the given string, where for every star (*) in the string the star and the chars immediately to its left and right are gone. So "ab*cd" yields "ad" and "ab**cd" also yields "ad". starOut("ab*cd") → "ad" starOut("ab**cd") → "ad" starOut("sm*eilly") → "silly"

Answers

Answer 1

Answer:

Explanation:

The following code is written in Java and uses a for loop with a series of IF ELSE statements to check the next and previous characters in a string. Checking to make sure that there are no asterix. If so it adds that character to the String variable output. Which is returned to the user at the end of the method. Two test cases have been created and the output can be seen in the attached image below.

class Brainly {

   public static void main(String[] args) {

       System.out.println(starOut("sm*eilly"));

       System.out.println(starOut("ab**cd"));

   }

   public static String starOut(String str) {

       String output = "";

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

           if ((i != 0) && (i != str.length()-1)) {

               if ((str.charAt(i-1) != '*') && (str.charAt(i+1) != '*') && (str.charAt(i) != '*')) {

                   output += str.charAt(i);

               }

           } else {

               if ((i == 0) && (str.charAt(i) != '*') && (str.charAt(i+1) != '*')) {

                   output += str.charAt(i);

               } else if ((i == str.length()-1) && (str.charAt(i) != '*') && (str.charAt(i-1) != '*')) {

                   output += str.charAt(i);

               }

           }

       }

       return output;

   }

}


Related Questions

write fade in shorthand​

Answers

Answer:

"Fade In is a Class Act" Macworld says: "Fade In makes it easy to just write...It has all the features you'd find in the more expensive apps, such as Final Draft and Movie Magic Screenwriter, and there's even free and paid iPhone, iPad, and Android apps available

Explanation:

Short Questions: a) What is website? How can we browse internet using website?​

Answers

Answer:

A website is a set of related web page or pages located under a single domain name. These pages contain specific information which was all provided by one person or entity and traces back to a common Uniform Resource Locator or (URL).

Explanation:

There are millions of Websites around the world and contain information about everything.

How is kerning used in Word?

to adjust the spacing between two paragraphs
to adjust the spacing between words in a paragraph
to adjust the spacing between characters that make up a word
to adjust the spacing between a paragraph and the page border

Answers

Answer: To adjust the spacing between characters that make up a word

Explanation: Kerning refers to the way spacing between two specific characters is adjusted. The idea is to give a better looking result by reducing the spacing between characters that fit together nicely (such as "A" and "V") and increasing the spacing between characters that don't. Select the text that you want to change.

Answer:

C. To adjust the spacing between characters that make up a word

Explanation:

hope this helps :)

What is generation of computer ?​

Answers

I HOPE THIS INFORMATION WILL HELP YOU A LOT......

Generation in computer terminology is a change in technology a computer is/was being used. Initially, the generation term was used to distinguish between varying hardware technologies. Nowadays, generation includes both hardware and software, which together make up an entire computer system.

Hope this answer helps you..!!

..

..

Plz select it as the BRAINLIEST..!!

what is a computer in daily life​

Answers

Answer:

The use of computers on a regular basis in our life is very important. Technically in daily life computer is used to convert raw facts and data into meaningful information and knowledge. Computer science is explored and challenged by humans daily. The computer is like an electronic magical device for our life.

Explanation:

The IT manager has tasked you with installing new physical machines. These computer systems are barebone systems that simply establish a remote connection to the data center to run the user's virtualized desktop. Which type of deployment model is being used

Answers

The type of deployment model that is used is referred to as Thin client.

A thin client is also referred to as lean client. It is a model that runs on the resources that are stored on a central server rather than in the resources if the computer.

A thin client is useful for shared services, and desktop virtualization. The work carried out by the server include storage of data, performing if calculation, launching software programs etc.

On conclusion, since the information given in the question explains that there's a remote connection to the data center to run the user's virtualized desktop, then the deployment model is a thin client.

Read related question on:

https://brainly.com/question/13934016

Which is not true about climatic normals?

Multiple choice question.

A)
They can differ from daily weather conditions.

B)
They are gathered at one location.

C)
They are averaged over a 30-year period.

D)
They describe average conditions.

Answers

Answer:

I think c is correct answer

Explanation:

hope it's help yu

Write a program that takes the account's present value, monthly interest rate, and the number of months that the money will be left in the account as three inputs from the user. The program should pass these values to a function thatreturns the future value of the account, after the specified number of months. The program should print the account's future value.

Answers

Answer:

Assuming this is going to de made with python:

def main():

   currentValue = float(input("Current value of account: "))

   monthlyInterestRate = float(input("Monthly interest rate: "))

   monthsToWait = int(input("Amount of months the money will be left in the account: "))

   monthlyInterestRateToPercent = monthlyInterestRate / 100

   futureValue = float(round((currentValue + currentValue * monthlyInterestRateToPercent * monthsToWait), 2))

   print("The future value of this account will be " + str(futureValue))

main()

Explanation:

Hope this helped. Also, if this is incorrect please tell me what needs to be added so I can add it for future viewers. Have a good day :)

Richard needs to copy information from another slide presentation that uses a different design template. To ensure that the information he is copying looks right, which option should he choose?

Answers

Answer:

Yes, you can copy the slides over into a presentation with master slide. Then, right-click each slide, and choose to apply an appropriate template from the master slide

(from vik7336: Hi, I'm not sure about my answer for your question. So I hope this might help)

pasagot po please need lang po

Answers

me I can not see it oooo re write it

When you evaluate the use of digital media, how has it affected the newspaper business? The rise of digital media has caused newspaper subscriptions to decline significantly because people are finding their news online. The rise of digital media has had no measurable effect on newspaper subscriptions. The rise of digital media has caused newspaper subscriptions to increase because it has inspired people to care more about news. The rise of digital media has caused newspaper subscriptions to fluctuate depending on the time of year.

Answers

Answer:

The rise of digital media has caused newspaper subscriptions to decline significantly because people are finding their news online.

It is A

Answer:

The rise of digital media has caused newspaper subscriptions to decline significantly because people are finding their news online.

Which are characteristics of a video with a higher
bit rate? Choose all that apply.
fewer frames per second
more frames per second
lower quality
higher quality
larger file size
smaller file size

Answers

Answer:

D and E.

Explanation:

Once the CPU has fetched the data requested, what are the next steps in the process?

A
execute, articulate

B
perform, execute

C
decode, analyze

D
decode, execute

MULTIPLE CHOICE

Answers

Answer:

D. decode execute

Explanation:

a program in matchine language is called​

Answers

Answer:

mcq

Explanation:

machine code is a computer program written in a machine code

write full information about first computer virus ?​

Answers

Answer:

A computer virus is a man made program just like other program.it is a harmful program developed intentionally to distrub the normal functioning of a computer.It can destroy data,information and other useful programs of the computer.As the result you will not get data,information and other useful progarams to use.when it destroy operating system software of a computer.

Answer:

The "Creeper system," the first computer virus, was an experimental self-replicating virus released in 1971. It was filling up the hard disk to the point that a computer could no longer function. BBN technology in the United States produced this virus. When the Creeper virus infects a computer, it causes it to output a file. It will then cease to function while it searches for another TENEX system. It creates a connection with the machine in question, and so on. Its last payload or impact when it's finished with a system is to display its message.

OAmalOHopeO

Next, Sue decides to embed a chart from Microsoft Word. She copies and pastes data from a table that she has already created in a Word document. The table includes the results of her paper towel experiment. After reviewing her work, she realizes she needs to update one of the values.
How can she change that value so it is reflected in the chart in her presentation?
She can change the value in the original table in Word.
She can change the value directly on the chart in PowerPoint.
She can change the value using the Current Selection command group.
She can change the value in the mini- spreadsheet for the chart in PowerPoint.

Answers

Answer:

She can change the value in the mini- spreadsheet for the chart in PowerPoint.

Answer:

Answer is D

Explanation:

what means the data is still saved even if you turn the computer off or unplug it?​

Answers

Answer:                      

Explanation:

The hard drive is long-term storage, which means the data is still saved even if you turn the computer off or unplug it. When you run a program or open a file, the computer copies some of the data from the hard drive onto the RAM. When you save a file, the data is copied back to the hard drive.

Which of the following is an example of sharing personal information in a risky manner?
posting about your favorite clothing brand
sending an e-mail to a recipient you know
using Microsoft Excel to create a spreadsheet
searching for a restaurant on

Answers

The example of sharing personal information in a risky manner would be

searching for a restaurant online.

How is this an example of sharing personal information in a risky manner

While the other options mentioned do not  inherently involve sharing personal information  in a risky manner searching for a restaurant online may involve providing personal information such as your location or contact details if you're making a reservation or placing an order.

It's important to be cautious while sharing personal information online and ensure that you're using secure and trusted platforms when providing sensitive details.

Learn more about personal information at

https://brainly.com/question/27034337

#SPJ1

Assume the existence of a Building class. Define a derived class, ApartmentBuilding that contains four (4) data members: an integer named numFloors, an integer named unitsPerFloor, a boolean named hasElevator, and a boolean named hasCentralAir. There is a constructor containing parameters for the initialization of the above variables (in the same order as they appear above). There are also two function: the first, getTotalUnits, accepts no parameters and returns the total number of units in the building; the second, isLuxuryBuilding accepts no parameters and returns true if the building has central air, an elevator and 2 or less units per floor.

Answers

Answer:

Explanation:

The following code is written in Java. The class ApartmentBuilding extends the assumed class of Building but does not call any of its methods since we do not have access to it. The ApartmentBuilding class contains all of the variables listed, as well as constructor and methods, including getter and setter methods for each variable. A test case for the class is provided in the image below with it's output.

class ApartmentBuilding extends Building {

   int numFloors, unitsPerFloor;

   boolean hasElevator, hasCentralAir;

   public ApartmentBuilding(int numFloors, int unitsPerFloor, boolean hasElevator, boolean hasCentralAir) {

       this.numFloors = numFloors;

       this.unitsPerFloor = unitsPerFloor;

       this.hasElevator = hasElevator;

       this.hasCentralAir = hasCentralAir;

   }

   public int getTotalUnits() {

       int total = this.numFloors * this.unitsPerFloor;

       return total;

   }

   public boolean isLuxuryBuilding() {

       if ((this.hasCentralAir == true) && (this.hasElevator == true) && (this.unitsPerFloor <= 2)) {

           return true;

       } else {

           return false;

       }

   }

   public int getNumFloors() {

       return numFloors;

   }

   public void setNumFloors(int numFloors) {

       this.numFloors = numFloors;

   }

   public int getUnitsPerFloor() {

       return unitsPerFloor;

   }

   public void setUnitsPerFloor(int unitsPerFloor) {

       this.unitsPerFloor = unitsPerFloor;

   }

   public boolean isHasElevator() {

       return hasElevator;

   }

   public void setHasElevator(boolean hasElevator) {

       this.hasElevator = hasElevator;

   }

   public boolean isHasCentralAir() {

       return hasCentralAir;

   }

   public void setHasCentralAir(boolean hasCentralAir) {

       this.hasCentralAir = hasCentralAir;

   }

}

Draw a circuit with a 12-volt battery, a 100 ohms resistor in series, and two resistors (each of value 200 ohms) in parallel. What is the total resistance of the circuit?

Answers

Answer:

200 Ω

Explanation:

Hi there!

Please see below for the circuit diagram.

1) Find the total resistance of the resistors in parallel

Total resistance in parallel equation: [tex]\frac{1}{R_T} = \frac{1}{R_1} +\frac{1}{R_2}[/tex]

Both the resistors measure 200 Ω. Plug these into the equation as R₁ and R₂:

[tex]\frac{1}{R_T} = \frac{1}{200} +\frac{1}{200}\\\frac{1}{R_T} = \frac{1}{100}\\R_T=100[/tex]

Therefore, the total resistance of the resistors in parallel is 100 Ω.

2) Find the total resistance of the circuit

Now, to find the total resistance of the circuit, we must add the 100 Ω we just solved for and the 100 Ω for the other resistor placed in series:

100 Ω + 100 Ω = 200 Ω

Therefore, the total resistance of the circuit is 200 Ω.

I hope this helps!

Consider the following scenario. As you troubleshoot the problem, what motherboard device would be the first to check? A user reports that his computer fails the POST upon startup. ROM CMOS RAM Power supply Processor

Answers

Answer:

The correct answer Power Supply

Explanation:

Write an application that allows a user to input the height and width of a rectangle. It should output the area and perimeter of the rectangle. Use methods for entering the values, performing the computations, and displaying the results. Results should be formatted with one position to the right of the decimal and printed number aligned in a tabular display.

Answers

Answer:

Explanation:

This code is written in Java. It creates a Rectangle class that contains variables for the height and width. It also contains constructor, methods for calculating perimeter and area, and a printInfo method to print out all the results. A test case has been created in the main method which creates a Rectangle object and prints out the printInfo which calls the area and perimeter methods as well. The output can be seen in the attached image below. Due to technical difficulties I have added the code as a txt file below.

if person is male their username is the last 3 letters of their surname and the first 2 letters of their first name if a person is female their username is the first 3 letters of their first name and the last 2 letters of their last name. write an algorithm to output a username (Could you answer in Python pls)​

Answers

gender = input("What's your gender? (`male` or `female`): ")

firstname = input("What's your firstname?: ")

surname = input("What's your surname?: ")

username = ""

if gender == "male":

   username += surname[-3:]

   username += firstname[0:2]

elif gender == "female":

   username += firstname[0:3]

   username += surname[-2:]

print(f'Your username is {username}')

what is DMTS. Explain it​

Answers

Answer:

DMT — or N, N-dimethyltryptamine in medical talk — is a hallucinogenic tryptamine drug. Sometimes referred to as Dimitri, this drug produces effects similar to those of psychedelics, like LSD and magic mushrooms. Other names for it include: fantasia.

Explanation:

Answer:

DMT, abbreviation of Dimethyltryptamine, powerful, naturally occurring hallucinogenic compound structurally related to the drug LSD (lysergic acid diethylamide). DMT blocks the action of serotonin (a transmitter of nerve impulses) in brain tissue. It is inactive when taken by mouth and produces effects only when injected, sniffed, or smoked. The hallucinatory action

Explanation:

Major plant genera containing DMT include Phalaris, Delosperma, Acacia, Desmodium, Mimosa, Virola, and Psychotria, but DMT has been found even in apparently innocuous sources, such as leaves of citrus plants (Servillo et al., 2012), and in the leaves, seeds, and inner bark of mimosa tenuiflora

cual es el procedimientos para asistir en el transporte publico a personas discapacitadas

Answers

Answer:

Una discapacidad física o motora en una o más partes del cuerpo obstaculiza las acciones y / o movimientos de la persona con discapacidad. La discapacidad puede surgir porque las partes del cuerpo no han crecido completamente o están dañadas (anomalías físicas) o porque las funciones físicas están alteradas (anomalías funcionales).

En la mayoría de los casos, se proporciona una ayuda a las personas con discapacidades físicas graves para que puedan desenvolverse más fácilmente en la sociedad. Alguien con una discapacidad motora severa en las piernas a menudo usa una silla de ruedas. Las personas con una discapacidad motora de las manos (pérdida de la motricidad fina) o de los brazos pueden compensar esto con un manipulador o ayudas especializadas en tareas, como un dispositivo para comer o un dispositivo para girar las hojas.

Así, todos estos elementos deben ser posibles de ser insertados en los medios de transporte público como forma de ayudar a estas personas a trasladarse por estos medios, es decir, los autobuses, trenes, etc., deben estar adaptados para poder recibir allí a pasajeros en sillas de ruedas o con necesidades motoras especiales.

Online retailers can and should encourage every customer to sign up for regular emails from the retailer. To avoid spam filters, retailers should Group of answer choices automatically send regular emails to all customers send emails to all customers except those who request to be taken off the email list provide a check box that is checked by default during the checkout process for customers to sign up for emails provide a check box that is unchecked by default during the checkout process for customers to sign up for emails ANS:DPTS:1

Answers

Answer:

Provide a check box that is checked by default during the checkout process for customers to sign up for emails

Explanation:

I've seen this used the most so I would go with this answer.

The way online retailers get you is by showing you a prechecked email subscription with an unchecked TOS agreement. Your attention is then focused on the TOS agreement and not the agreement for promotions sent to you via email.

A is a distinctive characteristic of a virus or virus family.

Answers

Answer:

Assuming your talking about a computer virus(because your under the Computers and Technology section)

Also assuming you meant "What is a distinctive characteristic of a virus or virus family."

A computer virus is a software that was created with the intent of damaging a computer. Computer viruses can replicate them selves by modifying other software on the computer. Viruses such as file infectors can override the machine code of another application and inject its own malicious machine code to perform malicious acts. This is especially dangerous for the OS as the virus can override essential files.

Explanation:

Create a program that uses a separate module to calculate sales tax and total after tax.

Create a c++ program using console.h and console.cpp files that uses a separate module to calculate sales tax and total after tax.

Console

Sales Tax Calculator

ENTER ITEMS (ENTER 0 TO END)

Cost of item: 35.99

Cost of item: 27.50

Cost of item: 19.59

Cost of item: 0

Total: 83.08

Sales tax: 4.98

Total after tax: 88.06

Again? (y/n): y

ENTER ITEMS (ENTER 0 TO END)

Cost of item: 152.50

Cost of item: 59.80

Cost of item: 0

Total: 212.30

Sales tax: 12.74

Total after tax: 225.04

Again? (y/n): n

Answers

Answer:

I nor know this one oo abeg sorry

Select three physical forms of storage. USB drive Primary cache Magnetic storage Secondary cache Dynamic RAM Optical drive

Answers

Answer:USB drive

Magnetic storage

Optical drive

Explanation:

hope this helps

What is binary number system? Why is it used in computer system?

Answers

Answer:

Computers depend mainly on binary because it’s more time efficient for them to so.

Explanation:

It’s easier to identify 0 as “off” and 1 as “on”. As you may know, transistors are the fundamental blocks of microprocessors and ICs. The reasons this is the case is that these transistors form logic gates which can carry out basic logic operations. These logic gates are a huge step into making microprocessors/ICs/etc. And what do these logic gates depend on? They depend on binary.

Whoa whoa, wait a minute. Let’s first take a step back to know a thing or two about logic gates.

These logic gate can be constructed from transistors. They carry basic logic operations. You have one or more inputs “entering” the logic gate ——-> A certain operation is performed on them ——-> you get your output. The input is a voltage. This voltage it can be interpreted as an “on” or “off” according to the gate. Once again these offs and ons are 0s and 1s. For example the Inverter/NOT gate is a gate that simply takes an input and gives its inverse. For example:-

A low voltage/an “off” signal/ a “0” “enters” the NOT gate. ——-> A high voltage/an “on” signal/ a “1” is the result of the operation performed

(In the above example low voltage = “off” signal = 0, high voltage = “on” signal = 1)

As you can see, a 0 enters the NOT gate and a 1 comes out or vice versa. Now, if you were a logic gate, you’d prefer working with just 0s and 1s right? I would. This would be much easier to work with than a lot of different values.

It’s a herculean task to work with these though as a human. And fortunately, programming languages exist for giving the computer instructions to do in a “language” other than its own.

I nut bun is how binary liks bavlls
Other Questions
Which best describes how Erasmus sought to reform the Catholic Church?He wanted to form a new branch of Christianity.He hoped the Church would reform from within.He wanted the Church to suppress Luthers ideas.He wanted Catholics to join Luthers new faith. what changes must be done to the wire to increase its conductance. What is the initial value of 34.2 x 3^x What are irregular verbs in spanish There were 230 shoppers at an electronics store on opening day. The specials that day allowed 21% of shoppers to receive a free set of earbuds and 25% of shoppers to receive $5 off their first purchase. Answer parts a and b.a. About how many shoppers received a free set of earbuds? Use an equivalent fraction to estimate.b. About how many shoppers received $5 off their first purchase? Round the number of shoppers to the nearest whole number. Determine the constant of variation for the direct variation given. (0, 0), (3, 12), (9, 36)1243 In countries where automobile insurance includes compensation for whiplash injuries sustained in automobile accidents, reports of having suffered such injuries are twice as frequent as they are in countries where whiplash is not covered. Presently; no objective test for whiplash exists, so it is true that spurious reports of whiplash injuries cannot be readily identified. Nevertheless, these facts do not warrant the conclusion drawn by some commentators that in the countries with the higher rates of reported whiplash injuries, half of the reported cases are spurious. Clearly, in countries where automobile insurance does not include compensation for whiplash, people often have little incentive to report whiplash injuries that they actually have suffered.In the argument given, the two boldfaced portions play which of the following roles?(A) The first is a claim that the argument disputes; the second is a conclusion that has been based on that claim.(B) The first is a claim that has been used to support a conclusion that the argument accepts; the second is that conclusion.(C) The first is evidence that has been used to support a conclusion for which the argument provides further evidence; the second is the main conclusion of the argument.(D) The first is a finding whose implications are at issue in the argument; the second is a claim presented in order to argue against deriving certain implications from that finding.(E) The first is a finding whose accuracy is evaluated in the argument; the second is evidence presented to establish that the finding is accurate. Please help ASAP!!!! Sally is serving lemonade to four friends. She is serving 4/7 cup per person. Estimate how much lemonade she needs. Then calculate exactly how much she needs. What is the difference between the estimate and actual amount?pls help, :) Plz help me with this thank you Choose the synonym for the word emergence that best fits in the sentence The Emergence of the Beatles, a popular rock band , changed the course of musical history.A. Popularity B. Intelligence C. SoundD. Debut The brain is the seat of _______________ and _______________. (-1/2^5)2^3(3/4^2) [EVALUATE] You pull credit on a husband and wife. It turns out their debt-to-income ratio is too high. You notice the majority of the debts belong to the husband. You also note that the wife has enough income to qualify on her own. You remove the husband from the loan, with permission from the borrower, submit the file, and receive approval. This action is: Qu oraciones usan el subjuntivo en una expresin impersonal correctamente?Hay ms de una respuesta correcta. Elige todas las opciones correctas.Es necesario que calienten los totopos de maz.Es terrible que salpimienten el pat. Es curioso probar totopos de maz calientes.Le fastidia que su madre agregue especias.Le aburre que le enseen a cocinar.multiple choice If the temperature of a volume of dieal gas ncreases for 100 to 200, what happens to the average kinetic energy of the molecules? which two consecutive integers does q lie Select the correct text in the passage.Which part of the sentence needs to be revised to eliminate wordiness and redundancy?First and foremost, take time to plan your essay to create a stress-free environment when it's time to create your draft. Help me please guyyyyy please help! What is the definition of thermal chemistry?a.The study of change that involves warm objectsb.The study of change that involves heatc.The study of change that involves cool objectsd.The study of change that involves temperature