The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
1. Write two different ways to declare and initialize a String variable with the value
“owned“.
2. What types of data can an int value be converted to using the Integer wrapper
class?
3. What range of values does the following statement return? (Assume rand is a
Random object)
a. (int) (rand.nextFloat() * 70) + 30
Â
INT 1210 Computer Science IPRINCE GEORGE’S COMMUNITY COLLEGEHomework #2Name: ___________________________ Section:__________Date: ____________Questions:1.Write two different ways to declare and initialize a String variable with the value“owned“.2.What types of data can an int value be converted to using the Integer wrapperclass?3.What range of values does the following statement return? (Assume rand is aRandom object)a. (int) (rand.nextFloat() * 70) + 30Activities:Using String Objects:Fill in the blanks in the program below as follows:(a)declare the variable town as a reference to a String object and initialize it to"Anytown, USA".(b)write an assignment statement that invokes the length method of the stringclass to find the length of the college String object and assigns the result tothe stringLength variable(c)complete the assignment statement so that change1 contains the samecharacters as college but all in upper case(d)complete the assignment statement so that change2 is the same as change11
Attachments: