Answer:
The algorithm is as follows:
1. Start
2. Get the number of items (n)
3. Get the current price of the n items (a1, a2..... an)
4. Get the possible hiked price of the n items (b1, b2..... bn)
5. Calculate the difference between the current and hiked prices for each item i.e. \(d_i = b_i - a_i\)
6. Sort the differences in descending order (i.e. from the greatest to the least)
7. Buy items in this order of difference
8. Stop
Explanation:
The algorithm is self-explanatory; however, what it does is that:
It takes a list of the current price of items (say list a)
E.g: \(a = [100, 150, 160]\)
Then take a list of the hiked price of the items (say list b)
E.g: \(b = [110, 180, 165]\)
Next, it calculates the difference (d) between corresponding prices \(d_i = b_i - a_i\)
\(d = [(110 - 100),(180-150),(165-160)]\)
\(d = [10,30,5]\)
Sort the difference from greatest to lowest (as the difference is sorted, lists a and b are also sorted)
\(d = [30,10,5]\)
\(a = [150, 100, 160]\)
\(b = [180, 110, 165]\)
If there is no hike up to item k, the couple would have saved (i = 1 to d[k-1])
Assume k = 3
The couple would have saved for 2 item
\(Savings = d[1] + d[2]\)
\(Savings = 30 +10\)
\(Savings = 40\)
The saved amount will then be added to the kth item in list a i.e. a[k](in this case k = 3) in order to buy b[k]
Using the assumed value of k
\(a[k] = a[3]\)
\(a[3] = 160\)
\(b[3] = 165\)
Add the saved amount (40) to a[3]
\(New\ Amount = 40 + 160\)
\(New\ Amount = 200\)
This new amount can then be used to buy b[3] i.e. 165, then they save the change for subsequent items
PlZZZZZZZ help will give Brainliest
What is referred to as “the way a slide goes off the screen and a new one comes on”
Answer:
Phone
Explanation:
6. In terms of a career, the word benefits refers to how much vacation and salary bonuses a person gets. True False
It is false that in terms of a career, the word benefits refers to how much vacation and salary bonuses a person gets.
The term "benefits" in the context of a profession comprises a wider range of offerings supplied by a company to an employee, even if vacation and pay bonuses might be included in the benefits package.
Benefits frequently involve additional remuneration and benefits in addition to vacation time and salary increases.
Health insurance, retirement plans, paid time off, flexible work schedules, tuition reimbursement, employee assistance programmes, wellness programmes, and other benefits are a few examples of these.
The benefits package is intended to draw in new hires, keep them on board, improve job satisfaction, and support workers' health and work-life balance. Therefore, vacation time and incentive pay are just a portion of the total benefits that an employer provides.
Thus, the given statement is false.
For more details regarding career, visit:
https://brainly.com/question/8825832
#SPJ1
write c++ program to find maximum number for three variables using statement ?
please help me..
Answer:
int a, b, c;
cin >> a >> b >> c;
max = (a>b) ?
(a > c ? a : c) :
(b > c ? b : c);
cout << max;
what percent of records are temporary, if you are not in the OSD?
Answer:
Headed by the OSD Records Administrator, the OSD Records and Information Management (RIM) Program is responsible for oversight, implementation of the Federal Records Act within the Offices of the Secretary of Defense and the WHS supported Defense Agencies and Field Activities.
Explanation:
give one major environmental and
one energy problem kenya faces as far as computer installations are concerned?
One considerable predicament that Kenya encounters pertaining to the utilization of computers is managing electronic waste (e-waste).
Why is this a problem?The mounting number of electronic devices and machines emphasizes upon responsibly discarding outdated or defective hardware in order to avoid environmental degradation.
E-waste harbors hazardous materials such as lead, mercury, and cadmium which can pollute soil and water resources, thereby risking human health and ecosystem sustainability.
Consequently, a significant energy drawback with computer use within Kenya pertains to the insufficiency or instability of electrical power supply.
Read more about computer installations here:
https://brainly.com/question/11430725
#SPJ1
A dual-core processor is like having two processors in one.
-True
-False
Answer:
True
Explanation:
hence the word dual meaning two.
give the synyax and example of any three mathematical functions in spreadsheet
Answer:
The answer to this question is given below in the explanation section
Explanation:
There are different mathematical functions that can be used in the spreadsheet for performing some required calculations on data such as taking the average of numbers, adding numbers, multiplying the numbers.
But most commonly used three mathematical functions in the spreadsheet is given below:
1. AVERAGE(): The average function is used to find the average of a given number of cells.
Syntax of Average() function: average(number1, number2,.....).
2. SUM(): The sum function is used to add all the values within a range of cells.
Syntax: of sum() function: sum(cell address1: cell address2)
3.COUNT(): Count () function is used to count the number of data.
Syntax of Count() function: count(cell address1: cell address2)
what is the fnajofnjanfaofoafnka
Answer: that is the letter f,n,a,j,o,f,n,j,an,f,a,o,f,n,k,a
Which are ether random letters or….. it’s a word scramble.
I well now organize the letters.
1F 2F 3F 4F
1N 2N 3N 4N
1A 2A 3A 4A
1J 2J
1O 2O
1K
Words that can be written are
Fan four times there are other things such as names it can write such as Joan Jon or it could be abbreviations but I believe It’s just random letters you wrote to confuse the brainly community trust me you confused me lol.
Explanation:
Which of the following activities have been made possible because of improvements in computer networks? Check all of the boxes that apply.
using a computer keyboard
organizing the storage of data
calling on a telephone
accessing the Internet at the same time as other users
CORRECT: B and D, just took test
Note that activities B and D have been made possible because of improvements in computer networks.
What are computer networks?
A computer network is a collection of computers that share resources that are located on or provided by network nodes. To interact with one another, computers employ standard communication protocols across digital links.
In computer networking, nodes and connections are the fundamental building components. A network node can be either data communication equipment (DCE) like a modem, hub, or switch or data terminal equipment (DTE) like two or more computers and printers.
A link is the transmission medium that connects two nodes. Physical links, such as cable lines or optical fibers, or open space utilized by wireless networks, are examples of links.
Learn more about computer networks at:
https://brainly.com/question/9777834
#SPJ1
cs academy unit 8.3.2 Shirt Design
In order to fix the code and make it work, you can try the following corrections:
How to explain the program# Import the necessary libraries here
# Set the background color
app.background = 'pink'
# Draw the shirt
Polygon(5, 175, 85, 60, 315, 60, 395, 175, 330, 235, 290, 190, 300, 355, 100, 355, 110, 190, 70, 237, fill='lavenderBlush')
Arc(200, 60, 95, 70, 90, 180, opacity=10)
# Use a loop to draw stars
for radius in range(10, 100, 5):
# Draw a crimson star whenever the radius is a multiple of 10 and a white star otherwise
if radius % 10 == 0:
Star(200, 210, radius, 6, fill='red')
else:
Star(200, 210, radius, 6, fill='white')
# Display the graphic
# Add code here to show or update the graphic window
Learn more about program on
https://brainly.com/question/26642771
#SPJ1
Given parameters b and h which stand for the base and the height of an isosceles triangle (i.e., a triangle that has two equal sides), write a C program that calculates: The area of the triangle; The perimeter of the triangle; And The volume of the cone formed by spinning the triangle around the line h The program must prompt the user to enter b and h (both of type double) The program must define and use the following three functions: Calc Area (base, height) //calculates and returns the area of the triangle Calc Perimeter (base, height) //calculates and returns the perimeter Calc Volume(base, height) //calculates and returns the volume
Answer:
The area of the triangle is calculated as thus:
\(Area = 0.5 * b * h\)
To calculate the perimeter of the triangle, the measurement of the slant height has to be derived;
Let s represent the slant height;
Dividing the triangle into 2 gives a right angled triangle;
The slant height, s is calculated using Pythagoras theorem as thus
\(s = \sqrt{b^2 + h^2}\)
The perimeter of the triangle is then calculated as thus;
\(Perimeter = s + s + b\)
\(Perimeter = \sqrt{b^2 + h^2} + \sqrt{b^2 + h^2} +b\)
\(Perimeter = 2\sqrt{b^2 + h^2} + b\)
For the volume of the cone,
when the triangle is spin, the base of the triangle forms the diameter of the cone;
\(Volume = \frac{1}{3} \pi * r^2 * h\)
Where \(r = \frac{1}{2} * diameter\)
So, \(r = \frac{1}{2}b\)
So, \(Volume = \frac{1}{3} \pi * (\frac{b}{2})^2 * h\)
Base on the above illustrations, the program is as follows;
#include<iostream>
#include<cmath>
using namespace std;
void CalcArea(double b, double h)
{
//Calculate Area
double Area = 0.5 * b * h;
//Print Area
cout<<"Area = "<<Area<<endl;
}
void CalcPerimeter(double b, double h)
{
//Calculate Perimeter
double Perimeter = 2 * sqrt(pow(h,2)+pow((0.5 * b),2)) + b;
//Print Perimeter
cout<<"Perimeter = "<<Perimeter<<endl;
}
void CalcVolume(double b, double h)
{
//Calculate Volume
double Volume = (1.0/3.0) * (22.0/7.0) * pow((0.5 * b),2) * h;
//Print Volume
cout<<"Volume = "<<Volume<<endl;
}
int main()
{
double b, h;
//Prompt User for input
cout<<"Base: ";
cin>>b;
cout<<"Height: ";
cin>>h;
//Call CalcVolume function
CalcVolume(b,h);
//Call CalcArea function
CalcArea(b,h);
//Call CalcPerimeter function
CalcPerimeter(b,h);
return 0;
}
Numerous engineering and scientific applications require finding solutions to a set of equations. Ex: 8x + 7y = 38 and 3x - 5y = -1 have a solution x = 3, y = 2. Given integer coefficients of two linear equations with variables x and y, use brute force to find an integer solution for x and y in the range -10 to 10.
Ex: If the input is:
8
7
38
3
-5
-1
Then the output is:
x = 3 , y = 2
Use this brute force approach:
For every value of x from -10 to 10
For every value of y from -10 to 10
Check if the current x and y satisfy both equations. If so, output the solution, and finish.
Ex: If no solution is found, output:
There is no solution
Assume the two input equations have no more than one solution.
Note: Elegant mathematical techniques exist to solve such linear equations. However, for other kinds of equations or situations, brute force can be handy.
The brute strength method determines if each x and y value satisfies both conditions. To do this, we must iterate through each result in the specified range and insert them into both models.
What are Elegant mathematical technique?ALGORITHM :
1. Take the values of all coefficients and SET flag = FALSE
2. Run a FOR loop for x in range (-10, 11). 11 won't be included.
2a. Inside the first FOR, start the y FOR loop in range(-10,11). 11 won't be included
2b. Inside the y FOR loop, check IF for a particular value of x and y both the equations satisfied.
2c. If yes, set flag TRUE and print values of x and y.
2d. ELSE the flag stays FALSE.
END FOR Y
END FOR X
3. Check if flag = FALSE, then print NO SOLUTION
PYTHON CODE :
a=int(input()) #taking input for each coefficient
b=int(input())
c= int(input())
a1= int(input())
b1= int(input())
c1= int(input())
flag = False
for x in range(-10,11): #checking for all values of x in range -10 to 10
for y in range(-10,11): #checking for all values of x in range -10 to 10
if (a x + b y – c == 0) and (a1*x + b1*y - c1 == 0) : #checking if the x and y values satisfy the equation
flag = True #setting the flag if solution is found
print('Solution : x = {-10, 10}, y = {-10, 10}'.format(x,y)) #if they satisfy print x & y
if flag = False : #if flag stays false, that means there is no solution
print('No solution')
OUTPUT : The output is given below.
More about the Elegant mathematical technique link is given below.
https://brainly.com/question/27934739
#SPJ1
the differencebetween browser and search engine
please my assignment have50 mark
Answer:
A browser is a piece of software that retrieves and displays web pages; a search engine is a website that helps people find web pages from other websites.
which wireless technology does the fire alarm system use?
Wireless fire alarm systems get the signal from detectors to the control panel, which is transmitted by radio frequency. The heat detectors have thermistors that sense the heat in order for the alarm to go off. I hope this helps you out!
What are the core steps to add revisions or features to a project?(1 point)
Responses
Evaluate feasibility of the goals, create a list of functionality requirements, and develop the requirements of the feature.
Evaluate feasibility of the goals, develop programming solutions, and evaluate how well the solutions address the goals.
understand the goals, evaluate the impact on the project, create a list of functionality requirements, and develop the requirements of the feature.
Communicate with the client, create a sprint backlog, develop the project, and evaluate how well the solution fits the requirements.
The core steps to add revisions or features to a project are ""Understand the goals, evaluate the impact on the project, create a list of functionality requirements, and develop the requirements of the feature." (Option C)
How is this so?
The core steps to add revisions or features to a project include understanding the goals,evaluating the impact on the project, creating a list of functionality requirements,and developing the requirements of the feature.
These steps ensure that the goals are clear, the impact is assessed, and the necessary functionality is identified and implemented effectively.
Learn more about project management at:
https://brainly.com/question/16927451
#SPJ1
A ______ can hold a sequence of characters such as a name.
A string can hold a sequence of characters, such as a name.
What is a string?A string is frequently implemented as an array data structure of bytes (or words) that records a sequence of elements, typically characters, using some character encoding. A string is typically thought of as a data type. Data types that are character strings are the most popular.
Any string of letters, numerals, punctuation, and other recognized characters can be stored in them. Mailing addresses, names, and descriptions are examples of common character strings.
Therefore, a string is capable of storing a group of characters, such as a name.
To learn more about string, refer to the link:
https://brainly.com/question/17091706
#SPJ9
Use the drop-down menus to complete statements about how to use the database documenter
options for 2: Home crate external data database tools
options for 3: reports analyze relationships documentation
options for 5: end finish ok run
To use the database documenter, follow these steps -
2: Select "Database Tools" from the dropdown menu.3: Choose "Analyze" from the dropdown menu.5: Click on "OK" to run the documenter and generate the desired reports and documentation.How is this so?This is the suggested sequence of steps to use the database documenter based on the given options.
By selecting "Database Tools" (2), choosing "Analyze" (3), and clicking on "OK" (5), you can initiate the documenter and generate the desired reports and documentation. Following these steps will help you utilize the database documenter effectively and efficiently.
Learn more about database documenter at:
https://brainly.com/question/31450253
#SPJ1
Ali receives an email from a person posing as a bank agent, who asks Ali to share his bank account credentials. Which type of network attack does this scenario indicate?
The network attack in this scenario is . This attack can occur .
Phishing is the type of network attack which this scenario indicates. This type of attack can take place via electronic messages.
What is network attack?
Network attacks are illegal activities on digital assets within an organization's network. Malicious parties typically use network assaults to change, destroy, or steal private data. Network attackers typically target network perimeters in order to obtain access to interior systems. In a network attack, attackers aim to breach the business network perimeter and obtain access to internal systems. Once inside, attackers frequently combine different forms of assaults, such as compromising an endpoint, propagating malware, or exploiting a weakness in a system within the network.
To learn more about network attack
https://brainly.com/question/14980437
#SPJ13
host a and host b are on the same local network. host a sends a communication to host b. local address resolution is a five-step process, and some of the steps are listed below. select the fourth step that will occur as local address resolution takes place.
If Host B recognizes its own address, it responds to Host A by updating its cache with Host A's Media Access Control MAC address.
Which OSI reference model layers are host-to-host layers?Physical, OSI Model; The Transport, Session, Presentation, and Application layers are end-to-end or host-to-host layers, whereas the Datalink and Network layers are hop-to-hop layers.
What is TCP IP's host-to-host layer?Layer of Host-to-Host Transport. The host-to-host layer is the protocol layer just above the network layer. It is accountable for data integrity from beginning to end. The Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP) are the two most crucial protocols utilized at this layer.
To know more about MAC address visit :-
https://brainly.com/question/27960072
#SPJ4
A backup operator wants to perform a backup to enhance the RTO and RPO in a highly time- and storage-efficient way that has no impact on production systems. Which of the following backup types should the operator use?
A. Tape
B. Full
C. Image
D. Snapshot
In this scenario, the backup operator should consider using the option D-"Snapshot" backup type.
A snapshot backup captures the state and data of a system or storage device at a specific point in time, without interrupting or impacting the production systems.
Snapshots are highly time- and storage-efficient because they only store the changes made since the last snapshot, rather than creating a complete copy of all data.
This significantly reduces the amount of storage space required and minimizes the backup window.
Moreover, snapshots provide an enhanced Recovery Time Objective (RTO) and Recovery Point Objective (RPO) as they can be quickly restored to the exact point in time when the snapshot was taken.
This allows for efficient recovery in case of data loss or system failure, ensuring minimal downtime and data loss.
Therefore, to achieve a highly time- and storage-efficient backup solution with no impact on production systems, the backup operator should utilize the "Snapshot" backup type.
For more questions on Recovery Time Objective, click on:
https://brainly.com/question/31844116
#SPJ8
Create an ArrayList of Countries
- Create a class called Country.java.
- Instance variables include name (String), capital (String), and population (an int representing the population of the capital)
- Write a 3-arg constructor
- Write 3 accessor methods
- Write a toString method that returns the state/value of all instance variables.
- Test out your class:
- Step 1: Create an ArrayList of five countries.
- Step 2: Print out your ArrayList.
- Step 3: Remove one of the countries.
- Step 4: Print out your ArrayList again.
- Step 5: Create a new country and insert it in the middle of your ArrayList.
- Step 7: Print out your ArrayList again.
- Step 8: Change your last country to the country you removed in Step 3.
- Step 9: Print out your ArrayList again.
Answer:
Step 1: Create an ArrayList of five countries by creating Country objects and adding them to the ArrayList.
Step 2: Print out your ArrayList by looping through it and printing out each Country object's toString() method.
Step 3: Remove one of the countries from the ArrayList by using the remove() method and passing in the index of the object you wish to remove.
Step 4: Print out your ArrayList again by looping through it and printing out each Country object's toString() method.
Step 5: Create a new country and insert it in the middle of your ArrayList by creating a Country object and using the add() method with the index of the position in the ArrayList.
Step 6: Print out your ArrayList again by looping through it and printing out each Country object's toString() method.
Step 7: Change your last country to the country you removed in Step 3 by first removing the last country from the ArrayList, creating a new Country object using the same parameters as the one you removed earlier, then using the add() method with the index of the last position in the ArrayList.
Step 8: Print out your ArrayList again by looping through it and printing out each Country object's toString() method.
Print a message telling a user to press the letterToQuit key numPresses times to quit. End with newline. Ex: If letterToQuit = 'q' and numPresses = 2, print:
You can find in the photo. Good luck!
Which version of Microsoft Office is free?
Office Online
Office 2019
Office 365
G Suite
Answer:
Most likely D
Explanation:
I've been using their products for some time now and they do not charge money.
Answer:
The Office used to be free
Explanation:
Thats all i got-
Examples of ________, which is hosted on a web site, include e-mail, word processing, tax preparation, and game programs.
Answer:Web Application
Explanation:Web hosting is more or less like having an ordinary computer in the cloud in order share information and resources with others world wide.One cannot make effective use of a computer without software applications . Similarly hosting just normal html pages and documents on a server cannot help increase productivity,hence the creation of cloud computer applications also known as "Web Apps (Web Applications)" to aid boost productivity and information dissemination via quality task automations.
Consider the following language:
L={ |M is a Turing Machine and M accepts at least one palindrome,
and rejects at least one palindrome}
a. Is L a decidable language? Prove your answer.
b. Is L a recognizable language? Prove your answer.
L is a decidable language because the Turing machine accepts it.
L is a recognizable language if TM M recognizes it.
How do you know if a language is decidable?A language is said to be decidable only when there seems to exists a Turing machine that is said to accepts it,
Here, it tends to halts on all inputs, and then it answers "Yes" on words that is seen in the language and says "No" on words that are not found in the language. The same scenario applies to recognizable language.
So, L is a decidable language because the Turing machine accepts it.
L is a recognizable language if TM M recognizes it.
Learn more about programming language from
https://brainly.com/question/16936315
#SPJ1
1. A group of people connected by one or more common interests is called a:
The math club starts with 5 members. Five months later, their membership has grown to 50 members.
What was the average number of members who joined the math club per month?
Explanation:
10 members per month i think
Answer:
10 members per month
Explanation:
brainliest pls its right i think
have a good day :D
How do I fix my mistake in the code, do not give me a bs answer like “I don’t know sorry” if you do not know just move on because I will report it like I have before.
The problem lies within your if statement. You're using a single equals sign when you should be using two.
if (operation == 1)
Two equal signs is a comparison operator. It checks to see if one value equals another value. In your case, its checking if operation equals 1. But, this only solves half the problem. Operation is a string and you need to compare it to a string.
if (operation == "1")
I hope this helps!
Please help me this is so confusing????
Which role will grant a delegate read-only access to a particular workspace within a user’s Outlook mailbox?
Author
Editor
Contributor
Reviewer
The role that will grant a delegate read-only access to a particular workspace within a user's Outlook mailbox is the "Reviewer" role.
In Outlook, delegates are individuals who are granted permission to access and manage another user's mailbox on their behalf. When assigning delegate permissions, different roles can be assigned to control the level of access the delegate has.
The "Reviewer" role specifically provides read-only access to the specified workspace within the user's mailbox. Delegates with this role can view the content, including emails, calendar events, and other items, but they cannot make any changes or modifications.
On the other hand, the "Author" role grants read and write access, allowing delegates to create, modify, and delete items within the designated workspace. The "Editor" role also provides read and write access but includes additional privileges such as creating subfolders and managing permissions.
The "Contributor" role allows delegates to create items within the workspace, but they cannot view items created by others. It provides a limited level of access compared to the "Reviewer" role.
Therefore, if a delegate needs read-only access to a particular workspace within a user's Outlook mailbox, the "Reviewer" role should be assigned.
For more questions on Reviewer, click on:
https://brainly.com/question/30517194
#SPJ8