Posts

Showing posts with the label Java Programming: Solving Problems with Software

Iterables In Java Main Quiz --Java Programming: Solving Problems with Software 6

Image
For The First Solution CLICK HERE

Iterables In Java Main Quiz --Java Programming: Solving Problems with Software 5

Image
For The Sixth Solution CLICK HERE

Iterables In Java Main Quiz --Java Programming: Solving Problems with Software 4

Image
For The Fifth Solution CLICK HERE

Iterables In Java Main Quiz --Java Programming: Solving Problems with Software 3

Image
For The Fourth Solution CLICK HERE

Iterables In Java Main Quiz --Java Programming: Solving Problems with Software 2

Image
For The Third Solution CLICK HERE

Finding A gene in DNA Solution Quiz 1 --Java Programming: Solving Problems with Software 5

Image
For The First Answer CLICK HERE

Finding A gene in DNA Solution Quiz 1 --Java Programming: Solving Problems with Software 4

Image
For The Fifth Answer CLICK HERE
Image
For The Fifth Answer CLICK HERE

Finding A gene in DNA Solution Quiz 1 --Java Programming: Solving Problems with Software 3

Image
For The Fourth Answer CLICK HERE

Finding A gene in DNA Solution Quiz 1 --Java Programming: Solving Problems with Software 2

Image
For The Third Answer CLICK HERE

Finding A gene in DNA Solution Quiz 1 --Java Programming: Solving Problems with Software

Image
a For The Second Answer Click HERE

Finding A URl on a Page Java Code --Java Programming: Solving Problems with Software

/**  * Write a description of URLFINDER here.  *  * @author (your name)  * @version (a version number or a date)  */ import edu.duke.*; import java.io.*; public class URLFINDER {     public void asd(){         URLResource file = new URLResource("http://www.dukelearntoprogram.com/course2/data/manylinks.html");         for ( String item : file.words() ) {             String itemLower = item.toLowerCase();             int pos = itemLower.indexOf("youtube.com");             if ( pos != -1 ) {                 int beg = item.lastIndexOf("\"", pos);                 int end = ...

Code For finding aProtien string in a DNA --Java Programming: Solving Problems with Software

import edu.duke.*; import java.io.*; public class TagFinder{     public String findProtein(String dna){         int start = dna.indexOf("atg");         int stop = dna.indexOf("tag", start +3);         if (start == -1){             return "no starton protein found";         }                if ((stop-start)%3==0){             return dna.substring(start,stop+3);         }         else{             return"not not a protein because of Divisible factor";         }     }     public...

Iterables In Java Main Quiz --Java Programming: Solving Problems with Software 1

Image
A For The Second Solution CLICK  HERE

Batch GrayScale Images Practice Quiz Solutions --Java Programming: Solving Problems with Software

Image

Converting Images to Gray Scale And Saving A Copy Of Them(Multiple) -- Java Programming: Solving Problems with Software

import edu.duke.*; import java.io.File; public class GrayScaleConverter {     //started with the image i wanted(inImage)     public ImageResource makeGray(ImageResource inImage){     //I Made a blank image of the same size         ImageResource outImage = new ImageResource(inImage.getWidth(),inImage.getHeight());     //for each pixelin outImage         for(Pixel pixel : outImage.pixels()){     //look at the corresponding pixel in inImage             Pixel inPixel = inImage.getPixel(pixel.getX(),pixel.getY());     //compute inPixel's red + inPixel's blue + inpixel's green     //divide that sum by 3(call it average)     int average = (inPixel.getRed()+inPixel.getGreen()+inPixel.getBlue())/3;     //set pixel's red to average  ...

Image Saver --Java Programming: Solving Problems with Software

import edu.duke.*; import java.io.*; public class imageSaver {     public void doSave(){         DirectoryResource dr = new DirectoryResource();         for(File f : dr.selectedFiles()){             ImageResource image = new ImageResource(f);             String fname = image.getFileName();             String newfname = "copy-" + fname;             image.setFileName(newfname);             image.draw();             image.save();         }     }     }

Batch Gratscale Image Code --Java Programming: Solving Problems with Software

import edu.duke.*; import java.io.File; public class GrayScaleConverter {     //started with the image i wanted(inImage)     public ImageResource makeGray(ImageResource inImage){     //I Made a blank image of the same size         ImageResource outImage = new ImageResource(inImage.getWidth(),inImage.getHeight());     //for each pixelin outImage         for(Pixel pixel : outImage.pixels()){     //look at the corresponding pixel in inImage             Pixel inPixel = inImage.getPixel(pixel.getX(),pixel.getY());     //compute inPixel's red + inPixel's blue + inpixel's green     //divide that sum by 3(call it average)     int average = (inPixel.getRed()+inPixel.getGreen()+inPixel.getBlue())/3;     //set pixel's red to average  ...

Grayscaling An Image One At A Time -- Java Programming: Solving Problems with Software

/**  * Write a description of GrayScaleConverter here.  *  * @author (your name)  * @version (a version number or a date)  */ import edu.duke.*; public class GrayScaleConverter {     //started with the image i wanted(inImage)     public ImageResource makeGray(ImageResource inImage){     //I Made a blank image of the same size         ImageResource outImage = new ImageResource(inImage.getWidth(),inImage.getHeight());     //for each pixelin outImage         for(Pixel pixel : outImage.pixels()){     //look at the corresponding pixel in inImage             Pixel inPixel = inImage.getPixel(pixel.getX(),pixel.getY());     //compute inPixel's red + inPixel's blue + inpixel's green     //divide that sum by 3(call it average)    ...

Display the Name Of The Selected Files For GreyScale --Java Programming: Solving Problems with Software

/**  * Write a description of greyscale here.  *  * @author (your name)  * @version (a version number or a date)  */ import edu.duke.*; import java.io.*; public class greyscale {     public void checkdir(){             DirectoryResource dr = new DirectoryResource();                 for (File f : dr.selectedFiles())         {                     System.out.println(f);         }     }         }