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

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

?? dnasequence.java

?? ssd 3 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  {

	/* 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;

	/**
	 * 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");
		}
	}

	/**
	 * 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()  {

		int numberOfA = 0;
		int numberOfT = 0;
		int numberOfC = 0;
		int 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') {
				numberOfC++;
			}
			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 T in the sequence.
	 *
	 * @return  the number of occurrences of nucleotide T.
	 */
	public int  getNumberOfT( )  {

		return numberOfT;
	}

	/**
	 * 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;
	}

	/**
	 * 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;

		while (index < sequence.length() - 1) {

			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一区二区三区免费野_久草精品视频
国产精品综合视频| 亚洲欧美怡红院| 日本乱人伦aⅴ精品| 开心九九激情九九欧美日韩精美视频电影| 中文字幕免费观看一区| 精品国产在天天线2019| 欧美人xxxx| 欧美高清精品3d| 精品婷婷伊人一区三区三| 91免费小视频| 97se亚洲国产综合自在线不卡 | 日韩精品在线一区| 欧美日韩亚洲高清一区二区| 欧美亚洲综合久久| 日本伦理一区二区| 欧美午夜精品一区二区三区| 色哟哟一区二区在线观看| 99久久er热在这里只有精品15| 国产高清亚洲一区| 国产精品一二三| 国产一区999| 日韩影院精彩在线| 中文字幕欧美日韩一区| 国产女同性恋一区二区| 久久蜜桃一区二区| 日韩一级精品视频在线观看| 欧美精品在线观看播放| 欧美精品99久久久**| 欧美视频精品在线| 欧美一级日韩免费不卡| 日韩欧美一级在线播放| 久久综合九色综合97婷婷女人| 欧美mv日韩mv| 久久久久亚洲蜜桃| 成人免费在线播放视频| 亚洲美女屁股眼交| 亚洲资源在线观看| 首页国产欧美久久| 国产自产高清不卡| 91丨porny丨国产入口| 欧美自拍丝袜亚洲| 欧美一级欧美三级在线观看 | 亚洲色图色小说| 一区二区三区在线视频观看58| 一区2区3区在线看| 免费高清不卡av| 99久久精品国产观看| 欧美日韩综合在线免费观看| 精品国产乱码久久久久久图片 | 中文字幕免费观看一区| 亚洲欧美日韩成人高清在线一区| 亚洲一级电影视频| 国产精品一二二区| 欧美亚一区二区| 国产免费久久精品| 天堂影院一区二区| 成人午夜av影视| 欧美日韩国产综合一区二区 | 亚洲免费观看高清完整| 亚洲国产精品一区二区久久| 国内精品国产三级国产a久久| 99re成人精品视频| 久久综合久久99| 亚洲成人在线网站| 九九**精品视频免费播放| 9久草视频在线视频精品| 欧美一区二区三区视频免费| 亚洲女爱视频在线| 国产一区二区三区黄视频 | 亚洲欧美另类图片小说| 日本中文字幕不卡| 亚洲欧美在线aaa| 秋霞电影一区二区| 欧美电影精品一区二区| 欧美性videosxxxxx| 国产精品无码永久免费888| 一本一道久久a久久精品| 亚洲综合一二三区| 久久品道一品道久久精品| 成人激情视频网站| 亚洲成a人片在线不卡一二三区| 日韩一区二区电影在线| 国产精品一二三四区| 中文字幕日韩av资源站| 欧美日韩国产欧美日美国产精品| 免费观看成人av| 成人欧美一区二区三区白人 | 欧美亚洲丝袜传媒另类| 午夜精品久久久久久久| 精品国产一区二区三区av性色| 成年人网站91| 男女性色大片免费观看一区二区| 国产日韩欧美不卡在线| 欧美日韩电影一区| 国产一区视频网站| 中文字幕成人在线观看| 91精品国产综合久久精品| 成人精品鲁一区一区二区| 三级在线观看一区二区| 中文字幕巨乱亚洲| 日韩亚洲欧美高清| 91影视在线播放| 久久99国产精品免费网站| 成人欧美一区二区三区白人| 精品国产在天天线2019| 欧美日韩一区二区在线观看| 国产成人精品一区二| 亚洲欧美日韩国产成人精品影院| 日韩视频一区二区三区| 91久久精品网| av在线播放一区二区三区| 蜜桃久久久久久| 亚洲成人av在线电影| 国产精品福利影院| 精品国产91乱码一区二区三区| 欧美最猛性xxxxx直播| 九九精品视频在线看| 日本一道高清亚洲日美韩| 亚洲一区二区三区精品在线| 亚洲精品一区二区三区香蕉| 欧美情侣在线播放| 99久久久免费精品国产一区二区| 激情综合色播五月| 精品午夜一区二区三区在线观看| 亚洲va天堂va国产va久| 亚洲综合网站在线观看| 最新国产の精品合集bt伙计| 久久精品视频一区二区| 欧美不卡在线视频| 欧美一级免费观看| 日韩一区二区中文字幕| 这里只有精品视频在线观看| 欧美日韩成人在线一区| 欧美性猛交xxxxxx富婆| 色又黄又爽网站www久久| 日韩电影网1区2区| 免费看欧美美女黄的网站| 强制捆绑调教一区二区| 日韩av电影免费观看高清完整版| 丝袜美腿亚洲一区二区图片| 日韩av电影免费观看高清完整版 | 国产高清亚洲一区| 韩国三级在线一区| 欧美日韩中文字幕一区| 蜜桃一区二区三区在线观看| 久久不见久久见免费视频7| 韩国欧美一区二区| www.亚洲激情.com| 欧美亚洲国产一区二区三区va| 欧美在线播放高清精品| 欧美日韩国产一二三| 久久久久亚洲蜜桃| 国产嫩草影院久久久久| 亚洲欧美日韩久久| 日本麻豆一区二区三区视频| 开心九九激情九九欧美日韩精美视频电影| 免费观看在线综合色| 国产又粗又猛又爽又黄91精品| 成人激情免费电影网址| 91蜜桃传媒精品久久久一区二区| 在线观看av不卡| 日韩一二在线观看| 精品国产亚洲一区二区三区在线观看| 国产精品久久毛片| 天天综合色天天综合色h| 久久99精品国产麻豆婷婷洗澡| 日韩中文字幕区一区有砖一区 | 91精品国产91久久久久久一区二区| 日韩欧美国产综合在线一区二区三区| 久久久久久电影| 亚洲国产另类av| 国产成a人亚洲| 欧美日韩在线综合| 国产午夜亚洲精品不卡| 首页国产欧美日韩丝袜| 成人黄色在线视频| 欧美一区二区三区免费在线看| 国产精品色哟哟| 免费成人深夜小野草| 99久久精品国产毛片| 欧美www视频| 蜜桃久久精品一区二区| 色综合欧美在线| 国产日韩成人精品| 一区2区3区在线看| 色国产精品一区在线观看| www久久久久| 亚洲一区二区三区四区在线 | 欧美日韩不卡在线| 337p日本欧洲亚洲大胆色噜噜| 午夜精品123| k8久久久一区二区三区| 精品国产91九色蝌蚪| 亚洲综合久久av| 色婷婷av一区二区三区大白胸| 久久蜜桃一区二区| 理论电影国产精品| 欧美男男青年gay1069videost| 国产精品久久久久久久岛一牛影视| 久久丁香综合五月国产三级网站|