Write a statement that prints the number of characters

Assignment Help JAVA Programming
Reference no: EM13832212

part 1:

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

2. Write statements to prompt for and read user's age using Scanner variable

3. 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

Reference no: EM13832212

Questions Cloud

Write a program that prints the balance of an account : Write a program that prints the balance of an account after each of a number of years y, given an initial balance b and a yearly interest i, specified as a percentage (e.g., 5%). The values of y, b and i are all user-specified.
Compare and contrast li and xiangjun : 1. Compare and contrast Li and Xiangjun. In what ways are they similar?  In what ways are they different? What is the importance of their similarities and differences?
Deviant behavior is a natural disposition : Deviant behavior is a natural disposition. Which theoretical approach best explains deviant behavior? Support your opinion with factual information and explain your reasoning.What are the strengths and weaknesses of this approach?
Consider the following reaction that occurs at stp : Consider the following reaction that occurs at STP
Write a statement that prints the number of characters : Write a statement that prints the number of characters in a String object called myString. Write statements to prompt for and read user's age using Scanner variable
Analyze the case of the egyptian labor market : Use Demand and Supply tools to analyze the case of the Egyptian labor market
Development of capitalism and modern economic analysis : Markets have been present to some degree throughout history, but market society is fairly recent. What does Varoufakis argue was necessary for the development of capitalism and modern economic analysis?
Economists believe that the current values of the deposit : Economists believe that the current values of the deposit multiplier and the money multiplier are widely divergent. Why might these values differ at present? What (if anything) do you think must happen for them to converge once again?
Esper is a component for complex event processing : Esper is a component for complex event processing (CEP). We use Esper in this exercise to learn about stream database systems and complex event processing. The scenario used in the exercise is building a stock trading robot. The events (ticks) are..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd