Coding 5 - Classes The Item class is defined for you. See the bottom of the file to see how we will run the code. Define a class ShoppingCart which supports the following functions: add_item(), get_total_price(), and print_summary(). Write code only where the three TODO's are. Below is the expected output: Added 2 Pizza(s) to Cart, at $13.12 each. Added 1 Soap(s) to Cart, at $2.25 each. Added 5 Cookie(s) to Cart, at $3.77 each.

Answers

Answer 1

Answer:

Explanation:

The following is written in Java. It creates the ShoppingCart class as requested and implements the requested methods. A test class has been added to the main method and the output is highlighted in red down below.

import java.util.ArrayList;

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       ShoppingCart newCart = new ShoppingCart();

       newCart.add_item();

       newCart.add_item();

       newCart.add_item();

       newCart.print_summary();

   }

}

class ShoppingCart {

   Scanner in = new Scanner(System.in);

   ArrayList<String> items = new ArrayList<>();

   ArrayList<Integer> amount = new ArrayList<>();

   ArrayList<Double> cost = new ArrayList<>();

   public ShoppingCart() {

   }

   public void add_item() {

       System.out.println("Enter Item:");

       this.items.add(this.in.next());

       System.out.println("Enter Item Amount:");

       this.amount.add(this.in.nextInt());

       System.out.println("Enter Cost Per Item:");

       this.cost.add(this.in.nextDouble());

   }

   public void get_total_price() {

       double total = 0;

       for (double price: cost) {

           total += price;

       }

       System.out.println("Total Cost: $" + total);

   }

   public void print_summary() {

       for (int i = 0; i < items.size(); i++) {

           System.out.println(amount.get(i) + " " + items.get(i) + " at " + cost.get(i) + " each.");

       }

       get_total_price();

   }

}

Coding 5 - Classes The Item Class Is Defined For You. See The Bottom Of The File To See How We Will Run

Related Questions

a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less than 100. End each prompt with newline Ex: For the user input 123, 395, 25, the expected output is:Enter a number (<100):Enter a number (<100):Enter a number (<100):Your number < 100 is: 25

Answers

Answer:

Explanation:

import java.util.Scanner;  

//Declare the class NumberPrompt.  

public class NumberPrompt  

{  

  public static void main(String args[])  

  {  

       /*Declare the variable of scanner class and allocate the  

       memory.*/  

       Scanner scnr = new Scanner(System.in);  

       

       //Initialize the variable userInput.  

       int userInput = 0;

       /* Your solution goes here*/

       //Start the do-while loop

       do

       {

         //Prompt the user to enter the number.

         System.out.println("Enter a number(<100)");  

         

         /*Store the number entered by the user in the

         variable userInput.*/

         userInput=scnr.nextInt();

           

       }while(userInput>=100);/*Run the do-while loop till the    

       user input is greater than 100*/  

       

       //Print the number which is less than 100.

       System.out.println("Your number <100 is "+userInput);

       return;

  }

}

Output:-

Write the Java code for the calculareDiameter method.

Answers

Answer:

* Program to find diameter, circumference and area of circle.

*/

import java.util.Scanner;

public class Circle {

   public static void main(String[] args) {

       // Declare constant for PI

       final double PI = 3.141592653;

       Scanner in = new Scanner(System.in);

       /* Input radius of circle from user. */

       System.out.println("Please enter radius of the circle : ");

       int r = in.nextInt();

       /* Calculate diameter, circumference and area. */

       int d = 2 * r;

       double circumference = 2 * PI * r;

       double area = PI * r * r;

       /* Print diameter, circumference and area of circle. */

       System.out.println("Diameter of circle is : " + d);

       System.out.println("Circumference of circle is : " + circumference);

       System.out.println("Area of circle is : " + area);

   }

}

111+ 11- 1


1111+1111




1101 +1101


1010-11​

Answers

Answer: 121, 2222, 2202, 999

Explanation:

Answer:

a. 121

b. 2222

c. 2202

c. 999

The First Web page you will see every time you launch the Web Browser Application is called​

Answers

Answer:

HomePage

Explanation:

