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 turbine operates at steady state, and experiences a heat loss. 1.1 kg/s of water flows through the system. The inlet is mainta
strojnjashka [21]

Answer:

\dot W_{out} = 399.47\,kW

Explanation:

The turbine is modelled after the First Law of Thermodynamics:

-\dot Q_{out} -\dot W_{out} + \dot m\cdot (h_{in}-h_{out}) = 0

The work done by the turbine is:

\dot W_{out} = \dot m \cdot (h_{in}-h_{out})-\dot Q_{out}

The properties of the water are obtained from property tables:

Inlet (Superheated Steam)

P = 10\,MPa

T = 520\,^{\textdegree}C

h = 3425.9\,\frac{kJ}{kg}

Outlet (Superheated Steam)

P = 1\,MPa

T = 280\,^{\textdegree}C

h = 3008.2\,\frac{kJ}{kg}

The work output is:

\dot W_{out} = \left(1.1\,\frac{kg}{s}\right)\cdot \left(3425.9\,\frac{kJ}{kg} -3008.2\,\frac{kJ}{kg}\right) - 60\,kW

\dot W_{out} = 399.47\,kW

5 0
3 years ago
A satellite at a distance of 36,000 km from an earth station radiates a power of 10 W from an
notsponge [240]
This an example solved please follow up with they photo I sent ok

4 0
3 years ago
How can any student outside apply for studying engineering at Cambridge University​
telo118 [61]
Admission to the Engineering course at Cambridge is highly competitive, both in terms of the numbers and quality of applicants. In considering applicants, Colleges look for evidence both of academic ability and of motivation towards Engineering. There are no absolute standards required of A Level achievement, but it should be noted that the average entrant to the Department has three A* grades. You need to get top marks in Maths and Physics.All Colleges strongly prefer applicants for Engineering to be taking a third subject that is relevant to Engineering.
Hope that helps and good luck if you are applying. Can you please mark this as brainliest and press the thank you button and if you have any further questions please let me know!!
3 0
3 years ago
1. On a 2001 Honda Civic, while replacing fuel injectors, what do you coat the new O-rings with?
scoundrel [369]

Answer:

Coat new O-rings (D) with silicone oil or polyalkyleneglycol (PAG) oil, and pull them on the injectors.

3 0
3 years ago
100 kg of R-134a at 200 kPa are contained in a piston–cylinder device whose volume is 12.322 m3. The piston is now moved until t
LekaFEV [45]

Answer:

T=151 K, U=-1.848*10^6J

Explanation:

The given process occurs when the pressure is constant. Given gas follows the Ideal Gas Law:

 pV=nRT

For the given scenario, we operate with the amount of the gas- n- calculated in moles. To find n, we use molar mass: M=102 g/mol.  

Using the given mass m, molar mass M, we can get the following equation:  

 pV=mRT/M

To calculate change in the internal energy, we need to know initial and final temperatures. We can calculate both temperatures as:

T=pVM/(Rm); so initial T=302.61K and final T=151.289K

 

Now we can calculate change of U:

U=3/2 mRT/M using T- difference in temperatures

 U=-1.848*10^6 J

Note, that the energy was taken away from the system.  

5 0
4 years ago
Other questions:
  • A rectangular channel 6 m wide with a depth of flow of 3m has a mean velocity of 1.5 m/sec. The channel undergoes a smooth, grad
    7·1 answer
  • At a certain elevation, the pilot of a balloon has a mass of 120 lb and a weight of 119 lbf. What is the local acceleration of g
    6·1 answer
  • A 40 mph wind is blowing past your house and speeds up as it flows up and over the roof. If the elevation effects are negligible
    14·1 answer
  • A 40kg steel casting (Cp=0.5kJkg-1K-1) at a temperature of 4500C is quenched in 150kg of oil (Cp=2.5kJkg-1K-1) at 250C. If there
    13·1 answer
  • What additional information would make the following problem statement stronger? Select all that apply.
    8·1 answer
  • Heyyyyyyyyy people wrud
    7·1 answer
  • Joe, a technician, is attempting to connect two hubs to add a new segment to his local network. He uses one of his CAT5 patch ca
    9·1 answer
  • Using the following data, determine the percentage retained, cumulative percentage retained, and percent passing for each sieve.
    6·1 answer
  • Of the core elements of successful safety and health programs, Management Leadership, Worker Participation, and what else relate
    10·2 answers
  • Find the remaining trigonometric function of 0 if
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!