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
Aneli [31]
3 years ago
13

In java please

Computers and Technology
1 answer:
Sidana [21]3 years ago
7 0

Answer:

Explanation:

The following code is written in Java. It is a static method that takes in a String parameter and loops through the String array called arr comparing each element in the array with the word parameter that was passed. If it finds a match the method returns the index of that word, otherwise it will return -1

  public static int findString(String word){

               int index = -1;

               for (int x = 0; x < arr.length; x++) {

                       if (word == arr[x]) {

                               index = x;

                               break;

                       }

               }

               

               return index;

               

       }

You might be interested in
Are principles which allow designers to create blank designs
Lady_Fox [76]

Answer:

Seven principles guiding blank design

see below

Explanation:

The correct question should be What Are principles which allow designers to create blank designs

"Are principles which allow designers to create blank designs"

Blank design first screen user is presented with when about to start something new.

The seven principles are

  • Balance
  • Rhythm
  • Pattern
  • Emphasis
  • Contrast
  • Unity
  • Movement
7 0
3 years ago
Write a c program to count the total number of commented characters and words in a c file taking both types of c file comments (
Tanzania [10]

#include<stdio.h>

#include<stdlib.h>

int comment1(FILE *fp)

{

   char ch;

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='\n')

       {

           return count;

       }

       count++;

   }

   return count;

}

int comment2(FILE *fp)

{

   char ch;

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='*')

       {

           fscanf(fp,"%c",&ch);

           if(ch=='/')

           {

               return count;

           }

           count++;

       }

       count++;

   }

   return 0;

}

int main()

{

   printf("Enter the file name:");

   char s[1000],ch,ch1;

   scanf("%s",s);

   FILE*fp;

   fp = fopen(s,"r");

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='\"')

       {

           while(fscanf(fp,"%c",&ch)!=EOF)

           {

               if(ch=='\"')

               {

                   break;

               }

               if(ch=='\\')

               {

                   fscanf(fp,"%c",&ch);

               }

           }

       }

       else if(ch=='/')

       {

           fscanf(fp,"%c",&ch);

           if(ch=='/')

           {

               count += comment1(fp);

           }

           else if(ch=='*')

           {

               count += comment2(fp);

           }

       }

   }

   printf("%d\n",count);

   return 0;    

}

3 0
3 years ago
Read 2 more answers
What is the difference between Windows 7 and Windows 10?
Tanzania [10]
Windows 10 is new and windows 7 is old
6 0
3 years ago
Every character, number, or symbol on the keyboard is represented as a _____ in computer memory.
Lorico [155]
Every character, number, or symbol on the keyboard is represented as a binary number in computer memory.
3 0
3 years ago
Read 2 more answers
A troubleshooting strategy that removes components from a system in order to get back to a basic configuration is called module
Semmy [17]

Answer:

B. False.

Explanation:

Troubleshooting strategy is a technique used to discover the cause of defeat in a system. The technician must learn to improvise with these strategies to solve a system problems.

Module replacement is a type of troubleshooting strategy that replaces a component with unknown status with another component with good status to determine the cause of the problem.

Removing a component from a system to get back to its basic configuration helps to eliminate factors that may make a computer problem difficult to solve.

3 0
3 years ago
Other questions:
  • How to cite a dictionary in mla 8 owl perdue?
    13·1 answer
  • Which of the following is NOT a good idea to do after you change the root password?
    12·1 answer
  • Who killed mrs.huffington
    14·1 answer
  • All of the following are forms of verbal communication except
    12·2 answers
  • Which kind of file would be hurt most by lossy compression algorithm
    8·2 answers
  • Describe how you could obtain a statistical profile of the amount of time spent by a program executing different sections of its
    10·1 answer
  • In the following data definition, assume that List2 begins at offset 2000h. What is the offset of the third value (5)?
    10·1 answer
  • Which of the following statements is true? The Wireshark protocol analyzer has limited capabilities and is not considered multi-
    15·1 answer
  • What is a network computer that processes requests from a client server​
    11·1 answer
  • What allows a programmer to write code quickly and efficiently for an action that must be repeated?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!