Write a program that uses the Purchase class in 5.13. Set the prices to the following: Oranges: 10 for $2.99 Eggs: 12 for $1.69 Apples: 3 for $1.00 Watermelons: $4.39 each Bagels: 6 for $3.50 Set the purchased quantity to the following: 2 dozen oranges, 2 dozen eggs, 20 apples, 2 watermelons, 1 dozen bagels Display the total cost of the bill

Answers

Answer 1

Answer:

Explanation:

The following program is written in Java. Using the program code from Purchase class in 5.13 I created each one of the fruit objects. Then I set the price for each object using the setPrice method. Then I set the number of each fruit that I intended on buying with the setNumberBought method. Finally, I called each objects getTotalCost method to get the final price of each object which was all added to the totalCost instance variable. This instance variable was printed as the total cost of the bill at the end of the program. My code HIGHLIGHTED BELOW

//Entire code is in text file attached below.

//MY CODE HERE

       DecimalFormat df = new DecimalFormat("0.00");

       oranges.setPrice(10, 2.99);

       oranges.setNumberBought(2*12);

       eggs.setPrice(12, 1.69);

       eggs.setNumberBought(2*12);

       apples.setPrice(3, 1);

       apples.setNumberBought(20);

       watermelons.setPrice(1, 4.39);

       watermelons.setNumberBought(2);

       bagels.setPrice(6, 3.50);

       bagels.setNumberBought(12);

       totalCost = oranges.getTotalCost() + eggs.getTotalCost() + apples.getTotalCost() + watermelons.getTotalCost() + bagels.getTotalCost();

       System.out.println("Total Cost: $" + df.format(totalCost));

   }

}

Write A Program That Uses The Purchase Class In 5.13. Set The Prices To The Following: Oranges: 10 For

Related Questions

Why data mining is crucial for the success of a business, explain with examples

Answers

Answer:

For businesses, data mining is used to discover patterns and relationships in the data in order to help make better business decisions. Data mining can help spot sales trends, develop smarter marketing campaigns, and accurately predict customer loyalty.

which of the following is an example of bias in media?
A. a website that represents a controversial opinion as though it were fact
B. a television news program that presents both sides of a particular issue
C. a podcast expressing an authors opinion
D. a blog about the history of the civil war

Answers

Answer is A because stating a opinion as a fact is bias.

a website that represents a controversial opinion as though it were fact because stating a opinion as a fact is bias.

What is Website?

A website is a group of interconnected, publicly accessible Web pages with a common domain name. A website can be developed and maintained to serve a variety of objectives by an individual, group, company, or organization.

The World Wide Web is made up of all websites that are open to the public.

Although it is occasionally referred to as a "web page," this description is incorrect because a website is made up of multiple webpages. A "web presence" or simply "site" are other names for websites.

Therefore, A website that represents a controversial opinion as though it were fact because stating a opinion as a fact is bias.

To learn more about Website , refer to the link:

https://brainly.com/question/29777063

#SPJ2

how do you think the blitz might have affected civilian morale in london

Answers

Answer:

It would have seriously negatively affected civilian morale in London. Hearing about the horrors of the war even from far away does a number on morale. This, however, was not exactly the case for London in WWII, because even as air raids were executed on the city, the citizens, confined to underground bomb shelters, still managed to pull together and keep morale high, causing London NOT to plunge into chaos, but to stand united against Germany.

⚠️⚠️⚠️⚠️HELP - What is the software that allocates resources of a physical computer to a virtual machine?
Group of answer choices

Switch

Operating systems

Hypervisor

HostVM

Answers

Answer:

the answer is going to be hostvm

5) Write a program to read text to end-of-file, and print a count of word lengths, i.e. the total number of words of length 1 which occurred, the number of length 2, and so on. Define a word to be a sequence of alphabetic characters. You should allow for word lengths up to 25 letters. A typical output should be like this: length 1 : 10 occurrences length 2 : 19 occurrences length 3 : 127 occurrences length 4 : 0 occurrences length 5 : 18 occurrences

Answers

Answer:

Explanation:

The following code is written in Python. It is a function that takes in the name of the file to be read and the size of the word. Then the function reads the file, removes whitespace and commas, splits the text into words, and scans the words for all the words that have the same length as the number passed. It counts all those words and prints out the number of occurrences of words of that length.

def countOccurrences(file_name, word_size):

   f = open(file_name, 'r')

   text = f.read()

   text = text.replace(',', '')

   split_text = text.split(' ')

   occurrences = 0

   for word in split_text:

       if len(word) == word_size:

           occurrences += 1

   print("Length 1: " + str(occurrences) + " occurrences")

What information will you find in the 16-bit field in an IP datagram?

Answers

Answer: This 16-bit field defines the entire packet size in bytes, including header and data. The minimum size is 20 bytes (header without data) and the maximum is 65,535 bytes. All hosts are required to be able to reassemble datagrams of size up to 576 bytes, but most modern hosts handle much larger packets.

Explanation: Hopefully this helps you with what ever u are doing.

An information which you will find in the 16-bit field in an IP datagram is: the total length of the datagram it's attached to.

An IP address is an abbreviation of internet protocol address and it can be defined as a unique number assigned to a computer or other network devices such as routers, switches, etc., in order to differentiate each device from one another in an active network system. Thus, an IP address is typically used to uniquely identify each computer or network device connected to the internet or an interconnected network.

In Computer networking, IP address are classified into two (2) main categories and these are;

Local (internal) IP address.Global (external) IP address.

An IP datagram can be defined as the standard format of data that an internet protocol (IP) recognizes.

Generally, an IP datagram comprises two (2) main components and these include:

1. The header: it is used for sending messages on a computer to the protocol in the same layer of a destination (recipient) computer.

2. The data: this is a set of information that is transmitted from one computer to another over an interconnected network.

On a related note, an IP datagram contain three (3) fields which are typically used for the transmission of data;

Header length.IP version.Total length.

The Total length is a field that is used to specify the total length of an IP datagram and it is typically 16-bits in size.

In conclusion, an information which is found in the 16-bit field in an IP datagram is the total length of the datagram it's attached to.

Find more information here: https://brainly.com/question/19204809

Order the steps for creating and assigning a new task in Outlook 2016.
Choose a task list, and
Open the Task view.
Click Assign Task, and
Complete the task
Click Send.
click New Task
specify the assignee.
information
Intro
Done

Answers

Answer:

Open the task viewChoose a task list and click new taskcomplete the task information click assign task and specify the assigneeclick send

Explanation:

Got it right on edge

Evaluate the following information that shows the projected change in employment from 2014-2024: How can job seekers use the chart? Add data to a résumé and cover letter Gain awareness of how growth trends can impact career plans Research which careers match current skills Talk to community members in a knowledgeable manner You must check the box below prior to submitting your exam! Check this box to indicate you are ready to submit your exam Submit Exam FDK191.10

Answers

Answer:

Answer is B.

Gain awareness of how growth trends can impact career plans

Explanation:

Return the appropriate part of FizzBuzz This is a small part of a classic software engineering interview question. fizz_buzz_check takes a single integer argument, number. Complete the function such that it returns a value using the following rules: If the number is divisible by 3 (i.e division by 3 has a remainder of 0), return the string Fizz. If it is divisible by five, return the string Buzz. If it is divisible by 3 AND 5, return FizzBuzz. Otherwise, just return the original argument back without any changes.

Answers

Answer:

The function in Python:

def fizz_buzz_check(num):

   if num%3 == 0:

       result = "Fizz"

   if num%5 == 0:

       result = "Buzz"

   if num%3 == 0 and num%5 == 0:

       result = "FizzBuzz"

   if num%3 != 0 and num%5 != 0:

       result = num

   return result

Explanation:

The function to complete is not given. So, I write a new function from scratch.

This defines the function

def fizz_buzz_check(num):

This checks if num is divisible by 3

   if num%3 == 0:

If yes, the returned value is stored as "Fizz"

       result = "Fizz"

