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
Do heavier cars really use more gasoline? Suppose a car is chosen at random. Let x be the weight of the car (in hundreds of poun
RoseWind [281]

Answer:

Do heavier cars really use more gasoline? Suppose a car is chosen at random. Let x be the weight of the car (in hundreds of pounds), and let y be the miles per gallon (mpg)

Explanation:

6 0
4 years ago
Water flows with a velocity of 3 m/s in a rectangular channel 3 m wide at a depth of 3 m. What is the change in depth and in wat
strojnjashka [21]

Answer: new depth will be 3.462m and the water elevation will be 0.462m.

The maximum contraction will be achieved in width 0<w<3

Explanation:detailed calculation and explanation is shown in the image below

8 0
3 years ago
A 10-mm steel drill rod was heat-treated and ground. The measured hardness was found to be 290 Brinell. Estimate the endurance s
grandymaker [24]

Answer:

the endurance strength  S_e = 421.24  MPa

Explanation:

From the given information; The objective is to estimate the endurance strength, Se, in MPa .

To do that; let's for see the expression that shows the relationship between the ultimate tensile strength and Brinell hardness number .

It is expressed as:

200 \leq H_B \leq 450

S_{ut} = 3.41 H_B

where;

H_B = Brinell hardness number

S_{ut} =  Ultimate tensile strength

From ;

S_{ut} = 3.41 H_B; replace 290 for H_B ; we have

S_{ut} = 3.41 (290)

S_{ut} = 988.9 MPa

We can see that the derived value for the ultimate tensile strength when the Brinell harness number = 290 is less than 1400 MPa ( i.e it is 988.9 MPa)

So; we can say

S_{ut} < 1400

The Endurance limit can be represented by the formula:

S_e ' = 0.5 S_{ut}

S_e ' = 0.5 (988.9)

S_e ' = 494.45 MPa

Using Table 6.2 for parameter for Marin Surface modification factor. The value for a and b are derived; which are :

a = 1.58

b =  -0.085

The value of the surface factor can be calculate by using the equation

k_a = aS^b_{ut}

K_a = 1.58 (988.9)^{-0.085

K_a = 0.8792

The formula that is used to determine the value of  k_b for the rotating shaft of size factor d = 10 mm is as follows:

k_b = 1.24d^{-0.107}

k_b = 1.24(10)^{-0.107}

k_b = 0.969

Finally; the the endurance strength, Se, in MPa if the rod is used in rotating bending is determined by using the expression;

S_e =k_ak_b S' _e

S_e= 0.8792×0.969×494.45

S_e = 421.24  MPa

Thus; the endurance strength  S_e = 421.24  MPa

8 0
3 years ago
A program contains the following function definition: int cube(int number) { return number * number * number; } Write a stateme
Nonamiya [84]

Answer:

The statement can be written as

int result = cube(4);

Explanation:

A function is a block of reusable codes to perform some tasks. For example, the function in the question is to calculate the cube of a number.

A function can also operate on one or more input value (argument) and return a result. The <em>cube </em>function in the question accept one input value through its parameter <em>number </em>and the <em>number</em> will be multiplied by itself twice and return the result.  

To call a function, just simply write the function name followed with parenthesis (e.g. <em>cube()</em>). Within the parenthesis, we can include zero or one or more than one values as argument(s) (e.g. <em>cube(4)</em>).

We can then use the "=" operator to assign the return output of the function to a variable (e.g. <em>int result = cube(4)</em>)

8 0
4 years ago
Anything that is made to meet a need or desire is?
slavikrds [6]

Answer:

I think it is process or technology

7 0
3 years ago
Read 2 more answers
Other questions:
  • 1. What is an op-amp? List the characteristics of an ideal op-amp
    11·1 answer
  • Alberta Einstein teaches a business class at Podunk University. To evaluate the students in this class, she has given three test
    13·1 answer
  • Lately, you have noticed some repetitive stress in your wrist. Which sign is most likely the cause of that stress and pain?
    7·1 answer
  • An aggregate blend is composed of 65% coarse aggregate by weight (Sp. Cr. 2.635), 36% fine aggregate (Sp. Gr. 2.710), and 5% fil
    5·1 answer
  • (25) Consider the mechanical system below. Obtain the steady-state outputs x_1 (t) and x_2 (t) when the input p(t) is the sinuso
    9·1 answer
  • The removed soil at an excavation site is also called spoil?​
    14·1 answer
  • What is meant by the acronym ISO
    15·1 answer
  • A heating system must maintain the interior of a building at TH = 20 °C when the outside temperature is TC = 2 °C. If the rate o
    10·1 answer
  • Yeah this question might be difficult as most of the brainly community is math. Hope I can find at last one robotics person. ;-;
    13·2 answers
  • A system of organization, people activities, informations, and resources involved in supplying a productor or service to a custo
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!