亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dnasequence.java

?? SSD3 Practical quiz2
?? JAVA
字號:
/**
 * This class represents a DNA sequence of nucleotides 'A', 'T', 'C' and 'G' as
 * a sequence of characters in a {@link String} object.
 * 
 * @author iCarnegie
 * @version 1.0.0
 */
public class DNASequence {

	/**
	 * Test driver for class <code>DNA</code>.
	 * 
	 * @param args
	 *            not used.
	 */
	public static void main(String[] args) {

		String s = "ATTATCGGGGTAA";
		DNASequence dnaSequence = new DNASequence(s);

		if ((dnaSequence.getNumberOfA() == 4)
				&& (dnaSequence.getNumberOfT() == 4)
				&& (dnaSequence.getNumberOfC() == 1)
				&& (dnaSequence.getNumberOfG() == 4)) {
			System.out.println("Test case 1:  get methods passed\n");
		} else {
			System.out.println("Test case 1:  get methods failed !!!\n");
		}

		if (dnaSequence.twoConsecutive('T')) {
			System.out.println("Test case 2: method twoConsecutive passed\n");
		} else {
			System.out
					.println("Test case 2: method twoConsecutive failed !!!\n");
		}

		if (dnaSequence.twoConsecutive('A')) {
			System.out.println("Test case 3: method twoConsecutive passed\n");
		} else {
			System.out
					.println("Test case 3: method twoConsecutive failed !!!\n");
		}

		if (!dnaSequence.twoConsecutive('C')) {
			System.out.println("Test case 4: method twoConsecutive passed\n");
		} else {
			System.out
					.println("Test case 4: method twoConsecutive failed !!!\n");
		}

	}

	/* Contains the sequence of nucleotides. */
	private String sequence;

	/* Contains the number of nucleotide A */
	private int numberOfA;

	/* Contains the number of nucleotide T */
	private int numberOfT;

	/* Contains the number of nucleotide C */
	private int numberOfC;

	/* Contains the number of nucleotide G */
	private int numberOfG;

	/**
	 * Constructs a <code>DNASequence</code> object that represents the
	 * sequence of nucleotides indicated by the chars in the <code>string</code>
	 * argument and counts the occurrences of each nucleotide in the sequence.
	 * 
	 * @param initialSequence
	 *            a string with the initial sequence of nucleotides.
	 */
	public DNASequence(String initialSequence) {

		sequence = initialSequence;
		countNucleotides();
	}

	/*
	 * Counts the occurrences of each nucleotide in the DNA sequence and then
	 * updates the values of the variables numberOfA, numberOfT, numberOfC, and
	 * numberOfG .
	 */
	private void countNucleotides() {

		// delete "int"
		numberOfA = 0;
		numberOfT = 0;
		numberOfC = 0;
		numberOfG = 0;

		int index = 0;

		while (index < sequence.length()) {

			char nucleotide = sequence.charAt(index);

			if (nucleotide == 'A') {
				numberOfA++;
			} else if (nucleotide == 'T') {
				numberOfT++;
			} else if (nucleotide == 'C') {
				numberOfC++;
			} else if (nucleotide == 'G') {
				numberOfG++; // "numberOfC++"->"numberOfG++"
			}
			index++;
		}

		return;
	}

	/**
	 * Obtains the number of occurrences of nucleotide A in the sequence.
	 * 
	 * @return the number of occurrences of nucleotide A.
	 */
	public int getNumberOfA() {

		return numberOfA;
	}

	/**
	 * Obtains the number of occurrences of nucleotide C in the sequence.
	 * 
	 * @return the number of occurrences of nucleotide C.
	 */
	public int getNumberOfC() {

		return numberOfC;
	}

	/**
	 * Obtains the number of occurrences of nucleotide G in the sequence.
	 * 
	 * @return the number of occurrences of nucleotide G.
	 */
	public int getNumberOfG() {

		return numberOfG;
	}