Microsoft office can be classified under what heading of application

Answers

Answer:

Word processing software/application

pls mark as brainliest!

Have a grt day!!!

1. Which Property is used for changing the background color of any control
a) Font color b) Back color c) Text color d) color back

Answers

'Back Color' is characterized as the CSS property that is employed to modify or alter the background color belonging to any element of control.

B). 'Back Color' is the property that is used for altering the background color.

However, it excludes the margin area of the element and includes the entire size of the element along with the filler. One can select the color of his/her choice in order to promote the readability of the text by contrasting the background color to the text color. Thus, option B is the correct answer.

Learn more about 'CSS properties' here:

brainly.com/question/2671236

Difference between hardcopy and hardware​

Answers

Hardware is the tangible, or physical, pieces that make up your computer. ... A soft copy (just like software) remains on the computer and cannot be physically touched while a hard copy (just like your computer's hardware) is a printed piece of paper that be be touched

What values are in the vector named pressures after the following code is executed? vector pressures; pressures.push_back(32.4); pressures.push_back(33.5); pressures.insert(pressures.begin(), 34.2); int index = 2; pressures.insert(pressures.begin() + index, 31.8); pressures.push_back(33.3); index = 1; pressures.erase(pressures.begin() + index); a. 34.2, 31.8, 33.3 b. 34.2, 33.5, 31.8, 33.3 c. 34.2, 33.5, 33.3 d. 34.2, 31.8, 33.5, 33.3

Answers

Answer:

Hence the correct option is A that is "34.2 31.8 33.5 33.3".

Explanation:  

Program:-  

#include <iostream>

#include<vector>  

using namespace std;  

int main()

{

int count =0;

vector<double> pressures;

pressures.push_back(32.4);

pressures.push_back(33.5);

pressures.insert(pressures.begin(), 34.2);

int index = 2;

pressures.insert(pressures.begin() + index, 31.8);

pressures.push_back(33.3);

index = 1;

pressures.erase(pressures.begin() + index);

for (auto it = pressures.begin(); it != pressures.end(); ++it)

cout << ' ' << *it;

return 0;

}

what are the services offered by web-based email?​

Answers

Answer:

Web based email is a service that allows to access and use electronic mail via web browser.

It allows clients to login into the email software running on a web server to compose, send and receive, delete mails basically.

Mario is giving an informative presentation about methods for analyzing big datasets. He starts with the very basics, like what a big dataset is and why researchers would want to analyze them. The problem is that his audience consists primarily of researchers who have worked with big data before, so this information isn’t useful to them. Which key issue mentioned in the textbook did Mario fail to consider?

Answers

Answer:

Audience knowledge level

Explanation:

The Key issue that Mario failed to consider when preparing for her presentation is known as Audience knowledge level.  

Because Audience knowledge level comprises educating your audience with extensive information about the topic been presented. she actually tried in doing this but she was educating/presenting to the wrong audience ( People who are more knowledgeable than her on the topic ). she should have considered presenting a topic slightly different in order to motivate the audience.

What can be used to store data, plant viruses, or steal data?

Answers

Answer:

ITS A SIMPLE ANSWER BUT THE PROBLEM IS TOO BIG!

Explanation:

The phishing email might contain a link which on clicking will take you to a fake web page. For example, the link might take you to a fake bank website which looks very legitimate but in reality is just a lookalike. If the victim falls for the scam and enters his/her account details on the website, the details will actually go to the hacker's server instead of going to the bank and the hacker will have all the information that the victim has provided on the website.

You are the IT administrator for a small corporate network. You have recently experienced some problems with devices on the workstation in the Support Office. In this lab, your task is use Device Manager to complete the following:______.
The new network card you installed isn't working as expected (speed is only 1 Mbps). Until you can figure out what the problem is, disable the Broadcom network adapter and enable the Realtek network adapter. To make sure the network adapter has the latest drivers, update the driver for the Realtek network adapter by searching Microsoft Update. You recently updated the driver for your video card. However, the system experiences periodic crashes that you suspect are caused by the new driver. Roll back the driver to a previous version. Move the Ethernet cable to the integrated network port on the motherboard.

Answers

Answer:

I will fix it by my mind by thinking

Based on the above scenario, the steps to take is given below\

What is the management about?

The first thing is to Right-click Start and click on Device Manager and then you expand Network adapters.

Later you Disable the network adapter  and then Update the driver .

Learn more about Ethernet from

https://brainly.com/question/1637942

#SPJ2

Is" Python programming Language" really
worth studying? If yes? Give at least 10 reasons.

Answers

1. Python is a particularly lucrative programming language

2. Python is used in machine learning & artificial intelligence, fields at the cutting-edge of tech

3. Python is simply structured and easy to learn

4. Python has a really cool best friend: data science dilemma.

5. Python is versatile in terms of platform and purpose

6. Python is growing in job market demand

7. Python dives into deep learning

8. Python creates amazing graphics

9. Python supports testing in tech and has a pretty sweet library

10. There are countless free resources available to Python newbies

Write a program to compare the content of AX and DX registers, if they are equal store 1 (as 8 bits) in locations with offset addresses (0020H, 0021H, ..., 0040H), otherwise leave these locations without changing.
???​

Answers

Answer:

so srry I'm very low that this question

What would be displayed if the “=proper(A1)” function is applied to the cell below?

Answers

The answer is D: Pedro Garcia

Programming languages categorize data into different types. Identify the characteristics that match each of the following data types.

a. Can store fractions and numbers with decimal positions
b. Is limited to values that are either true or false (represented internally as one and zero).
c. Is limited to whole numbers (counting numbers 1, 2, 3, ...)

Answers

Answer:

a) Integer data type.

