java

rasoad-2n

please read carefully 

 

hi i need help with java 

 

1. (1 pt) Write a statement that prints the number of characters in a String object called myString 

2. (2 pts.) Write statements to prompt for and read user’s age using Scanner variable

3. (2 pts.)What does the following statement sequence print? 

 

String str = “Harry”;

int n = str.length();

String mystery = str.substring(0,1) + str.substring(n-1, n);

System.out.println(mystery);

 

part 2:

 

is to convert a person height in feet and inches to meter

 

for example 

What is your name? Steve

What is your height?

Feet: 6

Inches: 4

Steve, your height in meters is 1.93

 

To convert the height to meters, you must first convert height from feet and inches to just inches. Then you can convert the inches to meters. Since there are 12 inches in a foot, 2.54 inches in a centimeter, and 100 centimeters in a meter, you can use one equation to do all the conversion:

 

Hm = ((Hf * 12) + Hi) * 2.54 / 100

 

where Hf is the number of feet entered by the user Hi is the number of inches entered by the user Hm is the height of the person in meters In the above example, Hf = 6, Hi = 4, and Hm = 1.93

 

i want the assignment to be feet =5, inches=11 

 

    • 11 years ago
    • 15
    Answer(2)

    Purchase the answer to view it

    NOT RATED
    • assignment1.zip

    Purchase the answer to view it

    NOT RATED
      Bids(0)