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
When are computers most vulnerable to threats or damage?
valentinak56 [21]
With virus protection
8 0
4 years ago
Convert the following three hexadecimal numbers to both binary and decimal. (Hint: it is probably easier to convert hex to binar
Doss [256]

Answer:

3e : 00111110 (62)

3e0 : 0000001111100000 (992)

3e00 : 0011111000000000 (15872)

Explanation:

Converting the given hexadecimal numbers to binary and decimal format:

1) 3e

3-> 0011

e-> 1110

Combining , 3e -> 00111110

This can be converted to decimal by multiplying each 1 in the binary representation by 2^(position -1) and adding the results.

So 3e = 32+16+8+4+2 = 62

2) 3e0

Binary => 0000001111100000

Converting to decimal : 992  [ This is 16 times a]

3) 3e00

Binary => 0011111000000000

Converting to decimal : 15872 [ This is 16 times b]

So adding a 0 to the hex representation multiplies the decimal number by 16.

6 0
3 years ago
Kristen wants to view the records of her database in ascending order. What should she do?
Elanso [62]

the answer is Sort the table

6 0
3 years ago
Read 2 more answers
What is this <br>name which console it is ​
ZanzabumX [31]

Answer:

ps3

Explanation:

becaus with is and I'm right

6 0
3 years ago
Read 2 more answers
How the full address space of a processor is partitioned and how each partition is used?
Sati [7]

Answer:

?

Explanation:

?

6 0
3 years ago
Other questions:
  • During World War II, the Battle of the Coral Sea was significant because it evened the naval strength of the Japanese and US fle
    6·1 answer
  • How does modularity provide flexibility in a structured programming design?
    6·1 answer
  • An excel worksheet can have a maximum of ____ columns in a worksheet.
    14·1 answer
  • HOW IS THE AUTOFILL FEATURE HELPFUL? A.IT CREATE A NEW FORMULA FOR EVERY CELL IN THE DOCUMENT B.IT CAN SAVE TIME BY ALLOWING YOU
    13·1 answer
  • Deciding whether to explode a process further or determine that it is a functional primitive is a matter of experience, judgment
    8·1 answer
  • What is the first thing you should do when troubleshooting a computer problem
    5·2 answers
  • In C complete the following:
    12·1 answer
  • Draw a flowchart to compute sum A=10 &amp; B=20​
    10·1 answer
  • The Syntax NPV formula includes the Rate, The Cash Flows, the number of payments, and the Future
    12·1 answer
  • Which website citation is correctly formatted according to MLA standards?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!