b) Real data type.

c) Boolean data type.

Explanation:

a) Integer data type is limited to whole numbers (counting numbers 1, 2, 3…….).

b) Real data type can store fractions and numbers with decimal positions (such as dollar values like $10.95).

c) Boolean data type is limited to values that are either true or false (represented internally as 1 and 0 respectively).

What are the differences between sequential and random files? Which one do you think is better and why?

Answers

Answer:

Sequential is better

Explanation:

Sequential is more organized while the more easier to make but less dependable one is random.

sequential is used for things such as date of birth, or where someone was born.

you can't do that with a random file.

Discuss the OSI Layer protocols application in Mobile Computing

Answers

Answer:

The OSI Model (Open Systems Interconnection Model) is a conceptual framework used to describe the functions of a networking system. The OSI model characterizes computing functions into a universal set of rules and requirements in order to support interoperability between different products and software.

hope that helps you

please follow

please mark brainliest

What is the relationship between an organization’s specific architecture development process and the Six-Step Process?

Answers

Answer:

It is a method of developing architecture in various stages

Explanation:

The organization-specific architecture developmental process is a tested and repeated process for developing architecture. It made to deal with most of the systems. It describes the initial phases of development.  While the six step process is to define the desired outcomes, Endorse the process, establish the criteria and develop alternatives. Finally to document and evaluate the process.

The advantage of returning a structure type from a function when compared to returning a fundamental type is that a. the function can return multiple values b. the function can return an object c. the function doesn’t need to include a return statement d. all of the above e. a and b only

Answers

Answer:

The advantage of returning a structure type from a function when compared to returning a fundamental type is that

e. a and b only.

Explanation:

One advantage of returning a structure type from a function vis-a-vis returning a fundamental type is that the function can return multiple values.  The second advantage is that the function can return can an object.  This implies that a function in a structure type can be passed from one function to another.

Define firewall ?with example

Answers

Explanation:

it acts as a barrier between a trusted system or network and outside connections, such as the Internet. However, a computer firewall is more of a filter than a wall, allowing trusted data to flow through it. ... For example, a basic firewall may allow traffic from all IP.

if my answer helps you than mark me as brainliest.

Answer:

hope this helps

Explanation:

Firewalls are software or hardware that work as a filtration system for the data attempting to enter your computer or network. Firewalls scan packets for malicious code or attack vectors that have already been identified as established threats.And also firewall is a network security device that monitors incoming and outgoing network traffic and permits or blocks data packets based on a set of security rules.

