1. Add to the project, Lab3, a new java file and name it Lab3Exercise2 1. Copy...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Add to the project, Lab3, a new java file and name it Lab3Exercise2 1. Copy the following code into the class editor 2. Declare four variables of type String and name them X1, X2, X3 and X4. 3. Initialize three of the variable above as the following: XI= "Hi dears", X2 = "Programming subject here is",and X3= "ICS 102" 4. Concatenate the strings X1, X2, and X3 in X4. Then, display it. 5. Convert X1 into lowercase characters. Then, display it. 6. Returns the index of the first occurrence of the string "is" in X2. Then, display it. 7. What is the index of the number 2 in X3. Use indextOf() method. 8. What is the character of index 4 in the X1. Use charAt(method. 9. What is the output of this statement W3.substring(8); 10. What is the output of this statement W2.substring(3,11); 11. Display the length of XI. (useSystem.out.println()) 12. Declare a variable named X5 of type double and initialize it with 2.2. 13. Declare a variable named X6 of type byte and cast to it the value of X5. 14. Print the value of both X5 and X6. 1. Add to the project, Lab3, a new java file and name it Lab3Exercise2 1. Copy the following code into the class editor 2. Declare four variables of type String and name them X1, X2, X3 and X4. 3. Initialize three of the variable above as the following: XI= "Hi dears", X2 = "Programming subject here is",and X3= "ICS 102" 4. Concatenate the strings X1, X2, and X3 in X4. Then, display it. 5. Convert X1 into lowercase characters. Then, display it. 6. Returns the index of the first occurrence of the string "is" in X2. Then, display it. 7. What is the index of the number 2 in X3. Use indextOf() method. 8. What is the character of index 4 in the X1. Use charAt(method. 9. What is the output of this statement W3.substring(8); 10. What is the output of this statement W2.substring(3,11); 11. Display the length of XI. (useSystem.out.println()) 12. Declare a variable named X5 of type double and initialize it with 2.2. 13. Declare a variable named X6 of type byte and cast to it the value of X5. 14. Print the value of both X5 and X6.
Expert Answer:
Answer rating: 100% (QA)
Explanation First start by creating a new Java file named as Lab3Exercise2 To concatenate the strings we can use the operator along with spaces in bet... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
How do you think business owners deal with this in their contracts?
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
A contract is started on 1 January 2015, with an estimated completion date of 31 December 2016. The final contract price is $1,500,000. In the first year, to 31 December 2015: Costs incurred...
-
A smooth steel (SG = 7.86) sphere is immersed in a stream of ethanol at 20C moving at 1.5 m/s. Estimate its drag in N from Fig. 5.3a. What stream velocity would quadruple its drag? Take D = 2.5 cm.
-
You need to estimate the value of Laputa Aviation. You have the following forecasts (in millions of dollars) of its profits and of its future investments in new plant and working capital: From year 5...
-
The following table gives the experimental values for W and P of a lifting machine : Determine the law of the machine. W. N 50 100 150 200 250 P. N 6.5 11 14 18 22
-
On January 3, 2016, Persoff Corporation acquired all of the outstanding voting stock of Sea Cliff, Inc., in exchange for $6,000,000 in cash. Persoff elected to exercise control over Sea Cliff as a...
-
What type of approach is most commonly used for procedures on the digestive organs? Explain why that approach is used.
-
The cash account for Highlander Diamond Co. on April 1, 20Y5, indicated a balance of $35,400. During April, the total cash deposited was $120,255, and checks written totaled $109,200. The bank...
-
Glasgow plc has an investment in one company, Dundee Ltd. Glasgow plc acquired four million ordinary shares in Dundee Ltd on 1 January 2021 in a share exchange. One new ordinary share in Glasgow plc...
-
Project Project A Project B Project C 1) You are presented with three projects, each with its initial investment and subsequent returns. 0 -9500 EGP -6000 EGP -29950 EGP 1 11500 EGP 1250 EGP 5900 EGP...
-
Type or paste question here 1. EX.12.01.ALGO eBook Show Me How Average Rate of Return The following data are accumulated by Watershed Inc. in evaluating two competing capital investment proposals:...
-
Rodney desires to compare cash flows with bonds that give an adequate return on investment on a bond he wants to purchase. Rodney looks at Bond A worth $2,000 with a 10% coupon rate each year,...
-
A maker of pet toys, has $40 million in outstanding debt, 3.5 million shares outstanding. Sales for the current year (Year 1) are expected to be $30 million, and are expected to grow at 15% per year...
-
1) A point mass m is a distance d above a uniform infinite plane of mass, surface mass density o kg/m. What is the force on the mass? Do this problem two ways: a) Explicitly compute the resultant of...
-
A four-year-old with chronic otitis media and fluid buildup in both ears was admitted by her otolaryngologist for a bilateral tympanostomy. The procedure was performed with placement of ventilating...
-
Clark, PA, has been engaged to perform the audit of Kent Ltd.s financial statements for the current year. Clark is about to commence auditing Kents employee pension expense. Her preliminary enquiries...
-
Dr. Ivan I. Incisor and his wife Irene are married and file a joint return for 2012. Ivan's Social Security number is 477-34-4321 and he is 48 years old. Irene I. Incisor's Social Security number is...
-
During the 2012 tax year, Irma incurred the following expenses: Union dues..............................................................$275 Tax return preparation...
-
Jerry made the following contributions during 2012: His synagogue (by check).....................................................$680 The Democratic Party (by check)...
-
Suppose a bond is taxable for both federal and state purposes. Let Rb = the BTROR on the bond, tfed = the federal tax rate, and tst = the state tax rate. Determine the ATROR (i.e., after federal and...
-
Under what conditions are the Exempt Model and Pension Model equivalent? Under what conditions would one model perform better than the other? How does the \($6,500\) limitation on deductible and Roth...
-
Consider three taxpayers who are in the following tax brackets: Alice 25% Brad 35% Camille 40%
Study smarter with the SolutionInn App