Computers and Technology

In this exercise you will debug the code which has been provided in the starter file. The code is intended to do the following: take a string input and store this in the variable str1
copy this string into another variable str2 using the String constructor
change str1 to the upper-case version of its current contents
print str1 on one line, then str2 on the next

1 /* Lesson 4 Coding Activity Question 2 */
2
3 import java. util. Scanner;
4
5 public class U2_L4_Activity_Two{
6 public static void main(String[] args){
7
8 Scanner = new Scanner(System. in);
9 String str1 = scan. nextLine();
10 String str2 = String(str1);
11 str1 = toUpperCase(str1);
12 System. out. println("str1");
13 System. out. println("str1");
14
15 }
16 }

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 12:40, Courtneymorris19
The most complicated four letter word
Answers: 1
image
Computers and Technology, 24.06.2019 21:40, imamador6396
Which of these is not a type of socket? aga (alternating grid array) pga (pin grid array) spga (staggered pin grid array) lga (land grid array)
Answers: 1
image
Computers and Technology, 25.06.2019 03:10, lokiliddel
Write a program to convert a person's height in inches into centimetres #and their weight in stones into kilograms. (1 inch = 2.54 cm and 1 stone = 6.364 kg)
Answers: 1
image
Computers and Technology, 25.06.2019 08:00, jzjajsbdb8035
Beginning in the 1940s, first-generation computers used circuitsvacuum tube technologylaser technologytransistors
Answers: 2
Do you know the correct answer?
In this exercise you will debug the code which has been provided in the starter file. The code is in...

Questions in other subjects:

Konu
Chemistry, 02.07.2019 13:30
Konu
Mathematics, 02.07.2019 13:30