	/**
	 * Obtains the number of occurrences of nucleotide T in the sequence.
	 * 
	 * @return the number of occurrences of nucleotide T.
	 */
	public int getNumberOfT() {

		return numberOfT;
	}

	/**
	 * Checks if the nucleotide specified by the argument occurs in two
	 * consecutive locations in the DNA sequence.
	 * 
	 * @param input
	 *            a <code>char</code> that represent the nucleotide.
	 * @return <code>true</code> if the specified nucleotide occurs two
	 *         consecutive locations in the sequence. Returns <code>false</code>
	 *         otherwise.
	 */
	public boolean twoConsecutive(char input) {

		int index = 1;

		// "sequence.length()-1"->"sequence.length()"

		while (index < sequence.length()) {

			int indexOfFirstNucleotide = index - 1;

			char firstNucleotide = sequence.charAt(indexOfFirstNucleotide);
			char secondNucleotide = sequence.charAt(index);

			// "||"->"&&"

			if ((firstNucleotide == input) && (secondNucleotide == input)) {

				return true;

			}
			index++;
		}

		return false;
	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产午夜精品一区二区三区视频| 欧美视频精品在线观看| 午夜视频在线观看一区二区 | 蜜桃一区二区三区四区| 亚洲欧洲精品一区二区三区 | 欧美一个色资源| 91黄色免费观看| 免费成人在线视频观看| 天堂成人免费av电影一区| 亚洲国产一二三| 亚洲精品日韩专区silk| 日韩毛片精品高清免费| 亚洲欧洲无码一区二区三区| 国产网红主播福利一区二区| 精品国产a毛片| 亚洲精品一区二区三区影院| 91精品一区二区三区在线观看| 欧美亚洲动漫精品| 欧日韩精品视频| 91欧美一区二区| 成人av影视在线观看| 国产不卡在线播放| 国产91丝袜在线观看| 捆绑变态av一区二区三区| 日本成人中文字幕| 亚洲国产一区二区在线播放| 日韩精品电影在线| 国产一区二区三区四| 国产精品996| av一区二区三区四区| 91一区在线观看| 欧美视频一区二区三区四区| 在线观看一区不卡| 欧美日韩在线不卡| 欧美一区二区网站| 日韩欧美成人午夜| 久久精品亚洲精品国产欧美 | 亚洲欧美成aⅴ人在线观看| 亚洲国产精品传媒在线观看| 亚洲国产高清aⅴ视频| 18欧美亚洲精品| 亚洲成人av一区二区三区| 日韩高清一区在线| 国产成人精品影院| 欧美在线看片a免费观看| 欧美蜜桃一区二区三区| 欧美精品一区二区久久婷婷| 国产精品伦理一区二区| 午夜久久久久久电影| 国产一区二区视频在线| 99国产精品视频免费观看| 欧美日韩精品综合在线| 久久综合一区二区| 一区二区三区四区乱视频| 日本美女视频一区二区| 久久99精品久久只有精品| 国产精品动漫网站| 色婷婷av一区二区三区gif| 亚洲一区二区美女| proumb性欧美在线观看| av网站免费线看精品| 日韩欧美第一区| 亚洲综合成人网| 制服丝袜国产精品| 蜜臂av日日欢夜夜爽一区| 国产日产精品一区| 国产精品一级片| 天天av天天翘天天综合网| 国产精品一区二区三区网站| 9久草视频在线视频精品| 日韩欧美中文字幕精品| 亚洲欧洲精品天堂一级| 国产在线不卡一区| 91麻豆精品国产91久久久使用方法| 884aa四虎影成人精品一区| 国产精品久久毛片av大全日韩| 蜜桃av一区二区在线观看| 欧美性三三影院| 中文字幕一区av| 国产精品18久久久久| 日韩亚洲欧美中文三级| 国产亚洲欧美在线| 美女一区二区视频| 666欧美在线视频| 水蜜桃久久夜色精品一区的特点| 91麻豆免费视频| 国产精品视频麻豆| 菠萝蜜视频在线观看一区| 国产欧美一区二区三区鸳鸯浴| 精品一区二区三区香蕉蜜桃 | 国产精品一区二区在线看| 欧美一区二区三区爱爱| 亚洲bt欧美bt精品777| 欧美少妇xxx| 亚洲国产一二三| 色婷婷综合久久久中文一区二区 | 51精品久久久久久久蜜臀| 亚洲一区二区三区免费视频| 91在线观看下载| 中文字幕日韩一区| 色综合天天综合狠狠| 国产亚洲精品超碰| 国产成人精品亚洲777人妖| 国产色一区二区| 国产99精品视频| 国产精品嫩草久久久久| 国产成人av电影免费在线观看| xf在线a精品一区二区视频网站| 一区二区三区在线播放| 成人av电影在线网| 国产成人在线影院 | 日韩写真欧美这视频| 99视频精品免费视频| 成人性色生活片免费看爆迷你毛片| 国产精品综合在线视频| 色综合久久久网| 欧美浪妇xxxx高跟鞋交| 肉肉av福利一精品导航| 天堂影院一区二区| 91在线porny国产在线看| 久久免费精品国产久精品久久久久| 91一区二区三区在线观看| 91精品国产91综合久久蜜臀| 亚洲三级在线观看| 91网页版在线| 精品国产91洋老外米糕| 国产精品三级久久久久三级| 国产日韩精品一区二区三区在线| 欧美激情中文不卡| 国产精品高潮呻吟| 国产精品乱码一区二三区小蝌蚪| 国产欧美日韩另类一区| 亚洲午夜电影在线| 在线观看成人免费视频| 爽好多水快深点欧美视频| 制服.丝袜.亚洲.另类.中文| 亚洲国产精品久久人人爱蜜臀| 色综合色狠狠综合色| 亚洲精品成人少妇| 国产丶欧美丶日本不卡视频| 国产精品电影一区二区三区| 在线视频国内一区二区| 亚洲婷婷综合色高清在线| 暴力调教一区二区三区| 美女网站在线免费欧美精品| 亚洲一区在线看| 中文字幕制服丝袜一区二区三区 | 欧美精品一区二区三区高清aⅴ | 久久久国产精品午夜一区ai换脸| 制服丝袜在线91| 欧美色中文字幕| 欧美视频在线一区二区三区 | 欧美大尺度电影在线| 欧洲日韩一区二区三区| 一本一本大道香蕉久在线精品| 成人高清视频在线观看| 成人aaaa免费全部观看| 不卡影院免费观看| av高清不卡在线| av网站免费线看精品| 99久久伊人网影院| 99久久精品免费观看| 色综合天天综合狠狠| 在线免费av一区| 欧美视频中文字幕| 欧美精品欧美精品系列| 4438x成人网最大色成网站| 日韩一区二区三区在线视频| 欧美va在线播放| 欧美激情一区三区| 亚洲男人的天堂网| 五月激情综合色| 久久aⅴ国产欧美74aaa| 国产盗摄一区二区| 在线观看国产91| 日韩一级黄色大片| 国产精品美女久久久久久2018| 亚洲欧洲日产国产综合网| 午夜精品国产更新| 国产老肥熟一区二区三区| 99久久久国产精品免费蜜臀| 欧美性生交片4| 日韩欧美国产精品一区| 中文字幕av免费专区久久| 洋洋av久久久久久久一区| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产精品一区二区三区网站| 一本到高清视频免费精品| 欧美一区二区精美| 亚洲视频免费观看| 日日摸夜夜添夜夜添精品视频| 国产剧情在线观看一区二区| 日本高清不卡一区| 国产日韩欧美制服另类| 亚洲福利国产精品| 国产99精品在线观看| 91精品国产全国免费观看| 国产精品久久久久久久午夜片| 日本欧美在线看| 色综合激情久久|