Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I. Design a Java program that prompts the user to enter his or her height and stores the unct amput in a sociable mined heigh.

image text in transcribed
I. Design a Java program that prompts the user to enter his or her height and stores the unct amput in a sociable mined heigh. Then display the user's height with a descriptive label.T The following steps are involved in using the Scanner Class. import Java. util Scanner, //directive - outside of the body of the class b. Declare create a Scamper dass object (using new operator) in order to call the Scanner method. Seamber keyboard . new Scanner (System in): You must declare a forbible same to store the value that's entered from the keyboard. Int height: Systemtoat.print("Enter your height in inches )" e. Call one of the Scanner diss medeals to allow the user to enter the value from the keyboard. height - key board.nextlan( ); " This program will allow the use to care huber heights (in aches) and display it import java.util Scanner. public chas Display .eight public sisfic void main( String art, Scanner keyboard hey Scanner( System,in): int height: sept Iprompt the Last System out in(" Eniis your height in inches")! " Call one of the Scanace class method: (nexting( )) to allow the user to enter the value from die keyboard height - keyboard.next lack ): Toutput displayed System.out printla(" Your height is " + height - " inches 2. Write design a Java program that prompts the cher to enter the leach and width of a rectangle and calculates the area and display output the area with description. Name the class ComputeArcs. BIND the perimeter 2 " length + 2 * width Ill Prompt the use, to cater length & width prompt for the length enter the length prompt for widid enter the width b. Calculate the perimeter by using les length " widd Quiput the area display "The area is " + area Translate the above algorithm into a complete JAYa program, cater it. and run it from the welle !Doadls cant. Then A company hits determined that its annual profil is typically 23 percent of total sale. Design . Jay. program wala prompts the user to enter the projected amount of total sales, and then compute and display the profit that will be made from that mount, Name the class ProfitAnt. Hint: Use the value 0.23 to represent 23 parccat Translate the algorithmn from Problem-Solving Excocise #2, problem #1 into the complete Joys program, care if and tua it from JDoodle.com and auteuil in Blackbe Write a Java program that prompt the west to input the radios and bright of a cy lader and then calculies and display the volume of the cylinder using this tool volumes - F * radius * radius . height Declares comalsat for PI - 3.14139

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions