Calculates the area of a triangle

Assignment Help JAVA Programming
Reference no: EM13705127

Can you find the area of a triangle?

Program: Write a simple Java application which calculates the area of a triangle. Your application should ask the user to enter the base and height values of the triangle.

You must use the Scanner class to collect the user's input. The height and base values should be treated as floating point values. Calculate the area of triangle: area = 0.5 * base * height.

You must use a JOptionPane to output the result.

Your output of the program must show three digits after the decimal point - make sure you remember to import what your program will use.

 

Reference no: EM13705127

Questions Cloud

Explain gas is produced through three stages of seperation : Problem- A reservoir containing retrograde gas has a reservoir pressure higher than the dew-point pressure of the gras as evidenced by constant producing gas-oil ratio. The gas is produced through three stages of seperation. Surface production rat..
Design the storyboards : Design the storyboards, interactivity diagram, object dictionary, and any essential scripts for an interactive program for customers of Carrie's Custom T-Shirts.
Determine the best way to gather business rules : You have been hired by Happy Health to determine the best way to gather business rules for a new phone system.
Calculate the magnitude of the cohesive energy of potassium : Calculate the magnitude of the cohesive energy of potassium iodide (KI). The ionic radii of K+ and I?, are 152pm and 206 pm, respectively.
Calculates the area of a triangle : Write a simple Java application which calculates the area of a triangle. Your application should ask the user to enter the base and height values of the triangle.
Calculate the weight of benzene codistilled with water : Problem- Calculate the weight of benzene codistilled with each gram of water and the percentage composition of the vapor produced during a steam distillation. The boiling point of the mixture is 69.4C. The vapor pressure of water at 69.4C is 227.7..
Calculate the percentage wins of a team : Write a program that will calculate the percentage wins of a team. The program will input the number of wins and losses that a team acquired during a season. The wins should be input in a parameter-less value returning function that returns the wi..
Calculate the specific gravity of the reservoir gas : Problem- A reservoir containing retrograde gas has a reservoir pressure higher than the dew-point pressure of the gras as evidenced by constant producing gas-oil ratio. The gas is produced through three stages of seperation. Surface production rat..
Front-end and back-end validation : What are the advantages and disadvantages of front-end and back-end validation and in which specific situations would one technique of validation be preferred over the other?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create a class named blooddata

Create a class named BloodData that includes fields that hold a blood type (the four blood types are O, A, B, and AB) and an Rh factor

  This project is for designing and developing a college

this project is for designing and developing a college registration program. prepare a java program to register

  Question 1a give explanation amp the significance of

question 1a give explanation amp the significance of enterprise java beans ejb in software development.b explain the

  What is overloading and what is overriding

What is overloading and what is overriding? Please use code to explain it.

  Explain how cookies are used to implement sessions

Describe a set of four methods that a queue would need to implement using a circular array and show the Java code to implement them if using an implementation given the outline definition below. Do not use any methods of the Collection classes.

  Palindrome by doing character replacement

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement.

  Be sure to show all declarations

Write a function call that invokes function a. Be sure to show all declarations. However a complete main is not required.

  On any given execution your program

On any given execution your program will produce just one version of the figure. However, you should refer to the class constant throughout your code, so that by simply changing your constant's value and recompiling, your program would produce a f..

  Create a class called numberset

You need to create a class called NumberSet.  It needs an empty default constructor and an overloaded constructor that takes an integer argument and creates a vector with that many random numbers in it.  So... if I created

  Menu based program to maintain student records

Write a menu based program to maintain student records. Your program should take the following inputs: 1. Student first name (max. 20 characters) 2. Student last name, (max. 20 characters) 3. Student scores (float/double), eg. 85.4 Problem

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Programming principles please help me doing my assignment i

please help me doing my assignment i have attached my assignment requirement document refer it and send me the solution

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