Question: Since we are adding on to the same program, each time we run the program we will get the output from the previous tasks before

 Since we are adding on to the same program, each time

Since we are adding on to the same program, each time we run the program we will get the output from the previous tasks before the output of the current task. Use the charAt method to get the first character in firstName and store it in a variable called firstInitial (you will need to declare any variables that you use). Print out the user's first initial. Use the toUpperCase method to change the fullName to all capitals and store it back into the fullName variable Add a line that prints out the value of fullName and how many characters (including the space) are in the string stored in fullName (use the method length to obtain that information). Compile, debug, and run. The new output added on after the output from the previous tasks should have your initials and your full name in all capital letters. Add a line that prompts the user to enter the diameter of a sphere. Read in and store the number into a variable called diameter (you will need to declare any variables that you use). The diameter is twice as long as the radius, so calculate and store the radius in an appropriately named variable. The formula for the volume of a sphere is V = 4/3 pi r^3 Convert the formula to Java and add a line which calculates and stores the value of volume in an appropriately named variable. Use Math.PI for pi and Math.pow to cube the radius. Print your results to the screen with an appropriate message. Compile, debug, and run using the following test data and record the results

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!