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
r-ruslan [8.4K]
3 years ago
5

Biologists use a sequence of letters A, C, T, and G to model a genome. A gene isa substring of a genome that starts after a trip

let ATG and ends before a tripletTAG, TAA, or TGA. Furthermore, the length of a gene string is a multiple of 3and the gene does not contain any of the triplets ATG, TAG, TAA, and TGA.Write a program that prompts the user to enter a genome and displays all genesin the genome. If no gene is found in the input sequence, the program displays nogene is found.Here are sample runs of the program:Enter a genome string: TTATGTTTTAAGGATGGGGCGTTAGTTTTTGGGCGTEnter a genome string: TGTGTGTATATno gene is found

Engineering
1 answer:
kogti [31]3 years ago
7 0

Answer:

You did not mention the programming language for implementation so i am writing a JAVA code.

import java.util.Scanner; // to get input from user

public class Genome{

public static void main(String[] args) { //start of main() function body

Scanner input = new Scanner(System.in); //creates Scanner object

System.out.print("Enter a genome string: ");

//prompts user to enter a genome string

String genome = input.nextLine();

//reads the input genome string and stores it into genome variable

boolean gene_found = false;

//variable gene_found of boolean type that has two value true or false

int startGene = 0; // stores starting of the gene string

for (int i = 0; i < genome.length() - 2; i++) {

//loop moves through genome string until the third last gene character

String triplet = genome.substring(i, i + 3);

//stores the triplet of genome substring

if (triplet.equals("ATG")) {

//if value in triplet is equal to ATG

startGene = i + 3;

//3 is added to i-th position of the genome string

}

else if (((triplet.equals("TAG")) || (triplet.equals("TAA")) || (triplet.equals("TGA"))) &&(startGene != 0))

//checks if the genome ends with one the given triplets TAG TAA and TGA

{ String gene = genome.substring(startGene, i);

gene stores substring of genome string from startGene to the position i

if (gene.length() % 3 == 0)

//if the the mod of gene length is 0 then the gene is found

{gene_found = true;

System.out.println(gene); //returns the found gene

startGene = 0;} } }

if (!gene_found) //if gene is not found returns the message below

System.out.println("no gene is found"); }  }

Explanation:

This program first asks user to enter a genome string.

The loop starts from the first character of the entered string and this loop continues to execute until the value of i is 2 less than the genome input string length.

triplet variable stores first 3 characters of the genome string in first iteration and then moves through the string taking 3 characters each. This is done by dividing genome string to substring of 3 characters.

If condition checks if the 3 characters of genome string matches ATG using equals() function. If it is true this means start of genome is reached and these triplets are stored in startGene.

Else condition checks the end of the genome as the genome ends before one of TAG, TAA or TGA triplets. So this is checked here.

gene variable holds the triplet value stored in startGene and the value stored in index position i which means it holds the start of the genome till the end of the genome sequence. The end which is pointed by i variable is 2 less than the genome length and it is stored in gene variable.

After the loop ends the substring stored in gene variable is checked for a valid genome sequence by mod operator. If the length of the value stored in gene variable mod 0 is equal to 0 this means genome sequence is found and this string sequence stored in gene is displayed else the no gene is found message is displayed on output screen.

You might be interested in
When watching your weight, you want to snack smart. To do that, you want a snack that is going to __________.
andreev551 [17]
Make u be healthy ...........
5 0
3 years ago
A piston–cylinder device contains a mixture of 0.5 kg of H2 and 1.2 kg of N2 at 100 kPa and 300 K. Heat is now transferred to th
Taya2010 [7]

Answer:

(a) The heat transferred is 2552.64 kJ    

(b) The entropy change of the mixture is 1066.0279 J/K

Explanation:

Here we have

Molar mass of H₂ = 2.01588 g/mol

Molar mass of N₂ = 28.0134 g/mol

Number of moles of H₂ = 500/2.01588  = 248 moles

Number of moles of N₂ = 1200/28.0134 = 42.8 moles

P·V = n·R·T

V₁ = n·R·T/P = 290.8×8.3145×300/100000 = 7.25 m³

Since the volume is doubled then

V₂ = 2 × 7.25 = 14.51 m³

At constant pressure, the temperature is doubled, therefore

T₂ = 600 K

If we assume constant specific heat at the average temperature, we have

Heat supplied = m₁×cp₁×dT₁ + m₂×cp₂×dT₂

 cp₁ = Specific heat of hydrogen at constant pressure = 14.50 kJ/(kg K

cp₂ = Specific heat of nitrogen at constant pressure = 1.049 kJ/(kg K

Heat supplied = 0.5×14.50×300 K+ 1.2×1.049×300 =  2552.64 kJ    

b)  \Delta S = - R(n_A \times lnx_A + n_B \times ln x_B)

Where:

x_A and x_B are the mole fractions of Hydrogen and nitrogen respectively.

Therefore, x_A = 248 /(248 + 42.8) = 0.83

x_B = 42.8/(248 + 42.8) = 0.1472

∴ \Delta S = - 8.3145(248 \times ln0.83 + 42.8 \times ln 0.1472) =  1066.0279 J/K

5 0
3 years ago
help me please help me please help me please help me please help me please help me please help me please help me please help me
kakasveta [241]

Answer:

With what?

Explanation:

Brainliest?

7 0
3 years ago
Read 2 more answers
A container filled with a sample of an ideal gas at the pressure of 150 Kpa. The gas is compressed isothermally to one-third of
lyudmila [28]

Answer: c) 450 kPa

Explanation:

Boyle's Law: This law states that pressure is inversely proportional to the volume of the gas at constant temperature and number of moles.

P\propto \frac{1}{V}     (At constant temperature and number of moles)

P_1V_1=P_2V_2  

where,

P_1 = initial pressure of gas  = 150 kPa

P_2 = final pressure of gas  = ?

V_1 = initial volume of gas   = v L

V_2 = final volume of gas  = \frac{v}{3}L

150\times v=P_2\times \frac{v}{3}  

P_2=450kPa

Therefore, the new pressure of the gas will be 450 kPa.

7 0
4 years ago
6) A deep underground cavern Contains 980 cuft
Elza [17]

Answer:

15625 moles of methane is present in this gas  deposit

Explanation:

As we know,

PV = nRT

P = Pressure = 230 psia = 1585.79 kPA

V = Volume = 980 cuft = 27750.5 Liters

n = number of moles

R = ideal gas constant = 8.315

T = Temperature = 150°F = 338.706 Kelvin

Substituting the given values, we get -

1585.79 kPA * 27750.5 Liters = n * 8.315 * 338.706 Kelvin

n = (1585.79*27750.5)/(8.315 * 338.706) = 15625

3 0
3 years ago
Other questions:
  • Technician A says diesel engines are also called compression ignition engines. Technician B says diesel engines have much higher
    9·1 answer
  • How much time does it take a freezer to make a tray of ice cubes out of a tray of 0.25kg liquid water at 10 Celsius). Assume the
    13·1 answer
  • Why do we write proton ions first before electron ions? <br>​
    10·1 answer
  • Impact strips may be designed into a bumper cover.<br> True<br> False
    14·1 answer
  • Quinn’s relatives relayed a story about putting on a headset and seeing a digital world that they could walk around in and explo
    8·2 answers
  • A parallel circuit has a resistance of 280 and an inductive reactance of 360 02. What's this circuit's impedance?
    6·1 answer
  • What is anthropology? Discuss the type of anthropology?
    5·2 answers
  • If a population has no predadors and plenty of available resources, how might that population change
    15·1 answer
  • Why do giant stars become planetary nebulas while supergiant stars become supernovas when their nuclear fusion slows and is over
    8·1 answer
  • At the beginning of last year, tarind corporation budgeted $1,000,000 of fixed manufacturing overhead and chose a denominator le
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!