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
To find your personal learning style you can
JulsSmile [24]
Https://simplelifestrategies.com/sls-learningstyle/ this list may help ypu decide
6 0
3 years ago
Read 2 more answers
How can officers in the armed services receive college educations? Select the best answer choice. A. All of the answers are corr
Ber [7]

Answer:

i think A. is the answer but if it isn't B. Taking courses through the GI Bill is correct

Explanation:

i have multiple friends that are recruiters and i'm in rotc.

4 0
2 years ago
The seven basic parts of a computer are
True [87]
Monitor, keyboard, CPU, mouse, and I believe the USB drive , DVD drive and hardware system
4 0
2 years ago
Read 2 more answers
Ways to ask for help effectively include
Step2247 [10]

Answer:

All of these choices

Explanation:

Clarity → the quality of being coherent and intelligible.

Sincerity → the quality of being free from pretense, deceit, or hypocrisy

Open mind → Open-mindedness is receptiveness to new ideas.

8 0
2 years ago
Write a program that accepts a positive integer N as command-line argument, and outputs True if N is the square of some integer,
Ann [662]

Answer:

In Python:

N = int(input("Positive integer: "))

if N > 0:

   flag = False

   for i in range(1,N+1):

       if i * i == N:

           flag = True

           break

   print(str(flag))

else:

   print("Positive integer only")

   

Explanation:

N = int(input("Positive integer: "))

If the number is positive

if N > 0:

This initializes a boolean variable to false

   flag = False

This iterates from 1 to the input integer

   for i in range(1,N+1):

This checks if th number is a square of some integer

       if i * i == N:

If yes, flag is set to true

           flag = True

The loop is exited

           break

This prints either true or false, depending on the result of the loop

   print(str(flag))

If otherwise, that the number is not positive

<em>else:</em>

<em>    print("Positive integer only")</em>

3 0
2 years ago
Other questions:
  • type the correct answer in the Box spell the words correctly Caleb is working on a simple logic base program to stimulate the ga
    5·2 answers
  • When a dynamic array with a class for a base type is declared, which constructor is called?
    5·1 answer
  • What is binary number
    11·1 answer
  • You have just finished writing a lengthy research paper and you are ready for formatting. You insert your paragraph headings and
    15·1 answer
  • _____ are likely to support bigger government, social welfare programs, and legalized abortion.
    8·2 answers
  • Which system utility can you use to troubleshoot a computer that's slow to start by enabling or disabling startup programs?
    7·2 answers
  • Who watches Riverdale ? if you do can we be friends(pLEASE DON'T DELETE) and also who is your fav character from Riverdale
    8·2 answers
  • Liam is at the park an would like to play soccer. He tell another kid at the park that he would hurt him if he couldn't play soc
    10·2 answers
  • Why would you use a computer's secondary memory?
    12·1 answer
  • A timer is set after each frame is sent before waiting an ACK for that frame, how long does the timer take to be expired?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!