4 java questions
- Write a java program that prints on separate lines, your first name, your favorite hobby, your favorite car, your favorite book, and your favorite movie. Be sure to label each line so that the information is understandable. Enter the information for the 5 fields in the program itself.
- Write a java program that asks you to enter your last name, your country of origin, your age, and your expected graduation year.
After you enter them, write out each answer on a separate line. You must use Scanner to input the 4 fields, and println to output the 4 fields separately. - Write a java program that asks you to enter the cost of an item, how many of the items are available in inventory, the expiration month of the item. After you enter them, display each answer with JOptionPane with a separate dialog box. You must use JOptionPane to enter the 3 fields
- Write a java program that asks the user to enter the length of a room in feet and to enter the width of a room in feet [you may use either Scanner or JOptionPane].
Assuming that the carpet they plan to use is $20.00 a square yard, compute how much it is going to cost to carpet the room.Print out on 3 separate lines:
The number of square feet,
The number of square yards,
The cost to carpet the room.