Which term refers to the use of expressions to check consistency in relation to other fields in the same record?
O data validation
O record validation
O input mask
O validation text

Answers

This is the answer 3 due to the thought me

The  term validation text refers to the use of expressions to check consistency in relation to other fields in the same record.

What is the use of validation text?

The term Validation text is known to be one that helps a user to be able to have a message that can help them to be able to input data that is said to be not valid.

Conclusively, Validations rules is known to aid one in that one can check data for accuracy and consistency in terms of  data entry.

Learn more about Validation text from

https://brainly.com/question/12069810

#SPJ2

OSI model layers application in mobile computing

Answers

Answer:

The OSI Model (Open Systems Interconnection Model) is a conceptual framework used to describe the functions of a networking system. The OSI model characterizes computing functions into a universal set of rules and requirements in order to support interoperability between different products and software.

In the welding operations of a bicycle manufacturer, a bike frame has a long flow time. The set up for the bike frame is a 7 hour long operation. After the setup, the processing takes 6 hour(s). Finally, the bike frame waits in a storage space for 7 hours before sold. Determine the value-added percentage of the flow time for this bike frame. Round your answer to the nearest whole number for percentage and do NOT include the "%" sign in the answer. For example, if your answer is 17.7%, please answer 18. If your answer is 17.4%, please answer 17. No "%" sign. No letter. No symbols. No explanation. Just an integer number.

Answers

Answer:

Bike Frame Flow Time

The value-added percentage of the flow time for this bike frame is:

= 46.

Explanation:

a) Data and Calculations:

Bike Frame Flow Time:

Setup time = 7 hours

Processing time = 6 hours

Storage time = 7 hours

Flow time of the bike frame = 13 hours (7 + 6)

Value-added percentage of the flow time for this bike frame = 6/13 * 100

= 46%

b) Flow time represents the amount of time a bicycle frame spends in the manufacturing process from setup to end.  It is called the total processing time. Unless there is one path through the process, the flow time equals the length of the longest process path.  The storage time is not included in the flow time since it is not a manufacturing process.

Hello everybody,
For the quiz questions, I tried using the circular method, but got a numeric, period or comma error?
So I tried using the solver to find the same solution I got, but when I entered it in the answer box, he always said incorrectly.
Any help would be highly appreciated and write the results here, why do I have to read the solution quiz because I was wrong? thank you.


The bisection method is being used to calculate the zero of the following function between x = 0 and x = 1.
What is the midpoint for the 3rd iteration? (The midpoint for the 1st iteration is 0.5.) Provide your answer rounded to the thousandths place.

Answers

Answer:

i don't know the answer please tell me

List any four strategies of IT Policy?

Answers

Answer:

News skill and qualifications

1. Open the start file EX2019-ChallengeYourself-9-3. The file will be renamed automatically to include your name. Change the project file name if directed to do so by your instructor, and save it.
2. If the workbook opens in Protected View, click the Enable Editing button in the Message Bar at the top of the workbook so you can modify the workbook.
3. Use Consolidate to create a summary of real estate sales for all property types. Place the consolidated data on the Summary worksheet in cells B3: C15. Use the Average function to consolidate the data from cells B2: C14 in the Condo, Townhouse, and Single Family worksheets. Include links to the source data.
4. Import individual sales data from the tab-delimited text file Select Sales Data 2019-2020. Import the data as a table in cell A1 of the Select Sales worksheet.
5. Remove the data connection when the import is complete.
6. In the Select Sales worksheet, add data validation to restrict values in the House Type columns (cells B2: B139) to the values in the cell range named PropertyTypes. Include a drop-down list of values in the cells to assist in data correction.
7. Add the following input message to cells B2:B139: Select a property type from the list.
8. Add the following error alert to cells B2:B139: Not a valid property type.
9. Apply data validation circles to any values that violate the data validation rules you just created.
10. Add a comment to cell B1 in the Select Sales worksheet that reads: This needs to be fixed.
11. Add a hyperlink from cell B1 in the Select Sales worksheet to link to the named range (defined name) PropertyTypes. Test the link.
12. Use Flash Fill to add a new column of data to the Select Sales worksheet to display the number of bedrooms/the number of bathrooms.
a. In the Select Sales worksheet, cell F1, type the heading: BR/BA
b. Complete the column of data using this pattern in cell F2: 1 BR/1 BA
You will need to enter at least two samples in order for Flash Fill to suggest the correct autofill data. Check your work carefully.
Sales Summary 2019-2020
Number of Sales Average Selling Price
1
2
3 One BR, One BA
4 One BR, Two BA +
5 Two BR, One BA
6 Two BR, Two BA
7 Two BR, Two BA +
8 Three BR, One BA
9 Three BR, Two BA
10 Three BR, Three BA +
11 Four BR, One BA
12 Four BR, Two BA
13 Four BR, Three BA+
14 Five BR-. One BA
15 Five BR+ Two BA+
16
17
18
19
20
21
22
23
24

