1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
noname [10]
3 years ago
15

Write a class named RetailItem that holds data about an item in a retail store. The class should store the following data in att

ributes: item description, units in inventory, and price. Once you have written the class, write a program that creates three RetailItem objects, and stores the following data in them:
Description Units in Inventory Price
Item #1 Jacket 12 59.95
Item #2 Designer Jeans 40 34.95
Item #3 Shirt 20 24.95
Computers and Technology
1 answer:
sp2606 [1]3 years ago
7 0

Answer:

public class Main

{

public static void main(String[] args) {

 

 RetailItem ob1 = new RetailItem("Jacket", 12, 59.95);

 RetailItem ob2 = new RetailItem("Designer Jeans", 40, 34.95);

 RetailItem ob3 = new RetailItem("Shirt", 20, 24.95);

 

}

}

class RetailItem {

   

   private String itemDescription;

   private int units;

   private double price;

   

   public RetailItem(String itemDescription, int units, double price) {

       this.itemDescription = itemDescription;

       this.units = units;

       this.price = price;

   }

}

Explanation:

Create a class called RetailItem that has three variables itemDescription, units, and price

Initialize a constructor that takes three parameters to set the values

Inside the main, create three objects with given data

You might be interested in
What is used to switch to Outline View?
Yuri [45]
<span>What is used to switch to Outline View?

the Insert tab
the status bar
the Mailings tab
the Page Layout bar</span>

Actually, it is found in the VIEW TAB which is in the STATUS BAR. Coincidentally, all of those tabs can be found in the status bar.

7 0
3 years ago
Read 2 more answers
Electronic files created on a computer using programs such as Word software are considered to be _____.documents icons media sav
Rudiy27
Documents. Note that electronic document is a type of media too.
5 0
4 years ago
A(n) ________ virus runs a program that searches for common types of data files, compresses them, and makes them unusable.
ad-work [718]

Answer:

encryption

Explanation:

A(n) encryption   virus runs a program that searches for common types of data files, compresses them, and makes them unusable.

5 0
3 years ago
Two technicians are discussing fully charged battery voltage readings. technician a says that it should read approximately 12.6v
Veronika [31]

I prefer to choose the technician A. It should read approximately 12.6V. Volts is the basic unit used to measure voltage and I think the technician B stating the mv units in her reading comes from the units of his multitesters setting.

3 0
3 years ago
A major advantage of a method is that it is easily reusable. What does it mean to reuse a method and what are the advantages of
JulijaS [17]

Answer: To reuse a method means to use a code which has been done or prepared already and just we need to change some of the functionalities.

This helps a great deal of saving time as well as helps in making the code manageable.

Explanation:

This has been practiced since long that methods can be reused. for example we need to build a calculator in c. then we can simply reuse the same method  just we need to change the sign of the operator. So in this process we can speed up our operations and work and also can make the code easy to understand and manage it when we have have to deal with large lines of code.

8 0
3 years ago
Other questions:
  • The network ____, the person overseeing network operations, uses a server operating system to add and remove users, computers, a
    15·1 answer
  • Which of the following statements is NOT true about a mainframe computer?
    14·1 answer
  • Janice, who is 15, posts post a picture of herself drinking alcohol and making an obscene gesture on her social network page. wh
    15·2 answers
  • Which best describes obliteration in a forged document?
    11·1 answer
  • We already know that we can create a lunar lander application of the pipe-and-filter architecture style from three independent J
    6·1 answer
  • For the function definition int SomeFunc( /* in */ int alpha, /* in */ int beta ) { int gamma; alpha = alpha + beta; gamma = 2 *
    6·2 answers
  • A game developer is purchasing a computing device to develop a game and recognizes the game engine software will require a devic
    7·1 answer
  • Start
    14·1 answer
  • The create_python_script function creates a new python script in the current working directory, adds the line of comments to it
    6·1 answer
  • Can someone let me join your kingdom if anybody knows this game and plays it as well. ​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!