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
emmasim [6.3K]
1 year ago
10

Please solve this in JAVA Please see the attachment

Computers and Technology
1 answer:
Alina [70]1 year ago
3 0

Answer:

I'm going to do it but you should try these things for yourself or else you won't learn.

Explanation:

-First create a project (I'm using Netbeans 14 and the project is a Maven, but the code should work on any IDE)


-Name the project 'ShoppingCartPrinter' and leave the package name as it is. This is the main class so the main method is gonna be there already.

-Then you will create a second class named 'ItemToPurchase'. So I'll leave the code in the attachment (at the bottom of my answer it's written 'Download txt') or else brainly will think it's some sort of redirection to another websites because of the 'dots' and won't let me post it.






Download txt
You might be interested in
g If a class named Student has a data member named gpa , and one of its member functions has a parameter also named gpa , how ca
victus00 [196]

Answer:

By using the this keyword

Explanation:

The this keyword in java is used for pointing the current object or current variable .The this keyword is removing the ambiguity among the characteristics of the class as well as the variables with the similar name.

In the given question if the class student has member variable gpa also we have a method having the argument gpa with the help of this keyword we can refer the gpa variable inside the method .

Following are the implementation of the given question

public class Main // main class

{

 int gpa; // variable declaration

 public Main(int gpa) // constructor

 {

   this.gpa = gpa; // this keyword

 }

 public static void main(String[] args) // Main method

 {

   Main m= new Main(55); // creating object of class

   System.out.println("The Value of gpa is : " + m.gpa); // display value

 }

}

Output:

The Value of gpa is :55

5 0
3 years ago
The Integers 10, 30, 20 are inserted in that order, into an AVL Tree. Which sequence of commands will make the correct method ca
mel-nik [20]

Answer and Explanation:

After inserting the integers "10", "30" and "20" in an AVL tree, It looks like:

This tree is not balanced. So, to balance this tree, we have to follow some steps:

Step 1 :

After following the LR (Left rotation), Tree will look like:

Step 2 :

Now, following the RL (Right rotation), we will get a balanced AVL tree like:

4 0
3 years ago
Kelly is a college sophomore majoring in computer science. She is interested in gaining exposure to the most useful and current
Nuetrik [128]

Answer:

Java

Explanation:

Java is a general-purpose programming language that is object-oriented, and has strong support for web development.

Therefore, one of the languages that a college sophomore majoring computer science learn is <u>Java,</u> an object-oriented programming language that is commonly used to write Web applications.

6 0
3 years ago
How is a transaction verified on a cryptocurrency network?.
Agata [3.3K]

Answer:

By being a part of a block to a block chain and each block in the block chain is precisely connected to the block that was before it.

Explanation:

I Hope This Helps You

6 0
2 years ago
I will mark you as brainlist
weeeeeb [17]

Answer:

download it

Explanation:

because if u upload it will not save .

7 0
2 years ago
Read 2 more answers
Other questions:
  • A switch operates in the OSI reference model __________ layer and uses the __________ address to forward packets.
    8·1 answer
  • A video streaming website uses 32 bit integers to count the number of times each video is played. In anticipation of some videos
    14·2 answers
  • As a safe driver, you cannot, __________
    13·1 answer
  • A5.3 1012 kg satellite is 1,800 m from another satellite that has a mass of 3.5 x 108 kg. What is the gravitational
    6·1 answer
  • A virus or worm can have a payload that installs a(n) __________ door or trap-door component in a system, which allows the attac
    14·2 answers
  • So can u please follow my new ig acc i just started it yesterday its called stunnerspamz
    5·2 answers
  • Free 35 points!!!
    11·2 answers
  • One key feature of malware is that it:
    13·1 answer
  • Please help with coding assignment.
    11·1 answer
  • sing the drop-down menu, identify the flowchart symbols. The oval represents the . The rectangle represents the . The diamond re
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!