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
A high-voltage direct-current (dc) transmission line between Celilo, Oregon and Sylmar, California is 845 mi in length. The line
Gennadij [26K]

Answer:

<u>Total Mass of Conductors = 19913661.3 kg</u>

Explanation:

The total length is given as:

Total Length = 845 mi

Converting it to ft:

Total length = (845 mi)(5280 ft/1 mi)

Total length = 4,461,600 ft

The weight of one conductor per unit length is:

Mass of one conductor per unit length = 2460 lb/1000 ft

Mass of one conductor per unit length = 2.46 lb/ft

Since there are 4 conductors, therefore, total weight of all conductors per unit length will be:

Mass of all four conductors per unit length = 4 x 2.46 lb/ft

Mass of all four conductors per unit length = (9.84 lb/ft)(0.453592 kg/1 lb)

Mass of all four conductors per unit length = 4.463 kg/ft

Therefore, total mass of conductors in the line will be:

Total Mass of Conductors = (Mass of all four conductors per unit length)(Total Length)

Total Mass of Conductors = (4.463 kg/ft)(4,461,600 ft)

<u>Total Mass of Conductors = 19913661.3 kg</u>

4 0
4 years ago
The underground storage of a gas station has leaked gasoline into the ground. Among the constituents of gasoline are benzene, wi
vovangra [49]

Answer:

a) benzene = 910 days

b) toluene = 1612.67 days

Explanation:

Given:

Kd = 1.8 L/kg (benzene)

Kd = 3.3 L/kg (toluene)

psolid = solids density = 2.6 kg/L

K = 2.9x10⁻⁵m/s

pores = n = 0.37

water table = 0.4 m

ground water = 15 m

u = K/n = (2.9x10⁻⁵ * (0.4/15)) / 0.37 = 2.09x10⁻⁶m/s

a) For benzene:

R=1+\frac{\rho * K_{d}  }{n}, \rho = 2.6\\ R=1+\frac{2.6*1.8}{0.37} =13.65

The time will take will be:

t=\frac{xR}{a} , x=12,a=0.18\\t=\frac{12*13.65}{0.18} =910days

b) For toluene:

R=1+\frac{2.6*3.3  }{0.37} = 24.19

t=\frac{12*24.19}{0.18} =1612.67days

6 0
3 years ago
Read 2 more answers
5) Calculate the LMC wal thickness of a pipe and tubing with OD as 35 + .05 and ID as 25 + .05 A) 4.95 B) 5.05 C) 10 D) 15.025
padilas [110]

Answer:

B) 5.05

Explanation:

The wall thickness of a pipe is the difference between the diameter of outer wall and the diameter of inner wall divided by 2. It is given by:

Thickness of pipe = (Outer wall diameter - Inner wall diameter) / 2

Given that:

Inner diameter = ID = 25 ± 0.05, Outer diameter = OD = 35 ± 0.05

Maximum outer diameter = 35 + 0.05 = 35.05

Minimum inner diameter = 25 - 0.05 = 24.95

Thickness of pipe = (maximum outer wall diameter - minimum inner wall diameter) / 2 = (35.05 - 24.95) / 2 = 5.05

or

Thickness = (35 - 25) / 2 + 0.05 = 10/2 + 0.05 = 5 + 0.05 = 5.05

Therefore the LMC wall thickness is 5.05

6 0
3 years ago
Read 2 more answers
A constant-head permeability test gives the following information: - Water flows horizontally through the soil sample. - The hei
Marysya12 [62]

Answer:

Complete answer to the question is explained in the attached files.please have a look on it.

Explanation:

5 0
3 years ago
A 3 m aluminum pole is kept at a residential site for construction
Aliun [14]

Answer:

I don't know sorry

Explanation:

5 0
3 years ago
Other questions:
  • Dr. Thermo, only has one bottle of neon. However, he needs to run two experiments, each requiring its own bottle. Therefore, he
    13·1 answer
  • Write a function digits() that accepts a non-negative integer argument n and returns the number of digits in it’s decimal repres
    13·1 answer
  • Two kilograms of air in a piston-cylinder assembly undergoes an isothermal process from an initial state of 200K, 300kPa to 600k
    8·1 answer
  • Air enters a compressor operating at steady state at 176.4 lbf/in.^2, 260°F with a volumetric flow rate of 424 ft^3/min and exit
    10·1 answer
  • A 3-phase, 50 Hz, 110 KV overhead line has conductors placed in a horizontal plane 3 m apart. Conductor diameter is 2.5 cm. If t
    6·1 answer
  • Given a program with execution times broken down shown below. Assume that techniques can only be applied to accelerate the integ
    12·1 answer
  • Describe how a cavity wall works and sketch its major construction features. What aspects of cavity wall construction are most c
    5·1 answer
  • 4.7 If the maximum tensile force in any of the truss members must be limited to 22 kN, and the maximum compressive force must be
    9·1 answer
  • Determine the slopes and deflections at points B and C for the beam shown below by the moment-area method. E=constant=70Gpa I=50
    10·1 answer
  • A 1/20 scale model of a wing is used to determine forces on the actual airplane. the 1/20 scale refers to the:_____
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!