This checks if num is divisible by 5

   if num%5 == 0:

If yes, the returned value is stored as "Buzz"

       result = "Buzz"

This checks if num is divisible by 3 and 5

   if num%3 == 0 and num%5 == 0:

If yes, the returned value is stored as "FizzBuzz"

       result = "FizzBuzz"

This checks if num is not divisible by 3 and by 5

   if num%3 != 0 and num%5 != 0:

If yes, the returned value is stored as the initial argument

       result = num

This returns the appropriate value

   return result

-- of 5 points Question 3 1 try left While designing a new system, a company uncovered several processes that were quite rule-based, and that didn't really require staff to handle. The company chose to automate those processes using ___________________________ so they would no longer need to assign people to perform those tasks. A. code review B. robotic process automation C. application programming interfaces D. service-oriented architecture

Answers

Answer:

B. robotic process automation.

Explanation:

In the design of a new system, a company was able to uncover several processes that were typically rule-based, and which did not really require staff to control or handle.

Hence, the company chose to automate those processes using robotic process automation so they would no longer need to assign people to perform those tasks.

what is information richness

Answers

Information Richness is the ability of information to change understanding within a time interval.

Hope it helps. Have a great day.

Brainliest would be greatly appreciated.

___________________________________________________________

#SaveTheEarth

#SpreadTheLove

- Mitsu JK

CodeHS 6.3.8: Area of a Square with Default Parameters

Write a program that will calculate and print the area of a square where its side length is given by the user.

To compute the area, write a function named calculate_area that takes a single parameter, side_length. The parameter should be given a default value of 10.

If the user enters a length value of 0 or less, call calculate_area and use the default value. Otherwise, use the length value given as the parameter value.

For example, if the following input is given:

Enter side length: 0

The following output should be printed:

The area of a square with sides of length 10 is 100.​

Answers

The programming language is not stated. I will answer this question using Python.

The program in Python where comments are used to explain each line is as follows:

#This defines the function

def calculate_area(side_length):

#This check if the side length is 0 or less

   if side_length<1:

#If yes, the side length is set to 10

       side_length = 10

#This prints the area of the square

   print("The area of a square with sides of length",side_length,"is",(side_length**2))

#The main begins here

#This gets input for the length of the square

length = int(input("Enter side length: "))

#This calls the calculate_area function

calculate_area(length)

#The program ends here

At the end of the program, the area of the square is calculated and printed.

See attachment for a sample run

Read more about Python programs at:

https://brainly.com/question/22841107

What are some examples and non-examples of digital law?

Answers

Examples: Plagiarism. Illegal downloads - music, games, movies etc. Piracy. Stealing someone's identity.

Non-Examples: Sending Scams, Copyright Infringement, Sexting

Digital computers use a........ system to encode date and programs.

Answers

Answer:

Digital computers use a binary system to encode date and programs.

The process of using the new

information system and doing away

with the old system is known as

system ___.​

Answers

Answer:

The process of using the new

information system and doing away

with the old system is known as

system development


3. Java is Platform Independent. This means;
A. Java can run on any OS
need an OS to run
C. Java requires more than one OS to run
portable
D. Java is not
B. Java does

Answers

A . I hope this is right

Answer:

Java can run on any OS

need an OS to run

PLZZ HELP!!!
Select the correct answer.
Brian’s team has built a new application based on the client’s requirements. They will deploy this application in multiple locations on the client side. Brian is unsure about the hardware and software specifications at the client side. Which option will help him best solve this issue?
A.
creating multiple test scripts
B.
automating test scripts
C.
creating multiple test plans
D.
creating multiple test environments
E.
communicating with the development team

Answers

Answer: Option D creating muiltiple test enviroments

