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
vova2212 [387]
4 years ago
5

Write a test client which takes a file path as an argument and reads each line one by one. If the current line is valid DNA, pri

nt out its complement as well as whether or not it is a Watson-Crick complemented palindrome.
Computers and Technology
1 answer:
Alekssandra [29.7K]4 years ago
5 0

Answer:

import java.io.BufferedReader;

import java.io.FileReader;

import java.io.IOException;

import java.util.Scanner;

public class WCComplement {

 

  public static boolean palindromeWC(String input){

     

      if(input==null)

          return false;

     

      for(int i=0,j=input.length()-1; i<j; i++, j--){

          if(input.charAt(i) != input.charAt(j))

              return false;

      }

     

      return true;

  }

 

  public static void main(String[] args) throws IOException {

     

      Scanner sc = new Scanner(System.in);

      System.out.print("Enter input file name: ");

      String fileName = sc.next();

     

      FileReader fr = new FileReader(fileName);

      BufferedReader br = new BufferedReader(fr);

     

      String line;

     

      while((line = br.readLine()) != null){

          if(palindromeWC(line))

              System.out.println(line+" is Watson-Crick complemented");

      }

     

      br.close();

      fr.close();

      sc.close();

  }

}

Explanation:

You might be interested in
An if statement must always begin with the word “if.” True False python
MrMuchimi

Answer:

true

Explanation:

6 0
3 years ago
Read 2 more answers
Explain the differences between copyright, fair use, and trademark?
ValentinkaMS [17]

A trademark is an easily recognizable symbol, phrase, or word that denotes a specific product. It legally differentiates a product or service from all others of its kind and recognizes the source company's ownership of the brand.

"Copyright" literally means the right to copy but has come to mean that body of exclusive rights granted by law to copyright owners for protection of their work. Copyright protection does not extend to any idea, procedure, process, system, title, principle, or discovery.

Fair use is a doctrine in United States law that permits limited use of copyrighted material without having to first acquire permission from the copyright holder.

7 0
3 years ago
Helen is filling her persönal details on her résumé. Which detail should she include in this section?
svetoff [14.1K]

I would think option A.

b doesn't give enough information and c would go under last work experience

4 0
3 years ago
Methods for preventing/overcoming group conflict include all EXCEPT:
kondor19780726 [428]

Answer:

recognizing that gender differences are a myth.

Explanation:

The options are:

  • active listening.
  • recognizing that gender differences are a myth.
  • structured debate.
  • building cross-cultural understanding

Without active listening, structured debate, and cross-cultural understanding group conflict are definitely on the card. However, no one now is concerned about gender differences. As now both the genders are already having the equal status in at least developed countries. However, this too can play a role in avoiding group conflict. However, since this is not that important considering the current context, this looks like being the correct option here. Hence, the above mentioned in the answer section is the correct option.

7 0
3 years ago
The 'client area' of a window is the area used to display the contents of the window (thus a title bar or border would lie outsi
Stolb23 [73]

Answer:

The Java code is given below

Explanation:

<u>Window.java: </u>

public class Window {

private int width, height;

public Window(int width, int height) {

this.width = width;

this.height = height;

}

public int getHeight() {

return height;

}

public void setHeight(int height) {

this.height = height;

}

public int getWidth() {

return width;

}

public void setWidth(int width) {

this.width = width;

}

@Override

public String toString() {

return "Window [width=" + width + ", height=" + height + "]";

}

}

<u>TitledWindow.java: </u>

public class TitledWindow extends Window {

private int barHeight;

public TitledWindow(int width, int height, int barHeight) {

super(width, height);

this.barHeight = barHeight;

}

public int getClientAreaHeight() {

return barHeight + super.getHeight();

}

@Override

public String toString() {

return "TitledWindow [width=" + super.getWidth() + ", height=" + super.getHeight() + ", barHeight=" + barHeight + "]";

}

}

<u>TestWindows.java: </u>

public class TestWindows {

public static void main(String args[]) {

Window w = new Window(450, 200);

System.out.println("Window: " + w);

TitledWindow titledWindow = new TitledWindow(450, 200, 30);

System.out.println("titaledWindow: " + titledWindow);

System.out.println("titledWindow.height: " + titledWindow.getClientAreaHeight());

}

}

6 0
3 years ago
Other questions:
  • Write a program that reads in 10 numbers from the user and stores them in a 1D array of size 10. Then, write BubbleSort to sort
    13·1 answer
  • The inflationary gap occurs when you obtain no increase in output, but only an increase in the Average Price Level from an incre
    13·1 answer
  • Variable costs are __________.<br><br> A. decreasing<br> B. increasing<br> C. static
    10·1 answer
  • A light or optical microscope most commonly used is called a(n) _____. bright-field microscope dark-field microscope electron mi
    8·2 answers
  • The computer output for integer programs in the textbook does not include reduced costs, dual values, or sensitivity ranges beca
    14·1 answer
  • What does the clone tile command do?
    15·2 answers
  • 1. Why is photographing lightning a difficult process?
    11·2 answers
  • Which code must be included to use Turtle Graphics?
    14·2 answers
  • What Are the Benefits of Using Leads Automation Tool?
    5·1 answer
  • What is the gear ratio?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!