Question

In: Computer Science

IN JAVA PROGRAMMING Write a complete Java program to do the following: a) Prompt the user...

IN JAVA PROGRAMMING

Write a complete Java program to do the following:

a) Prompt the user to enter the name of the month he/she was born in (example: September).

b) Prompt the user to enter his/her weight in pounds (example: 145.75).

c) Prompt the user to enter his/her height in feet (example: 6.5).

d) Display (print) a line of message on the screen that reads as follows:

You were born in the month of September and weigh 145.75 lbs. and are 6.5 feet tall.

Solutions

Expert Solution

In case of any queries,please comment. I would be very happy to assist all your queries.Please give a Thumps up if you like the answer.

Program

import java.util.Scanner;
public class read
{
public static void main(String args[])
{
   Scanner input = new Scanner (System.in);
  
       float weight,height;
       String month;
  
       System.out.print("Enter the name of the month you born : " );
       month = input.nextLine();
  
       System.out.print("Enter your weight in pounds: " );
       weight = input.nextFloat();
       System.out.print( "Enter your height in feet : ");
       height = input.nextFloat();

       System.out.println( "You were born in the month of "+month+" and weigh "+weight+" lbs. and are "+height+" feet tall.");
}
  
}

Output

Enter the name of the month you born : September
Enter your weight in pounds: 145.75
Enter your height in feet : 6.5
You were born in the month of September and weigh 145.75 lbs. and are 6.5 feet tall.

Screenshot


Related Solutions

jgrasp environment, java write a complete program that calculates a restaurant bill. Prompt the user for...
jgrasp environment, java write a complete program that calculates a restaurant bill. Prompt the user for the check amount, then ask the user what type of tipp they would like to leave: the choices are 1 for good tip (20%), 2 for an average tip (15%), or 3 for poor tip (10%). Use their input and an if-else to calculate the tip amount. Then calculate and output the final bill: check+tip print out the bill, exactly as shown (print the...
Java Programming Language Scenario: write a program that will prompt a user for 10 legendary people/characters....
Java Programming Language Scenario: write a program that will prompt a user for 10 legendary people/characters. After the entries are complete the program will display all 10 characters information. Store these characters in an array. Requirements: Create a user-defined class with the fields below: First Last Nickname Role Origin Create a main-source that will use the user-defined class and do the prompting. Create get/set methods in your user-defined class and methods in the main-source. Use an array to store the...
Write a complete program in java that will do the following:
Write a complete program in java that will do the following:Sports:             Baseball, Basketball, Football, Hockey, Volleyball, WaterpoloPlayers:           9, 5, 11, 6, 6, 7Store the data in appropriate arraysProvide an output of sports and player numbers. See below:Baseball          9 players.Basketball       5 players.Football           11 players.Hockey            6 players.Volleyball        6 players.Waterpolo       7 players.Use Scanner to provide the number of friends you have for a team sport.Provide an output of suggested sports for your group of friends. If your...
Write a Java program named, MultiTable, (MultiTable.java), with the following tasks: Prompt user to input the...
Write a Java program named, MultiTable, (MultiTable.java), with the following tasks: Prompt user to input the maximum number (as integer) Store a multiplication table for all combinations (with some specific eliminations) of value 0 through the maximum number (being entered) into a 2-D array Write a method named printTable to print out the MulitTable, with the following header, public static void printTable(int[][] multitable) In printTable(), when the value of the MultiTable is an odd number, print out Z Must use...
Write a Java program named, TicketSale, (TicketSale.java) with the following tasks: Prompt user to input the...
Write a Java program named, TicketSale, (TicketSale.java) with the following tasks: Prompt user to input the number of Adult tickets to purchase Prompt user to input the number of Children tickets to purchase Prompt user to input the number of Senior tickets to purchase Write a method named, ticketCost(), which will be invoked by main() with statement similar to: cost = ticketCost( adults, children, senior ); Ticket costs structure: $15.00 for each adult $10.00 for each child $5.00 for each...
Using Java, write a program named MyAngles that will prompt the user for the measure of...
Using Java, write a program named MyAngles that will prompt the user for the measure of the three sides of a triangle and then reports the measurement of each interior angle of the triangle and the area of the triangle.
JAVA Write a java program that will sum all positive number. Prompt the user to enter...
JAVA Write a java program that will sum all positive number. Prompt the user to enter numbers and add all positive numbers. The program will not add negative numbers and the program will stop when you enter ‘0’.   Enter a number> 25 Enter a number> 9 Enter a number> 5 Enter a number> -3 Enter a number> 0 Sum = 39
(b) You will write a program that will do the following: prompt the user enter characters...
(b) You will write a program that will do the following: prompt the user enter characters from the keyboard, you will read the characters until reading the letter ‘Q’ You will compute statistics concerning the type of characters entered. In this lab we will use a while loop. We will read characters from stdin until we read the character ‘Q’. Example input mJ0*5/]+x1@3qcxQ The ‘Q’ should be included when computing the statistics properties of the input. Since characters are integers...
Java Programming: Write a program that allows the user to compute the power of a number...
Java Programming: Write a program that allows the user to compute the power of a number or the product of two numbers. Your program should prompt the user for the following information: • Type of operation to perform • Two numbers (the arguments) for the operation to perform The program then outputs the following information: • The result of the mathematical operation selected. Menu to be displayed for the user: MATH TOOL 1. Compute the power of a number 2....
Time Calculator – Intro To Programming - JAVA Write a program that asks the user to...
Time Calculator – Intro To Programming - JAVA Write a program that asks the user to enter a number of seconds. • There are 60 seconds in a minute. If the number of seconds entered by the user is greater than or equal to 60, the program should display the number of minutes in that many seconds. • There are 3,600 seconds in an hour. If the number of seconds entered by the user is greater than or equal to...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT