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
WITCHER [35]
3 years ago
14

Fix the 2 error codes.

Computers and Technology
1 answer:
motikmotik3 years ago
4 0

Answer:

See Explanation

Explanation:

Considering the first program: DebugSix2.java

The following statement needs to be terminated

<em>System.out.println("\nEnd of application")</em>

as

<em>System.out.println("\nEnd of application");</em>

Then, the loop needs to be enclosed as this:

<em>for(a = MIN; a <= MAX; a++){ </em>

<em> letter = (char)a; </em>

<em> System.out.print(" " + letter); </em>

<em> if((a == STOPLINE1) & (a == STOPLINE2)) </em>

<em> System.out.println();} </em>

Considering the first program: DebugSix4.java

You only need to initialize variable count to 0 as this:

<em>count = 0</em>

<em>I've added the correct source code as an attachment</em>

Download java
You might be interested in
Write a recursive method to return the number of uppercase letters in a String. You need to define the following two methods. Th
satela [25.4K]

Answer:

<u>Recursive function with two parameters that return the number of uppercase letters in a String</u>

public static int count(String str,int h)//Defining function

{

      if(str.charAt(0)>='A' && str.charAt(0)<='Z')//Checking the characters from A to Z

{

          h++; //incrementing the counter

          if(str.length()>=2){

              return count(str.substring(1),h);//recalling function

          }

      }

      if(str.length()>=2){

              return count(str.substring(1),h); //recalling function

      }

      return h;

  }

This is the recursive function with the name count of return type integer,having parameters str of string type and h of integer type.In this we are checking the characters at a particular position from A to Z.

<u>Recursive function with one parameter that return the number of uppercase letters in a String</u>

public static int count(String str)//Defining function

{

      if(str.charAt(0)>='A' && str.charAt(0)<='Z')//Checking the characters from A to Z

{

          count++; //incrementing the counter

          if(str.length()>=2){

              return count(str.substring(1));//recalling function

          }

      }

      if(str.length()>=2){

              return count(str.substring(1)); //recalling function

      }

      return count;

  }

This is the recursive function with the name count of return type integer,having parameters str of string type .In this we are checking the characters at a particular position from A to Z.

<u>Java program that return the number of uppercase letters in a String</u>

import java.util.*;

public class Myjava{

static int count =0;//Defining globally  

 

public static int count(String str,int h)//Defining function

{

      if(str.charAt(0)>='A' && str.charAt(0)<='Z')//Checking the characters from A to Z

{

          h++;

//incrementing the counter

          if(str.length()>=2){

              return count(str.substring(1),h);//recalling function

          }

      }

      if(str.length()>=2){

              return count(str.substring(1),h);

//recalling function

      }

      return h;

 

  }

  public static void main(String[] args)//driver function

  {

      System.out.println("Enter a string");//taking input

      Scanner scan = new Scanner(System.in);

      String s = scan.nextLine();

      int h =0;

      System.out.println("Counting the Uppercase letters: "+count(s,h));

  }

}

<u>Output</u>

Enter a string  WolFIE

Counting the Uppercase letters: 4

4 0
3 years ago
The part of the computer that contains the brain or central processing unit is also known as
Yuri [45]
Central processing unit (CPU)
4 0
3 years ago
Read 2 more answers
What medical equipment do they have in Jr. high, To help save peoples lives?
lawyer [7]

Vital signs monitors, Electronic Medical Records (EMR), and Medication Management Systems.

5 0
3 years ago
Fill in the three blanks in the following statement. The longest movement in the Classical multi-movement cycle is the ______ mo
Tems11 [23]

Answer:

Fill in the three blanks in the following statement. The longest movement in the Classical multi-movement cycle is the <u>first</u> movement, and this movement is typically in a fast tempo and is in <u>sonata-allegro</u> form.

Explanation:

This topic is music. The first movement of a classical symphony is almost always fast.

Sonata-allegro form or first movement form is a musical structure consisting of three main sections: an exposition, a development, and a recapitulation. It has been performed widely since the early Classical period.

4 0
3 years ago
What is the role of computer in the field of education​
kompoz [17]

Answer:

computer means a technology or digitalized form of technology which makes student life better by giving solution to the problem and promote creativenes.

3 0
4 years ago
Other questions:
  • Before you start creating a database, you should first use paper to plan, test, and revise. True False
    7·2 answers
  • I need help please!!?
    11·2 answers
  • Ask the user to input an integer. Print out the next three consecutive numbers. in python
    13·1 answer
  • Using for loop . Input an integer and identify whether it's EVEN OR ODD ( without using modulo operator )
    9·1 answer
  • If u had a virus and u didn’t know how must damage will there be and how long will it take for you to notice?
    14·1 answer
  • Implement the function is_maxheap which takes a list of integers and returns True if the list represents a valid max-heap, and F
    6·1 answer
  • What is the Piston Displacement having 3-inch bore and 3-inch stroke?
    11·1 answer
  • Give a non-network example of hierarchical addressing and discuss how it reduces the amount of work needed in physical delivery.
    10·1 answer
  • What connections do you see between variables and the Input-Output-Store-Process model of a computer?
    5·1 answer
  • The density of mercury is 13.6 grams per cubic centimeter. Complete the steps for converting 13.6 g/cm3 to kg/m3.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!