answer.
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
avanturin
2 months ago
15

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

statements to check each of the two characters in the string, using isalpha().fix :#include #include #include using namespace std;int main() {string passCode;cin >> passCode;/* Your solution goes here */cout << passCode << endl;return 0;}

Computers and Technology
1 answer:
ivann1987 [1K]2 months ago
7 0

Answer:

The required code is provided below.

I trust this will assist you!

Explanation:

You might be interested in
A video conferencing application isn't working due to a Domain Name System (DNS) port error. Which record requires modification
Rzqust [1037]

Answer:

Service record (SRV)

Explanation:

Service records, known as SRV records, contain information defining aspects of the DNS like port numbers, server details, hostnames, priority, weight, and the IP addresses of designated service servers.

The SRV record serves as a valuable reference for locating specific services, as applications needing those services will search for the corresponding SRV record.

When configured, the SRV provides the necessary ports and personal settings for a new email client; without this, the parameters within the email client will be incorrect.

8 0
2 months ago
Which of the following best describes how computing devices represent information? A. A computer will either represent informati
oksian1 [950]

Answer:

The answer is B.

Explanation:

The justification for choosing B is that "bytes" represent the correct method for storing data in binary form of 0s and 1s.

5 0
2 months ago
Read 2 more answers
Write a Python3 program to check if 3 user entered points on the coordinate plane creates a triangle or not. Your program needs
Rzqust [1037]

Answer:

tryagain = "Y"

while tryagain.upper() == "Y":

    x1 = int(input("x1: "))

    y1 = int(input("y1: "))

    x2 = int(input("x2: "))

    y2 = int(input("y2: "))

    x3 = int(input("x3: "))

    y3 = int(input("y3: "))

    area = abs(x1 *(y2 - y3) + x2 * (y1 - y3) + x3 * (y1 - y2))

    if area > 0:

         print("Inputs form a triangle")

    else:

         print("Inputs do not form a triangle")

    tryagain = input("Press Y/y to try again: ")

Explanation:

To check for this, we will simply compute the area of the triangle given that inputs are on a coordinate plane i.e. (x,y).

An area greater than 0 means it's a triangle

Conversely, if not, it's not a triangle.

This line starts the loop with variable tryagain set to Y

tryagain = "Y"

while tryagain.upper() == "Y":

Following lines retrieve the triangle's coordinates     x1 = int(input("x1: "))

    y1 = int(input("y1: "))

    x2 = int(input("x2: "))

    y2 = int(input("y2: "))

    x3 = int(input("x3: "))

    y3 = int(input("y3: "))

Now, this computes the area

    area = abs(x1 *(y2 - y3) + x2 * (y1 - y3) + x3 * (y1 - y2))

Finally, this checks the condition mentioned above.

    if area > 0:

         print("Inputs form a triangle") This message appears if the condition is true

    else:

         print("Inputs do not form a triangle") This is printed if the condition is not met

    tryagain = input("Press Y/y to try again: ") It prompts the user to input new values

4 0
22 days ago
Debug the program so it prints the factorial of a positive integer entered by the user. This is calculated by multiplying all th
Natasha_Volkova [1026]
The primary issue was declaring int prod within the while loop, which caused prod to reset to 1 each time the loop executed.
3 0
1 month ago
Input a number [1-50] representing the size of the shape and then a character [x,b,f] which represents the shape i.e. x-&gt;cros
Harlamova29_29 [1022]

Response:

C++ code provided below with suitable annotations

Clarification:

pattern.cpp

#include<iostream>

using namespace std;

void printCross(int n)

{

int i,j,k;

if(n%2) //odd number of lines

{

for(int i=n;i>=1;i--)

{

for(int j=n;j>=1;j--)

{

if(j==i || j==(n-i+1))

cout<<j;

else

cout<<" ";

}

cout<<"\n";

}

}

else //even number of lines

{

for(int i=1;i<=n;i++)

{

for(int j=1;j<=n;j++)

{

if(j==i || j==(n-i+1))

{

cout<<" "<<j<<" ";

}

else

cout<<" ";

}

cout<<"\n";

}

}

void printForwardSlash(int n)

{

if(n%2)

{

for(int i=n;i>=1;i--)

{

for(int j=n;j>=1;j--)

{

if(j==n-i+1)

{

cout<<j;

}

else

cout<<" ";

}

cout<<"\n";

}

}

else

{

for(int i=1;i<=n;i++)

{

for(int j=1;j<=n;j++)

{

if(j==(n-i+1))

{

cout<<j;

}

else

cout<<" ";

}

cout<<"\n";

}

}

}

void printBackwardSlash(int n)

{

if(n%2) // odd number of lines

{

for(int i=n;i>=1;i--)

{

for(int j=n;j>=1;j--)

{

if(j==i)

{

cout<<j;

}

else

cout<<" ";

}

cout<<"\n";

}

}

else //even number of lines

{

for(int i=1;i<=n;i++)

{

for(int j=1;j<=n;j++)

{

if(j==i)

{

cout<<j;

}

else

cout<<" ";

}

cout<<"\n";

}

}

}

int main()

{

int num;

char ch;

cout<<"Create a numberes shape that can be sized."<<endl;

cout<<"Input an integer [1,50] and a character [x,b,f]."<<endl;

cin>>num>>ch;

if(ch=='x' || ch=='X')

printCross(num);

else if(ch=='f' || ch=='F')

printForwardSlash(num);

else if(ch=='b' || ch=='B')

printBackwardSlash(num);

else

cout<<"\nWrong input"<<endl;

return 0;

}

4 0
1 month ago
Other questions:
  • A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To ac
    11·2 answers
  • Which is among the earliest formats of audio used in video games? A. MP3 B. wave table synthesis C. pulse code modulation D. MOD
    7·2 answers
  • Which of the following is true? a. Pseudocode is used to describe an algorithm. b. Pseudocode is not an actual computer programm
    11·1 answer
  • 5.15 LAB: Output values below an amount Write a program that first gets a list of integers from input. The input begins with an
    9·2 answers
  • Write a generator function named count_seq that doesn't take any parameters and generates a sequence that starts like this: 2, 1
    5·1 answer
  • hard disk drive has 16 platters, 8192 cylinders, and 256 4KB sectors per track. The storage capacity of this disk drive is at mo
    13·1 answer
  • _______________ is used by a hacker to mask intrusion and obtain administrator permissions to a computer.
    7·1 answer
  • Dr. Collins has a personal website where he encourages his students to solve questions and discuss topics he taught in class. Wh
    14·2 answers
  • Which of the following is true of how packets are sent through the internet?
    10·2 answers
  • On January 1, 1980, Moises deposited $1850 into a savings account paying 5.6% interest, compounded quarterly. If he hasn't made
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!