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
Files and folders in UNIX can be removed using the
wel

<em>Files and folders in UNIX can be removed using the</em>  <u><em>rm command.</em></u>

<em>The answer is B. rm command </em>

<em>Hope this helps :)</em>

3 0
3 years ago
Mix ‘em Let s1 and s2 be 2 c-strings of the same length. Write a function char* mixem(char*s1, char* s2) which returns a c-strin
Shkiper50 [21]

Answer:

See Explaination

Explanation:

#include <iostream>

#include <string.h>

using namespace std;

char *mixem(char *s1, char *s2);

int main() {

cout << mixem("abc", "123") << endl;

cout << mixem("def", "456") << endl;

return 0;

}

char *mixem(char *s1, char *s2) {

char *result = new char[1 + strlen(s1) + strlen(s2)];

char *p1 = s1;

char *p2 = s2;

char *p = result;

while (*p1 || *p2) {

if (*p1) {

*p = *p1;

p1++;

p++;

}

if (*p2) {

*p = *p2;

p2++;

p++;

}

}

*p = '\0';

return result;

}

5 0
3 years ago
How did domestication of maize make the city of tenochtitlan possible?
umka21 [38]

The farming of maize began in Mesoamerica in 6000 B.C. The domestication of maize made the city of Tenochtitlan possible by providing the Aztecs the ability to feed millions. Unlike the corn that is known today, the early maize had tiny cobs but dramatically became bigger and more nutritious as time passed.


3 0
3 years ago
Read 2 more answers
Explain the types of computer on the basis of model<br>​
RoseWind [281]

XT(extra technology) computer: it cannot support GUI Based operating system. its processing speed is 477MHz

AT(advanced technology):it supports GUI Operating system. Its processing speed is 2GHz

PS/2:is a laptop computer which is rechargeable

and battery powered. it's operated with OS/2 operating system.

PLEASE MARK AS BRAINLIEST

6 0
3 years ago
Read 2 more answers
QUESTION 7
marishachu [46]
False, it needs to be properly cited because that is plagiarism which is illegal
6 0
3 years ago
Other questions:
  • What does it mean to be self demanding?
    12·1 answer
  • Biomimicry is the term used when engineers are inspired by objects found in nature? Group of answer choices True False
    10·1 answer
  • A network needs to be set up with 60 subnets. Given the IPv4 class C address 192.168.100.0, what subnet mask value should be use
    7·1 answer
  • Please hurry Arrange the steps of the engineering design process in the correct sequence.
    10·1 answer
  • what are the benefits of VolP? select all that apply. A:cheaper printings B:clearer calls C: faster download D: increased effici
    11·2 answers
  • Who like the videos where is clown is from :)
    6·1 answer
  • NumA = 3 <br>numB = 2<br>Result = numA ** numB
    12·1 answer
  • WILL GIVE BRAINLEIST PLZ HELP PLZ AND THANK YOU
    7·1 answer
  • Which of these five are Netflix Originals?1/5
    5·1 answer
  • What is the current record holder for the fastest car in the world? What is the top speed of it? 100 points to whoever gets it c
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!