Explanation: I had the same question and I hope this helps ( :

The option that will help Brain best solve this issue is by creating multiple test environments.

What is the specification of software?

A software requirements specification (SRS) is known to be a type of requirement that are often written in a document that tells more about what the software can do.

Hence in the above scenario, what will help help Brain best solve this issue is by creating multiple test environments where the client can see a demonstration and be convince in getting the product.

Learn more about application from

https://brainly.com/question/24847617

HELP! WILL GIVE BRANLIESt!

Answers

Answer:

36:12, 36/12, 3/1

Explanation:

I’ve never solved a problem like this but mathematically this answer makes sense

3. Comparing the Utopian and dystopian views of Technology according to Street (1992) which one in your view is more applicable to your society?

Answers

Answer:

The answer is below

Explanation:

The Utopian views of technology, according to Street 1992, describe society to be in good condition in terms of politics, laws, customs, ways of life. Hence, the system is designed to improve the community for the better.

In contrast, Dystopian is described as a society that is heavily controlled by some greedy, larger than life, apocalypse group of people or government, where the rights and freedoms of people are trampled upon, thereby leading to all sorts of negativity such as suffering, poverty, intimidation, violence, disease, and break down.

The view that is more applicable to my society is the Utopia due to the following reason:

1. The people in my society accept the laid down rules and ideals. We also favor individuality and innovation.

2. My society is quite dynamic and improves over time to establish an ideal utopian world.

3. My society ensures some leaders carry the other individuals in the society along in whatever they do.

Label the following website navigation methods
according to their importance, where 1 is most
important and 3 is least important.

Site map:
Navigation menu:
Site search:

Answers

Answer:

Technology is very important

Answer:

Site map: 3

Navigation menu:1

Site search:2

Explanation:

Q3: State whether each of the following is true or false. If false, explain why. 1. A generic method cannot have the same method name as a nongeneric method. 2. All generic method declarations have a type-parameter section that immediately precedesthe method name. 3. A generic method can be overloaded by another generic method with the same methodname but different method parameters. 4. A type parameter can be declared only once in the type-parameter section but can appearmore than once in the method’s parameter list. 5. Type-parameter names among different generic methods must be unique. 6. The scope of a generic class’s type parameter is the entire class except its staticmembers.

Answers

Answer:

3

Explanation:

When using for loops and two-dimensional arrays, the outside loop moves across the ___________ and the inside loop moves across the ___________.

indexes, elements

columns, rows

elements, indexes

rows, columns

Answers

Answer: rows, columns

Explanation: :)

6.20 LAB: Acronyms An acronym is a word formed from the initial letters of words in a set phrase. Write a program whose input is a phrase and whose output is an acronym of the input. If a word begins with a lower case letter, don't include that letter in the acronym. Assume there will be at least one upper case letter in the input. Ex: If the input is: Institute of Electrical and Electronics Engineers the output should be: IEEE

Answers

Answer:

Explanation:

The following code is written in Python. It creates a function that takes in a phrase as an argument. Then it splits the phrase into a list of words. Next, it loops through the list and adds the first letter of each word into the acronym variable if it is a capital letter. Finally, returning the acronym variable. Output can be seen in the attached picture below.

def accronymGenerator(phrase):

   phrase_split = phrase.split(' ')

   acronym = ""

   for x in phrase_split:

       if x[0].isupper() == True:

           acronym += x[0]

       else:

           pass

   return acronym

Which one of the following is NOT a use of a database? sales statement patient list customer list inventory list

Answers

Answer:

a sales statement

Explanation:

From the different options provided, the only one that is not a use of a database would be a sales statement. These statements usually made at the end of the month or year which detail the companies' entire sales amount for that given time period. These hold alot of information but are mainly created once every cycle so there is never a need to use a database for such files. Also, these statements are rarely modified or requested so database usage would be wasted.

PLZZZ HELP!!!!!!!
Select the correct answer.
Which of these examples best describes unit testing?
A.
The tester finds incorrect functionality on the home page.
B.
The login page does not accept existing user credentials.
C.
There is no database connectivity.
D.
The developer checks the loops in the procedure.
E.
Multiple users slow down the speed of the system.

Answers

Answer: A is the correct choice.

The option that is an example that describes unit testing is the developer checks the loops in the procedure.

What is unit testing?

This type of test is known to be called unit component. It is regarded as a form of a single function or code of any kind of application.

Conclusively, A good example that tells more about unit testing is the when a developer monitors the loops in the procedure so as to see if there is any error or omissions.

Learn more about unit testing  from

https://brainly.com/question/24964187

Need help ASAP??? Pick the best answers

Answers

Answer:

A and C are correct pick both

to be useful for most household applications, DC voltage is?please

Answers

Answer: To be useful for most household applications, DC voltage is passed through a step-down transformer.

Explanation: Voltage coming through AC or DC outlets is typically far too high for most household appliances to handle, so the current is passed through a step-down transformer to reduce the voltage to a usable level.

All of the following are problem-solving steps except:
A. taking action.
B. defining the problem.
c. doing the first solution that comes to mind.
D. creating possible solutions.

Answers

Answer:

C. Doing the first solution that comes to mind.

Explanation:

Lets break this down a bit.

A is a great problem solving step, so we can mark that off.

We can do the same for B.

However, for C, I am hesitant about this one, so I wont mark it off quite yet.

Finally, for D, it is definitely a step, so I can mark that off.

You should never do the first solution that comes to mind, since you haven't done enough brainstorming about other ideas.

Hope this helps!

red + blue =
Red + green =
Magenta - blue =
Yellow - green =
Cyan - blue =​

Answers

Answer:

red + blue is green

red + green is blue

All changes
1.(01.01 LC)
To make sure you do not get too tired when using the computer for long periods of time, how often should you get up to stretch and move? (5 points)
O Every hour
O Every 10 minutes
O Every 30 minutes
O Every two hours

Answers

You should get up and move every 30 minutes

Hope  this helps

-scav

Answer:

C

Explanation:

Other Questions
Why is it important for people to have the opportunity to define their own cultural identity as opposed to allowing themselves to be labeled by others as belonging to one group or another? Can anybody tell me what the mood of this poem and whywhat is the Literal meaning and the figurative meaning of the poem and explain If mutated DNA sequence #1 occurred in a single reproductive cell of a fish that was later fertilized to become an offspring, how might it impact the organism True or False. Gandhi fought against the caste system and renamed the untouchables Suppose quadrilateral ABCD is a square and the slope of BC is -n. What is the slope of AB? What is 6 over 10 plus 13 over 100 Name the lines of latitude that are labeled north of the equator. What would be the next label after 75 *N? Once an action plan is in place, it should not be changed. Please select the best answer from the choices provided. T F how do you solve 5(-2x -3 For which value of is the following number undefinedx - 3 / x + 4 Complete the sentence describing an element in story boarding.The _________acts as the base for a storyboard. ________ artists design the storyboard according to the screenplayChoices for first Blank Space: Screen play, Camera angles, StoryChoices for Second Blank Space: Designing, Junior, Storyboard (3x^2-2x+5)-(x^2+3x-2)1/2x^2In standard form? What is the main difference between active transport and passive transport? (A) During active transport the water inside the cell is used to transport substances throughout the cell. Passive transport uses the cell's cytoplasm to move substances around the cell. (B) Passive transport moves substances throughout the cell without using the cell's energy and active transport moves substances using the cell's energy. (C) Active transport moves substances from higher concentrations to lower concentrations and passive transport moves substances from lower concentrations to higher concentrations. (D) Passive transport moves substances that are too large to get through the cell membrane by forming a vesicle inside the cell and active transport forms the vesicle on the outside of the cell. A catalyst is:one answer only pls help lol PLZ HELP!QUESTIONS ARE BELOW!NO FILES OR LINKS! :D Plz help me with this Find the equation of the line (Use exact numbers) Y=___x+___Please help what is the missing blank? please help!!!Can you use Pythagorean Theorem to find the missing side of this triangle? Why or why not?Answer and Explain, please. Subtract.56 2/318 5/7Enter your answer as a mixed number in simplest formplzplzplzplzplzpplzplzplzplzplzplzpzlpzlpzlplzheeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll[ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee