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
Aleks [24]
3 years ago
8

In this exercise you will debug the code which has been provided in the starter file. The code is intended to do the following:

Computers and Technology
1 answer:
abruzzese [7]3 years ago
8 0

Answer:

The corrected code is as follows:

import java.util.Scanner;

public class U2_L4_Activity_Two{

public static void main(String[] args){

Scanner scan = new Scanner(System.in);

String str1 = scan.nextLine();

String str2 = str1;

str1 = str1.toUpperCase();

System.out.println(str1);

System.out.println(str2);

}

}

Explanation:

This corrects the scanner object

Scanner scan = new Scanner(System.in);

This line is correct

String str1 = scan.nextLine();

This copies str1 to str2

String str2 = str1;

This converts str1 to upper case

str1 = str1.toUpperCase();

This prints str1

System.out.println(str1);

This prints str2

System.out.println(str2);

You might be interested in
Which type of financial institution typically has membership requirements?
zheka24 [161]
The answer is online commercial banking :)
7 0
4 years ago
Read 2 more answers
Create a mobile app plan using PowerPoint slides to show mock-ups of screens,
TiliK225 [7]

Answer: Have you gotten an answer yet?

6 0
3 years ago
When enter a function or formula in a cell, which is the character you must type?
vladimir1956 [14]
The answer is A. For instance, to use the sum function, you would need to =SUM()
7 0
3 years ago
Suppose a worker needs to process 100 items. the time to process each item is exponentially distributed with a mean of 2 minutes
stiks02 [169]
Suppose a worker nneeds to process100 items
7 0
3 years ago
5. Are you more honest in your online communication? Explain your response.
Sati [7]
Multiple research has been conducted with regards to this point of view, but the common conclusion is that it depends more on the platform. People tend to be more dishonest when not comfortable and when given the chance live off their fantasy even for short while online. We all do agree that an example is the social media where in order to get attention we only share positive things. You might want to check speaker Simon Sinek and see rich views and in depth understanding of how technology has changed us.
5 0
4 years ago
Other questions:
  • To gain one pound of fat, how many extra calories would you need to consume?
    12·1 answer
  • _ includes websites that encourage interaction and connection among people, businesses, and organizations.
    5·1 answer
  • What is the pen tools use in Photoshop?
    6·2 answers
  • python If the checksum is 10, the last digit is denoted as X according to the ISBN-10 convention. Write a program that prompts t
    10·1 answer
  • Write a program that has the following String variables: firstName, middleName, and lastName. Initialize these with your first,
    7·1 answer
  • A computer with a frequency 2 GHZ and its average cycle per instruction is 2. what is the MIPS of the computer?
    6·1 answer
  • Which of the following illustrations is depicted in the icon that's used to access Windows Help and Support files?
    13·1 answer
  • The simplest element that exists is only one proton and one electron. It is what stars are made of. It's symbol is "H". What is
    9·1 answer
  • State five differences between Dos and Windows.​
    14·1 answer
  • Fre.....ee p......oint....s pt 2
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!