/    Sign up×
Community /Pin to ProfileBookmark

java code unable to find genes in DNA strings

  • 1.

    Create a new Java project named StringsFirstAssignments. You can put all the classes for this programming exercise in this project.

  • 2.

    Create a new Java Class named Part1. The following methods go in this class.

  • 3.

    . Write the method findSimpleGene that has one String parameter dna, representing a string of DNA. This method does the following:

  • Finds the index position of the start codon “ATG”. If there is no “ATG”, return the empty string.
    Finds the index position of the first stop codon “TAA” appearing after the “ATG” that was found. If there is no such “TAA”, return the empty string.
    If the length of the substring between the “ATG” and “TAA” is a multiple of 3, then return the substring that starts with that “ATG” and ends with that “TAA”.

  • 4. Write the void method testSimpleGene that has no parameters. You should create five DNA strings. The strings should have specific test cases, such as: DNA with no “ATG”, DNA with no “TAA”, DNA with no “ATG” or “TAA”, DNA with ATG, TAA and the substring between them is a multiple of 3 (a gene), and DNA with ATG, TAA and the substring between them is not a multiple of 3. For each DNA string you should:
  • Print the DNA string.
    See if there is a gene by calling findSimpleGene with this string as the parameter. If a gene exists following our algorithm above, then print the gene, otherwise print the empty string.

    to post a comment
    Java

    4 Comments(s)

    Copy linkTweet thisAlerts:
    @NogDogSep 21.2020 — Most people here are not simply going to do your homework for you. However, if you tell us what you've tried and why it does not seem to be correct, we can help you find a fix.
    Copy linkTweet thisAlerts:
    @NogDogSep 21.2020 — [[58],[19,32]]
    Copy linkTweet thisAlerts:
    @NachfolgerSep 21.2020 — I need not repeat NogDog, but this forum isn't here to do homework assignments.

    Cherish the good days when you're coding easy projects in Java--They won't last long.
    Copy linkTweet thisAlerts:
    @VITSUSASep 22.2020 — @blest#1623472 If you are facing any problem in coding then you can ask your problem because other professionals are not here to do your homework.
    ×

    Success!

    Help @blest spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 4.24,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...