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
Shows a closed tank holding air and oil to which is connected a U-tube mercury manometer and a pressure gage. Determine the read
damaskus [11]

Answer:

P_2-P_1=27209h

Explanation:

For pressure gage we can determine this by saying:

The closed tank with oil and air has a pressure of P₁ and the pressure of oil at a certain height in the U-tube on mercury is p₁gh₁. The pressure of mercury on the air in pressure gauge is p₂gh₂. The pressure of the gage is P₂.

P_1+p_1gh_1=p_2_gh_2+P_2

We want to work out P₁-P₂: Heights aren't given so we can solve it in terms of height: assuming h₁=h₂=h

P_1-P_2=p_1gh_1-p_2gh_2=(55)\cdot{32.2}h-845\cdot{32.2}h

P_2-P_1=27209h

3 0
4 years ago
2. What is the Function of the Camshaft in an Internal Combustion Engine?
mamaluj [8]

Answer:

camshaft, in internal-combustion engines, rotating shaft with attached disks of irregular shape (the cams), which actuate the intake and exhaust valves of the cylinders.

Explanation:

I'm taking an engineering/tech class. I hope this helps! :)

8 0
3 years ago
Modify the one-dimensional continuity equation to include rainfall over the free surface
KonstantinChe [14]

The rainfall run off model  HEC-HMS is combined with river routing model. They are used for simulating the rainfall process.

Explanation:

The HEC - HMS rainfall model is used for simulating the rainfall runoff process. In this study the soil conservation service and curve number method is used to calculate the sub basin loss in basin module.

It provides various options for providing the rainfall distributions in the basin. It has the control specification module used to control the time interval for the simulations.

The one dimensional continuity equation is

бA / бT + бQ / бx= 0

3 0
3 years ago
A square silicon chip (k = 152 W/m·K) is of width 7 mm on a side and of thickness 3 mm. The chip is mounted in a substrate such
Harrizon [31]

Answer:

The steady-state temperature difference is 2.42 K

Explanation:

Rate of heat transfer = kA∆T/t

Rate of heat transfer = 6 W

k is the heat transfer coefficient = 152 W/m.K

A is the area of the square silicon = width^2 = (7/1000)^2 = 4.9×10^-5 m^2

t is the thickness of the silicon = 3 mm = 3/1000 = 0.003 m

6 = 152×4.9×10^-5×∆T/0.003

∆T = 6×0.003/152×4.9×10^-5 = 2.42 K

7 0
3 years ago
List two ways you can make an informal survey
solniwko [45]

The two ways you can use to make an informal survey are:

  • make field observations
  • interview people using informal unstructured techniques

<h3>What are informal surveys?</h3>

In informal surveys can be regarded as a type of survey that can be made by the researcher by going to the field themselves and this can be done by using different methods or ways.

For instance, the researcher can go out to interview people that can give the data that is needed about the research such as informally asking them questions,  unstructured techniques can also be used to solve critical issues.

learn more about survey at: brainly.com/question/6947486

#SPJ9

8 0
2 years ago
Read 2 more answers
Other questions:
  • You live on a street that runs East to West. You just had 2 inche of snow and you live on the North side of the street. You retu
    14·1 answer
  • Early American rockets used an RC circuit to set the time for the rocket to begin re-entry after launch (true story). Assume the
    5·1 answer
  • A family quarantined at home in March/April 2020 has two dogs: a bull mastiff (Biggie), and a chihuahua (Smalls). Smalls has a b
    9·1 answer
  • Write a matrix, that is a lower triangular matrix.
    15·1 answer
  • 1. The area of the given triangle is 25 square units. What is the value of x?<br> X+2
    8·1 answer
  • If block A of the pulley system is moving downward at 6 ft&gt;s while block C is moving down at 18 ft&gt;s, determine the relati
    10·1 answer
  • The mechanical advantage of a screw is always ____________________ than/to 1. Question 5 options: less, greater, equal, none of
    7·1 answer
  • An airplane flies horizontally at 80 m/s. Its propeller delivers 1300 N of thrust (forward force) to overcome aerodynamic drag (
    15·1 answer
  • Your local hospital is considering the following solution options to address the issues of congestion and equipment failures at
    6·1 answer
  • How to plot 0.45 gradation chart for sieve analysis ?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!