Answered step by step
Verified Expert Solution
Question
1 Approved Answer
can you do do this programming in java ? please provide me the correct answer ! Also provide me the flowchart for this please 4.
can you do do this programming in java ? please provide me the correct answer ! Also provide me the flowchart for this please
4. Retailltem Class Write a class named Retailtem that holds data about an item inTa retail store. The class should have the following fields: - description. The description field references a String object that holds a brief description of the item. - unitsOnHand. The unitsOnHand field is an int variable that holds the number of units currently in inventory. - price. The price field is a double that holds the item's retail price. Write a constructor that accepts arguments for each field, appropriate mutator methods that store values in these fields, and accessor methods that return the values in these fields. Once you have written the class, write a separate program that creates three Retailtem objects and stores the following data in them: 8. Temperature Class Write a Temperature class that will hold a temperature in Fahrenheit, and provide methods to get the temperature in Fahrenheit, Celsius, and Kelvin. The class should have the following field: - ftemp - A double that holds a Fahrenheit temperature. The class should have the following methods: - Constructor - The constructor accepts a Fahrenheit temperature (as a double) and stores it in the - setFahrenheit - The setFahrenheit method accepts a Fahrenheit temperature (as a double) and stores it in the ftemp field. - getFahrenheit - Returns the value of the ftemp field, as a Fahrenheit temperature (no conversion required). - getCelsius - Returns the value of the ftemp field converted to Welsius. - getKelvin - Returns the value of the ftemp field converted to Kelvin. Use the following formula to convert the Fahrenheit temperature to Celsius: Celsius =(5/9) * (Fahrenheit - 32) Use the following formula to convert the Fahrenheit temperature to Kelvin: Kelvin = ((5/9)* ( Fahrenheit - 32)) +273 Demonstrate the Temperature class by writing a separate program that asks the user for a Fahrenheit temperature. The program should create an instance of the Temperature class, with the value entered by the user passed to the constructor. The program should then call the object's methods to display the temperature in Celsius and Kelvin. *Description: This program will displays a string without any user interaction *Class: Fal1 - CosC 1437.81002 *Assignment1: Hello World *Date: 08/15/2011 *eauthor Zoltan Szabo *aversion 0,, \% For each method, you will also be required to create docstring as follows: 1=0 * Eparam string as args * ereturn Termination code as int, o for normal, anything else is error condition - @throws Nothing is implemented Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started