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
salantis [7]
3 years ago
9

Please check my answers! (Java)

Computers and Technology
1 answer:
KatRina [158]3 years ago
4 0

I think only II contains an error.

Tricky because, syntactically, all three are correct I.M.O.

However, if the goal is to iterate as many times as lotNumLength, then statement II loops one time too many. This is known as an off-by-one error.

You might be interested in
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
From the set ( 5 , 7 , 9 , 11 , 13 make the inequality w - 4 &lt; 8 true
Ksenya-84 [330]

Answer:

Explanation:

One group of students did an experiment to study the movement of ocean water. The steps of the experiment are listed below.

Fill a rectangular baking glass dish with water.

Place a plastic bag with ice in the water near the left edge of the dish.

Place a lighted lamp near the left edge of the dish so that its light falls directly on the plastic bag.

Put a few drops of ink in the water.

The student did not observe any circulation of ink in the water as expected because the experiment had a flaw. Which of these statements best describes the flaw in the experiment? (2 points)

Not enough ink was added.

Not enough water was taken.

The dish was too small for the experiment.

The lamp and the ice bag were at the same place.

7 0
3 years ago
100 points !!! Some games fall under more than one category. For example, many racing games allow players to modify the cars the
Ugo [173]

Answer:

game 1: roblox, its not technically a game, however it contains game that could fall under more than one category. Game 2: Dungeons and Dragons could fall under role play and also adventure

Explanation:

7 0
3 years ago
Read 2 more answers
In most operating systems what is running application called?
Likurg_2 [28]

Answer:

I believe it is just a task. Since there exists(on windows) the Task Manager application, where you can stop any running <em>task, </em>I think that they are called tasks

Explanation:

5 0
3 years ago
Who's the finale in undertale omega flowy or sans
Nikitich [7]

Answer:

Should be Flowy

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • List and the deference between MS access objects​
    8·1 answer
  • To edit the text in a smartart graphic, what must be done first ?
    7·2 answers
  • A ___ is the basic collective unit of data in a computer.
    12·1 answer
  • You can change the transparency of a picture used as a slide’s background with the ____.
    10·1 answer
  • Which can be used to decode a Unicode character encoding into text?
    13·1 answer
  • Kahnacademy sucksi am so mad i want to k ..<br> ill myself
    14·1 answer
  • Which statement about intellectual property is true? (CSI-7.6) Group of answer choices It is okay to use code you find on the in
    14·1 answer
  • Pls someone help me with these four questions
    8·1 answer
  • What are some applications of computer in public administration?​
    8·1 answer
  • Which way do you swipe in ios to get to the control center
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!