Question

IN C programming 4.15 LAB: Password modifier Many user-created passwords are simple and easy to guess....

IN C programming

4.15 LAB: Password modifier

Many user-created passwords are simple and easy to guess. Write a program that takes a simple password and makes it stronger by replacing characters using the key below, and by appending "q*s" to the end of the input string. You may assume that the string does not contain spaces and will always contain less than 50 characters.

  • i becomes !
  • a becomes @
  • m becomes M
  • B becomes 8
  • o becomes .

Ex: If the input is:

mypassword

the output is:

[email protected]*s

C PROGRAMMING

Homework Answers

Answer #1
#include <stdio.h>

int main() {
    char password[100];

    scanf("%s", password);

    int i = 0;
    while (password[i]) {
        char ch = password[i];
        if (password[i] == 'i') {
            ch = '!';
        } else if (password[i] == 'a') {
            ch = '@';
        } else if (password[i] == 'm') {
            ch = 'M';
        } else if (password[i] == 'B') {
            ch = '8';
        } else if (password[i] == 'o') {
            ch = '.';
        }
        printf("%c", ch);
        i++;
    }
    printf("q*s\n");
    return 0;
}
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT
Active Questions
  • Emerald Co. uses a perpetual inventory system and records purchases of merchandise at net cost. The...
    asked 52 minutes ago
  • Movie stars and U.S. presidents have fished Pyramid Lake. It is one of the best places...
    asked 1 hour ago
  • what advantages do percent distributions have over frequency distributions when comparing populations at different years?
    asked 1 hour ago
  • Richard has just been given a 6-question multiple-choice quiz in his history class. Each question has...
    asked 1 hour ago
  • Write about westernized elements in life; westernization in our life, and this includes Americanization.
    asked 2 hours ago
  • The college Physical Education Department offered an Advanced First Aid course last summer. The scores on...
    asked 2 hours ago
  • Researchers hypothesized that increasing a woman's level of arousal would increase her perceptions of attractiveness of...
    asked 3 hours ago
  • Equation 37-14b in the textbook gives the energy emitted by Hydrogen when electrons transition between states...
    asked 3 hours ago
  • Theory of Computation Please provide explanation too on how it works a. Give an NFA recognizing...
    asked 3 hours ago
  • Question 1 A sequential pattern detection circuit (state machine) has input A and output Y, which...
    asked 3 hours ago
  • Natural Foods Inc. is planning to invest in new manufacturing equipment to make a new garden...
    asked 3 hours ago
  • Explain why a callable bond's price would be expected to decline less than an otherwise comparable...
    asked 4 hours ago