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
Infinitivo de vivia kkk xd
blagie [28]

Answer:

pls put a question not random letters

Explanation:

8 0
3 years ago
A(n) is a detailed, structured diagram or drawing.
monitta

Answer:

Schematics

Explanation:

A schematic is a detailed structured diagram or drawing. It employs illustrations to help the viewer understand detailed information on the machine or object being described. Its main aim is not to help the observer know what the object looks like physically. It is rather aimed at helping the viewer know how the machine works. This is achieved by only including key and important details to the drawing.

It is most times used in the blueprint and user guides of machines and gadgets used in the home to help users know how these things work so that they can do little fixings should there be such needs.

6 0
2 years ago
A group of n Ghostbusters is battling n ghosts. Each Ghostbuster carries a proton pack, which shoots a stream at a ghost, eradic
babunello [35]

Answer:

Using the above algorithm matches one pair of Ghostbuster and Ghost. On  each side of the line formed by the pairing, the number of Ghostbusters and Ghosts are  the same, so use the algorithm recursively on each side of the line to find pairings. The  worst case is when, after each iteration, one side of the line contains no Ghostbusters  or Ghosts. Then, we need n/2 total iterations to find pairings, giving us an P(n^{2} lg n)-  time algorithm.

4 0
3 years ago
Find the mechanical average of a wheel axle System of the wheel has a radius of 1.5 feet in the accident has a radius of 6 inche
kvasek [131]

Answer:

Mechanical average of a wheel = 3

Explanation:

Given:

Radius of wheel = 1.5 ft = 1.5 x 12 = 18 inches

Radius of axle = 6 inches

Find:

Mechanical average of a wheel

Computation:

Mechanical average of a wheel = Radius of wheel / Radius of axle

Mechanical average of a wheel = 18 / 6

Mechanical average of a wheel = 3

4 0
3 years ago
generally compound curves are not filtered recommended for A. Road B. water way C. underground road D. rail way​
vfiekz [6]

Answer:

C. underground road

Explanation:

Generally compound curves are not filtered and recommended for use in an underground road. However, they are best used in the road, water way, and rail way.

3 0
3 years ago
Other questions:
  • Please help me with this question​
    8·1 answer
  • A field sample of an unconfined aquifer is packed in a test cylinder. The length and diameter of the cylinder are 50 cm and 6 cm
    9·1 answer
  • A 26-tooth pinion rotating at a uniform 1800 rpm meshes with a 55-tooth gear in a spur gear reducer. Both pinion and gear are ma
    11·1 answer
  • Do you think the mining process is faster when you know in advance that the land must be restored? Explain.
    14·1 answer
  • A two-phase mixture of water and steam with a quality of 0.63 and T = 300F expands isothermally until only saturated vapor rema
    7·1 answer
  • Hi I have a question!! Please answer it ASAP, tysm!
    13·1 answer
  • Market research is a good place to start the design process and usually involves asking questions about consumers.
    5·1 answer
  • What type of plans have to do with earth, soil, excavation, and location<br> of a house on a lot?
    12·1 answer
  • For a bolted assembly with eight bolts, the stiffness of each bolt is kb = 1.0 MN/mm and the stiffness of the members is km = 2.
    14·1 answer
  • When framing a building, a simple way to estimate the total amount of wall studs needed is to allow
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!