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
Lostsunrise [7]
2 years ago
14

Can we use a data type as a condition in C++?

Computers and Technology
1 answer:
Vaselesa [24]2 years ago
3 0
No you can’t use a data type as a condition but you can use function overloading or templates to attempt to bypass this.
You might be interested in
Atomic Term If an atom carries no charge, the positive charges from protons are balanced by the negative charges from the
Neko [114]

Answer:

yee ha

Explanation:

7 0
3 years ago
Two-dimensional array indexes are listed as
Luda [366]

Answer:

rows and columns, or matrix

Explanation:

Two-dimensional 2D arrays are being indexed with the help of two subscripts. The first one is for the row and the second one if for the column. And each of the elements of the 2D array must be of the one kind like they all can be an object type or they all can be of primitive type.

Like:

int A[3][3];

The above is the 2-dimensional array in C++, and elements are of type int, which is a primitive data type.

5 0
4 years ago
1. Write a program to prompt the user to enter a single character and respond back whether or not the character is valid dna. 2.
Nina [5.8K]

Answer:

Answer 1:

dna = input("Enter DNA type: ")

dna = dna.upper()

print(dna)

if dna == "A" or dna == "B" or dna == "Z":

   print("valid")

else:

   print("invalid")

Answer 2:

rna = input("Enter DNA type: ")

rna = rna.lower()

print(rna)

if rna == "m" or rna == "t" or rna == "r":

   print("valid")

else:

   print("invalid")

Answer 3:

dnaSquence = input("Enter the DNA sequence: ")

type = "valid"

for char in dnaSquence:

   if char not in ["A", "C", "G", "T"]:

       type = "invalid"

       break

print(type)

Answer 4:

rnaSquence = input("Enter the RNA sequence: ")

type = "valid"

for char in rnaSquence:

   if char not in ["A", "C", "G", "U"]:

       type = "invalid"

       break

print("valid")

Explanation:

There are three types of DNA; Type A, Type B and Type Z.

A DNA sequence consists of; A, C, G and T.

There are three types of RNA; mRNA, tRNA and rRNA.

An RNA sequence consists of; A, C, G and U.

Code Explanations:

Code 1:

dna = input("Enter DNA type: ")

dna = dna.upper()

print(dna)

if dna == "A" or dna == "B" or dna == "Z":

   print("valid")

else:

<em>    print("invalid")</em>

  1. prompts and Takes a single character input
  2. converts the character to upper case
  3. compares the input to the DNA types
  4. Prints "valid" for a valid input else prints "invalid"

Code 2:

rna = input("Enter DNA type: ")

rna = rna.lower()

print(rna)

if rna == "m" or rna == "t" or rna == "r":

   print("valid")

else:

<em>    print("invalid")</em>

<em />

  1. prompts and Takes a single character input
  2. converts the character to lower case
  3. compares the input to the RNA types
  4. Prints "valid" for a valid input else prints "invalid"

Code 3:

Answer 3:

dnaSquence = input("Enter the DNA sequence: ")

type = "valid"

for char in dnaSquence:

   if char not in ["A", "C", "G", "T"]:

       type = "invalid"

       break

print(type)

  1. It prompts for a DNA sequence.
  2. Declares a string variable "type" and initializes type to valid.
  3. The FOR loop checks every character in the DNA sequence.
  4. If the character is not in the list [A, C, G, T] type becomes invalid and the loop breaks and the type "invalid" is printed to the screen.
  5. if all the characters are in the list, then type will remain valid and will be printed to the screen.

Code 4:

rnaSquence = input("Enter the RNA sequence: ")

type = "valid"

for char in rnaSquence:

   if char not in ["A", "C", "G", "U"]:

       type = "invalid"

       break

print("valid")

  1. It prompts for a RNA sequence.
  2. Declares a string variable "type" and initializes type to valid.
  3. The FOR loop checks every character in the RNA sequence.
  4. If the character is not in the list [A, C, G, U] type becomes invalid and the loop breaks and the type "invalid" is printed to the screen.
  5. if all the characters are in the list, then type will remain valid and will be printed to the screen.

7 0
3 years ago
what is the term used when a virus takes control of features on your computer and transports files or information automatically?
Akimi4 [234]

Answer: a "worm"

Explanation:

3 0
3 years ago
Which of the following types of e-commerce presence is best suited for creating an ongoing conversation with one's customers?A)
Over [174]

Answer:

C) Social media

Explanation:

Social media is a vital marketing tool in the modern era. Aside from posting photos or status updates, using social media for customer service can elevate your business to the next level. Social media has strong potential to better address customer service issues. And if you address and resolve customer concerns over social media in short enough time, the exchange can help you create a loyal customer base.

8 0
3 years ago
Other questions:
  • The document theme does not determine the appearance of the styles. true or false
    13·2 answers
  • NO BODY KNOWS! How old is Cynthia Blaise!?
    7·1 answer
  • An automotive engine's camshaft rotates at
    8·2 answers
  • Knowledge management software helps companies preserve the knowledge gained through the use of information so that future users
    15·2 answers
  • A set of instructions to increase a programmer’s pay rate by 10 percent is hidden inside an authorized program. It changes and u
    12·1 answer
  • Which protocol is used to send web pages from a web server to a web browser?
    13·1 answer
  • A mysql prompt has been opened for you. Using the college database, complete the following tasks (use either a single-line or a
    7·1 answer
  • State the name of the following computer components​
    14·2 answers
  • In the 1760s and early 1770s, the British government wanted to raise money by taxing the residents of its colonies in North Amer
    8·1 answer
  • The set Canvas.PaintColor to block sets the paint color for the _____ .
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!