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
Which of the following are made up of electrical probes and connectors?
Mariulka [41]
Uhm is there a multiple choice?
6 0
3 years ago
Given the circuit at the right in which the following values are used: R1 = 20 kΩ, R2 = 12 kΩ, C = 10 µ F, and ε = 25 V. You clo
agasfer [191]

Answer:

a.) I = 7.8 × 10^-4 A

b.) V(20) = 9.3 × 10^-43 V

Explanation:

Given that the

R1 = 20 kΩ,

R2 = 12 kΩ,

C = 10 µ F, and

ε = 25 V.

R1 and R2 are in series with each other.

Let us first find the equivalent resistance R

R = R1 + R2

R = 20 + 12 = 32 kΩ

At t = 0, V = 25v

From ohms law, V = IR

Make current I the subject of formula

I = V/R

I = 25/32 × 10^3

I = 7.8 × 10^-4 A

b.) The voltage across R1 after a long time can be achieved by using the formula

V(t) = Voe^- (t/RC)

V(t) = 25e^- t/20000 × 10×10^-6

V(t) = 25e^- t/0.2

After a very long time. Let assume t = 20s. Then

V(20) = 25e^- 20/0.2

V(20) = 25e^-100

V(20) = 25 × 3.72 × 10^-44

V(20) = 9.3 × 10^-43 V

8 0
2 years ago
Velocity and temperature profiles for laminar flow in a tube of radius ro = 10 mm have the form: u(r) = 0.15[1 − (r/ro ) 2 ] T(r
antoniya [11.8K]

Answer:

Tm = 366.66k

Explanation:

check for the step by step explanation in the attachment

8 0
3 years ago
A friend would like you to build an "electronic eye" for use as a fake security device. The device consists of three lights line
mars1129 [50]

Answer and explanation:

The graphical representation of the electronic eye

The state table showing

the present state

input

Next state and

the output

are shown in the attached file

8 0
3 years ago
Read 2 more answers
Omg I just got 17/25 questions wrong using this on an Ag test , but got 100’s every time on health
Fudgin [204]

Answer:

sorry im answering questions for the points cuz im built dfferent

Explanation:

5 0
2 years ago
Read 2 more answers
Other questions:
  • When circuit switching is used, what is the maximum number of circuit-switched users that can be supported? Explain your answer
    6·1 answer
  • What are the weight restrictions for a small UAS, including everything onboard at the time
    12·1 answer
  • A 100-mm-diameter cast Iron shaft is acted upon by a 10 kN.m bending moment, a 8 kN.m torque, and a 150 kN axial force simultane
    9·1 answer
  • Users say that the game is interesting to look at but the music gets annoying
    9·1 answer
  • A(n) ____ is an exact representation of an object projected onto a plane from a specific position.
    14·1 answer
  • Technician A says that the distributor cap provides a connection point between the rotor and each individual cylinder plug wire.
    10·1 answer
  • How do Geothermal plowerplants relate to engineering?
    11·1 answer
  • Use the drop-down menus to complete the statements about using OneNote in Outlook meeting requests.
    15·1 answer
  • QUESTION<br> Which of the following would assembler do an ideal automated assembly line?
    8·1 answer
  • Help please!!!!!
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!