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 file extension takes less storage space?
anyanavicka [17]

I believe the answer would be the JPEG file extension.

4 0
3 years ago
Read 2 more answers
DEFINE WHAT COPYRIGHT?
Reika [66]
Copyright is when someone is given the right to print, publish or make a film.
5 0
3 years ago
Read 2 more answers
What is a computer system?
klio [65]
A system of interconnected computers that share a central storage system and various peripheral devices such as a printers, scanners, or routers. Each computer connected to the system can operate independently, but has the ability to communicate with other external devices and computers

<span>Read more: http://www.businessdictionary.com/definition/computer-system.html</span>
4 0
3 years ago
What is another name for a blue screen error which occurs when processes running in kernel mode encouter a problem and windows m
Sonbull [250]
Another name for a blue screen error is Blue screen of death
7 0
3 years ago
Question 17 (3 points)
Archy [21]

Answer:

#

Explanation:

6 0
3 years ago
Other questions:
  • _____ is two or more connected computers.
    8·1 answer
  • The adjustable contact of a potentiometer is placed at the center of its adjustment. If the total resistance is 5 kOhms, what is
    9·1 answer
  • Which term is used to describe the science of examining raw data, removing excess noise from the dataset, and organizing the dat
    15·1 answer
  • Energy is defined as stored energy
    13·2 answers
  • What is the purpose of exporting your public key to the directory services server?
    11·1 answer
  • Write a program to calculate the area of a triangle whose base is 10cm and height is 6cm
    6·1 answer
  • Nuclear batteries use devices called thermocouples, which convert the ____ of a nuclear reaction into electricity.
    9·1 answer
  • How much does a dodge tomohawk cost for a used one?
    7·1 answer
  • What operating system do most users use?
    13·1 answer
  • Amber, a network administrator, is conducting VoIP training for other IT team members. Melanie, a new team member, is confused a
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!