Answers

Answer:

Omg what is this

soooo long questionn

i am fainted

what rubbish you written how long the question is of which subject

what's your name

What are the best websites to learn about Java Programing?

Answers

Answer:

well you can download some apps from the play store and it is easy for you to learn from there (interactive)

please help!....................

Answers

Answer:

Based on what the graph does on the number line, I would say 1100110

Every time the graph spikes up, that is a one, otherwise it is a zero.

Explanation:

WHAT IS ONE WAY A PIVOTTABLE COULD COMBINE THE FOLLOWING DATA

Answers

Answer: You sort table data with commands that are displayed when you click a header arrow button. Hope it help's :D

Other Questions
K KNOW what do you know about wouth central and west asia Help please!!!!!!!!!!! A wheelchair ramp with a length of 61 inches has a horizontal distance of 60 inches. What is the ramps vertical distance In a certain population, the allele causing sickle cell anemia has a frequency of 0.2. If the population is in genetic equilibrium for this allele, what fraction of the population would be heterozygous for this gene Help me plz Define ore. Name any two ores of iron. In 20 words or fewer, explain why a slave owner might free his slavesin his will. Why not sooner? SOLVE PLS!! ILL MARK BRAINILEST!! which inequality represents all values of x for which the quotient below is defined? 15(x-1) 2^2 Rewrite the sentences using possessive adjectives. 1. El profesor tiene pluma.2. T tienes mochilas.3. Los turistas tienen mapa.4. Usted tiene cuadernos.5. Nosotros tenemos papelera.HELP WILL GIVE BRAINLIEST!!!(i need this legit rn so pls help) 3s + 4t = 228s + 8t = 48What is s and what is t(Similtaneous Equations) pls help me with this How was Roman art different from Greek art? Print the two strings in alphabetical order. Assume the strings are lowercase. End with newline. Sample output: capes rabbits import java.util.Scanner: public class OrderStrings { public static void main (String args) { String firstString: String secondString: firstString = "rabbits" secondString = "capes" /*Your solution goes here */ return: } }import java.util.Scanner;public class OrderStrings { public static void main(String[] args) { String firstString; String secondString; firstString = "rabbit"; secondString= "capes"; //String class in java provide string comparison function, use it, and get //your work done may even use brute force i.e using for loop and compare character by // character which will not good for the programming language which already have vast //predefined number of functions if(firstString.compareTo(secondString) < 0){ System.out.println(firstString + " " + secondString); } else{ System.out.println(secondString + " " + firstString); } return; }} Fred, a skycap at the airport, is paid$5.15 per hour. During an 8-hourshift, he earned $195.00 in tips. Whatwere his estimated total earnings fora 40-hour week? what is a saturted solution The speaker has just made a key point. The global middle class will double in the coming years. However, this new middle class rising out of emerging economies is quite different from the current global middle class. The speaker suggests the R and D (research and development) organizations of today's companies may not be well positioned to gain this market. Which advantage of globalization does this point most directly address what is displacement? the ratio of boys to girls is 4 :3,if there are 24boys and how many girls will be there? Cuales son las reglas ortogrficas de los signos de puntuacin? does the point (-4, 2) lie inside or outside or on the circle x^2 + y^2 = 25?