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
vitfil [10]
4 years ago
5

Replace any alphabetic character with '_' in 2-character string passCode. Ex: If passCode is "9a", output is:

Computers and Technology
1 answer:
allochka39001 [22]4 years ago
4 0

Answer:

Code which is pasted in the place of "/* Your solution goes here */":

 if (isalpha(passCode[0])) // if statement for the first character of the passcode string.

      passCode[0]='_';

  if (isalpha(passCode[1]))  // if statement for the second character of the passcode string.

      passCode[1]='_';

Output:

  • If the user gives input as '4h', then it will prints '4_'.
  • If the user gives input as 'a8', then the output is '_8'.

Explanation:

Missing information:

  • There is a three header file missing in the question programming code which names as the "cctype", 'iostream', 'cstring'.

Code Explanation:

  • The above code is in c++ programing language, which is pasted on the place of "/* Your solution goes here */", which is written in the question part.
  • The first if-statement checks the first character of the string that it is a charter or not if it is a character then replace the character with an underscore.
  • The second if-statement is used to check the second character of the staring that is it a character or not if it then replaces the character with an underscore.

You might be interested in
Consider the following code segment. for (int a = 0; a < 10; a++) { for (int b = 10; b > a; b--) { System.out.print("#");
Ket [755]

Answer:

55

Explanation:

Given the codes as below:

  1.        for (int a = 0; a < 10; a++)
  2.        {
  3.            for (int b = 10; b > a; b--)
  4.            {
  5.                System.out.print("#");
  6.            }
  7.        }

There are two layer loops in the code. The outer loop (Line 1) will run for 10 iterations by traversing through a = 0 to a=9. However, the inner loop  (Line 3) will run for 10 + 9 +  8 + 7 +...+ 1 = 55 iterations.

Since the print statement is within the inner loop (Line 5) and therefore the number of printed "#" symbols is dependent on the number of iterations of the inner loop. There will be 55 "#" symbols printed.

6 0
4 years ago
Does anyone know a working free spotify premium on ios 2021 plz i have had any luck finding anything:(​
natima [27]
No sorry

................
5 0
3 years ago
Read 2 more answers
Type the correct answer in the box. Spell all words correctly.
diamong [38]
The answer is handouts.
A handout is a pamphlet with information on your presentation you can give to your audience
8 0
4 years ago
Which of the following translates packets so that the node can understand them once they enter through a port?
podryga [215]
Hi
D)A NICHappy to assist you!
8 0
3 years ago
Read 2 more answers
Whoever understands this first and replies will be the brainliest.<br><br><br><br> Road work ahead?
Scorpion4ik [409]

I SURE HOPE IT DOES (this is the best vibe if you dont get this you are an uncultured swine)

7 0
4 years ago
Read 2 more answers
Other questions:
  • // This pseudocode should create a report that contains an
    14·1 answer
  • Give big-O estimate for the number of operations (multiplication or addition) used in the following algorithm segment (ignore co
    15·1 answer
  • Write a MARIE program to calculate some basic statistics on a list of positive numbers. The program will ask users to input the
    6·1 answer
  • You have a web application hosted in AWS cloud where the application logs are sent to Amazon CloudWatch. Lately, the web applica
    7·1 answer
  • How do the companies gather data to determine common passwords?
    13·1 answer
  • Write a program that reads a list of integers, and outputs whether the list contains all even numbers, odd numbers, or neither.
    5·1 answer
  • Define and explain the two different methods by which a file can be compressed. Briefly describe one pro and one con for both ty
    13·1 answer
  • 24 POINTS!!! <br> Why are Sequences, Selection, and Iteration building blocks of algorithms?
    5·1 answer
  • Another term for the plot structure of the hero journey
    13·1 answer
  • Please help me.
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!