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
The production team for a fictional drama is shooting a key scene. One of the actors leaves out part of his scripted dialogue th
denis-greek [22]

Answer:

at last sentence was . The editor's work .

8 0
3 years ago
Read 2 more answers
Using the college registration example from section 6.7.3 as a starting point, do the following:
Arada [10]

Answer:

Explanation:

NCLUDE Irvine32.inc

TRUE = 1

FALSE = 0

.data

gradeAverage WORD ?

credits WORD ?

oKToRegister BYTE ?

str1 BYTE "Error: Credits must be between 1 and 30" , 0dh,0ah,0

main PROC

call CheckRegs

exit

main ENDP

CheckRegs PROC

push edx

mov OkToRegister,FALSE

; Check credits for valid range 1-30

cmp credits,1 ; credits < 1?

jb E1

cmp credits,30 ; credits > 30?

ja E1

jmp L1 ; credits are ok

; Display error message: credits out of range

E1:

mov edx,OFFSET str1

call WriteString

jmp L4

L1:

cmp gradeAverage,350 ; if gradeAverage > 350

jna L2

mov OkToRegister,TRUE ; OkToRegister = TRUE

jmp L4

L2:

cmp gradeAverage,250 ; elseif gradeAverage > 250

jna L3

cmp credits,16 ; && credits <= 16

jnbe L3

mov OkToRegister,TRUE ; OKToRegister = TRUE

jmp L4

L3:

cmp credits,12 ; elseif credits <= 12

ja L4

mov OkToRegister,TRUE ; OKToRegister = TRUE

L4:

pop edx ; endif

ret

CheckRegs ENDP

END main

8 0
3 years ago
Please tell fast plzzzzzz.​
lana [24]

Answer:

True

Explanation:

4 0
3 years ago
To access WordPad, Jill will click on Start, All Programs, Accessories, and WordPad. To access Notepad, Karl will click on Start
NARA [144]
The answer is B, Both Jill and Karl are correct.
7 0
3 years ago
Which group allows you to add notes to your presentation? Animations Presentation views Show Zoom
mel-nik [20]

Answer:

View

Explanation:

With "View", you have the option to add comment(s) which may be important even after the presentation is completed.

Cheera

6 0
3 years ago
Other questions:
  • A(n) ________ network is a computer network that spans a relatively small area, allowing all computer users to connect with each
    14·1 answer
  • Given two ArrayLists of sorted strings (alphabetically ascending), write down a method to merge these sorted strings’ ArrayLists
    10·1 answer
  • In a large company today, you will often find an infrastructure that includes hundreds of small LANs linked to each other as wel
    7·1 answer
  • What is nominal data?
    5·1 answer
  • Original Source Material
    12·1 answer
  • You want to save twenty of your vacation pictures on your computer. Which is the best place to save them?
    6·2 answers
  • python Create a new qualitative variable, called Elite, by binning the Top10perc variable. We are going to divide universities i
    6·1 answer
  • Uploading Your Work
    14·1 answer
  • What is the difference between KE an PE
    8·1 answer
  • Could anyone help me with this assignment please?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!