Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can you please solve this programming in java? please provide me the correct and complete answer! please also provide me a flowchart for this! b

can you please solve this programming in java? please provide me the correct and complete answer! please also provide me a flowchart for this!
image text in transcribed
b
image text in transcribed
image text in transcribed
image text in transcribed
4. Retailtem Class Write a class named Retailttem that holds data about an item in a 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 ftemp field. - 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 Celsius. - 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. You only need to submit the source code (.java and not the project or the class) files of all the classes you'll implement and the driver program for the problem. *Description: This program will displays a string without any user interaction *Class: Fall - Cose 1437.81002 *Assigniment1: Hello World *Date: 08/15/2011 *faathor Zoltan Szabo "Giversion 0.0. % For each method, you will also be required to create docstring as follows: r - Eparam string as args * Qreturn Termination code as int, 0 for normal, anything else is error condition * athrows Nothing is implemented

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

More Books

Students also viewed these Databases questions

Question

Write an equation for each ellipse. 3 (-1, 1) 3 -3 -3F

Answered: 1 week ago

Question

How does a person know whether a document has been plagiarized?

Answered: 1 week ago