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
nevsk [136]
3 years ago
12

5. Write a program to remove any duplicate letters from a word and display the new word maintaining the original order. For exam

ple, bananas would become bans and bookkeeper would become bokepr. You may not use any special unique commands!
Computers and Technology
1 answer:
dexar [7]3 years ago
3 0

Answer:

word = input('Enter a single word: ', 's');

n = length(word);

nodupWord = [];

for i = 1:n

  dup = false;

  c = word(i);

  for j = 1:i-1

      if word(j) == c

          dup = true;

          break;

      end

  end

  if ~dup

      nodupWord = [nodupWord, c]; %add the non-duplicate char to end

  end

end

disp(['Adjusted word: ', nodupWord])

Explanation:

The code is in Python.

You might be interested in
1. Given two numbers, n and k ( 0< n, k <=12), generate all the pemutations taking k letters from n letters (nPk) consider
mixer [17]
It is 5jsjsjdhhdhdhdhdhdhdhdhdhd
8 0
3 years ago
Which of the following CANNOT be done in Normal view A. Enter bolded text in the Notes Pane B. Delete previously entered notes i
blondinia [14]

Answer:

<em>Well, Your answer will be is </em><em>B. Delete previously entered notes in the Notes Pane. Good Luck!</em>

3 0
3 years ago
To prepare a list of the ten largest cities in Asia, Luke should most likely use data to
kakasveta [241]
He should find answers about the population size hope this helps 
5 0
3 years ago
Read 2 more answers
Calculate the voltage between two points of the circuit of an iron through which a current of 4 amps passes and presents a resis
Varvara68 [4.7K]

def voltage_calculation (i, r):

return i*r

3 0
3 years ago
Which of the following is the process by which graphical content is created using the proper software ?
Y_Kistochka [10]
See it's option C because 3-D visualising means creating graphical content in computers now if we are creating it in computer means we are working with software so option C is correct there.
7 0
3 years ago
Other questions:
  • What types of data are commonly entered into a cell ?
    7·2 answers
  • What type of socket should be used with an air impact wrench
    12·1 answer
  • HTTP is made to facilitate which kind of communication?
    11·1 answer
  • Select the best option that should be considered when preparing these images to.be used for the web
    7·1 answer
  • To prevent unauthorized access and use, at a minimum a company should have a written __________ that outlines the activities for
    6·1 answer
  • Which of the following is not one of the four methods for classifying the various instances of malware by using the primary trai
    9·1 answer
  • ECG mashine is an example of
    12·1 answer
  • You have just read about a new security patch that has been made available for your Windows system, so you install the patch as
    6·1 answer
  • Even though jdoe and jrock have the same password (i.e., hacker), their password hashes in the /etc/shadow file are different. W
    15·1 answer
  • You have a computer that runs on a windows 10 operating system and supports modern sleep. what will happen if you close the lid
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!