Answer:
item = "quesadilla"
meat = "steak"
queso = False
guacamole = False
double_meat = False
base_price = 4.5
if item == "quesadilla":
base_price = 4.0
elif item == "burrito":
base_price = 5.0
if meat == "steak" or meat == "pork":
base_price += 0.50
if meat == "steak" and double_meat:
base_price += 1.50
elif meat == "pork" and double_meat:
base_price += 1.50
elif double_meat:
base_price += 1.0
if guacamole:
base_price += 1.0
if queso and item != "nachos":
base_price += 1.0
print(base_price)
Explanation:
- Use a conditional statement to check if meat is steak or pork then add 0.50 to base_price
.
- Check if the meat is steak or pork, then double_meat adds 1.50 or 1.0 otherwise
.
-
Check if meat is steak and its double_meat
, then add 1.50 and if its for guacamole, then add 1.00 to base_price
. If queso is there and item is not nachos, add 1.00 to base_price
.
- Finally when item is nachos, no need to add any money to base_price
.
Answer:
b. selection sort
b. 8 11 17 30 20 25
Explanation:
The options above are the correct answers to the given questions.
Selection sort is a simple comparison-based sorting algorithm.
selection sort. (algorithm) Definition: A sort algorithm that repeatedly searches remaining items to find the least one and moves it to its final location. The run time is Θ(n²), where n is the number of elements. The number of swaps is O(n).
It is this sorting algorithm that will best ne suitable in the given event.
Answer:
Explanation:
<u>Ways to Avoid Scope Creep</u>
Scope creep is what happens when changes are made to the scope of a project without any control. Changes happen to projects all the time without been notify ontime as a project manager. It is that very rare project that ends up delivering exactly what was asked for on the first day. However, without there being some control over the changes, a project manager has little chance of keeping on top of the work and managing the project effectively.
Generally, scope creep is when new requirements are added after the project has commence. These changes are not properly reviewed. The project team is expected to deliver them with the same resources and in the same time as the original scope.
On the other hand, as a project manager you could end up with a project with lots of approved, considered changes, that never ends because every time you think you have finished a new requirement arrives in your inbox and you have to make more changes.
The following are five ways to keep control of your project.
<em>1-Document the Requirements</em>
<em>2-Set up Change Control Processes</em>
<em>3-Create a Clear Project Schedule</em>
<em>4-Verify the Scope with the Stakeholders</em>
<em>5-Engage the Project Team</em>
A function that returns Pascal's Triangle with n rows:
//import necessary headers
public class Pascal_Triangle {
// calculate factorial
static int factorial(int n)
{
int fact = 1;
int i;
for(i=1; i<n; i++)
{
fact*=i;
}
return i;
}
// Actual code to display the //pascal triangle
static void display(int n)
{
int i;
int line;
for(line=1;line<=n;line++)
{
for(i=0;i<=line;i++)
{
System.out.print((factorial(line)/factorial(line-i) * factorial(i)) + " ");
}
System.out.println();
}
}
// To read user input
public static void main(String[] args){
BufferedReader breader=new BufferedReader(new InputStreamReader(System.in));
int n;
System.out.println("Enter the size for creating Pascal triangle");
try {
n = Integer.parseInt(breader.readLine());
}
catch(Exception e){
System.out.println("Please enter a valid Input");
return;
}
System.out.println("The Pascal's Triangle is");
display(n);
}
}
Hello. I have a solution with comments to help you understand the code.
Brainly is bad for formatting code. Teachers often search up submitted answers using services such as search engine. Your answer has been encoded to protect you from plagiarism detection. It is very easy to view the answer for yourself.
Please go to website https://base64.io
Then copy the below text and paste it into the decode textbox in the website. Make sure you remove the part that says, "Read more on Brainly.com...". Thank you.
<em>--- COPY EVERYTHING BELOW AND PASTE INTO SITE, REMOVE THE PART THAT SAYS, "Read more on Brainly.com..." ---</em>
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwoKcHVibGljIGNsYXNzIE15Q2xhc3MgewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nIGFyZ3NbXSkgewogICAgICAgIC8vIENyZWF0ZSBTY2FubmVyIG9iamVjdCB0byByZWFkIHVzZXIgaW5wdXQKICAgICAgICBTY2FubmVyIHByaWNlc2Nhbm5lciA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CiAgICAKICAgICAgICAvLyBQcmludCB0byBhc2sgdXNlciB0byB0eXBlIGluIHByaWNlCiAgICAgICAgU3lzdGVtLm91dC5wcmludCgiRW50ZXIgcHJpY2UgaW4gY2VudHMgKDI1Yy0xMDBjLCA1LWNlbnQgaW5jcmVtZW50cyk6ICIpOwogICAgCiAgICAgICAgLy8gV2FpdHMgZm9yIHVzZXIgaW5wdXQgdGhlbiBwdXRzIGlucHV0IGluc2lkZSBwcmljZQogICAgICAgIGludCBwcmljZSA9IHByaWNlc2Nhbm5lci5uZXh0SW50KCk7CiAgICAKICAgICAgICAvLyBJbnB1dCB2YWxpZGF0aW9uOiBDaGVjayBpZiBwcmljZSBpcyA+PSAyNSBhbmQgPD0gMTAwCiAgICAgICAgLy8gQWxzbyBjaGVjayBpZiBwcmljZSBpcyBhIG11bHRpcGxlIG9mIDUsIHRvIGRvIHRoaXMKICAgICAgICAvLyBpdCBzaG91bGQgaGF2ZSByZW1haW5kZXIgb2YgMCB3aGVuIGRpdmlkZWQgYnkgNS4gCiAgICAgICAgLy8gVGhlIG1vZHVsbyBvcGVyYXRvciAlIGNhbGN1bGF0ZXMgcmVtYWluZGVycy4KICAgICAgICBpZiAocHJpY2UgPj0gMjUgJiYgcHJpY2UgPD0gMTAwICYmIHByaWNlICUgNSA9PSAwKSB7CiAgICAgICAgCiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiQnV5aW5nIGF0ICIgKyBwcmljZSArICIgY2VudHMsIGFuZCBwYXlpbmcgd2l0aCBvbmUgZG9sbGFyIik7CiAgICAgICAgCiAgICAgICAgICAgIGludCBxdWFydGVycyA9IDAsIGRpbWVzID0gMCwgbmlja2VscyA9IDA7CiAgICAgIAogICAgICAgICAgICAvLyBMb29wIGRpdmlkZSB1bnRpbCBubyBtb3JlIHF1YXJ0ZXJzIGFibGUgdG8gYmUgZGl2aWRlZAogICAgICAgICAgICB3aGlsZSAocHJpY2UgLyAyNSA+IDApIHsKICAgICAgICAgICAgICAgIHF1YXJ0ZXJzID0gcXVhcnRlcnMgKyAxOwogICAgICAgICAgICAgICAgcHJpY2UgPSBwcmljZSAtIDI1OwogICAgICAgICAgICB9CiAgICAgIAogICAgICAgICAgICAvLyBMb29wIGRpdmlkZSB1bnRpbCBubyBtb3JlIGRpbWVzIGFibGUgdG8gYmUgZGl2aWRlZAogICAgICAgICAgICB3aGlsZSAocHJpY2UgLyAxMCA+IDApIHsKICAgICAgICAgICAgICAgIGRpbWVzID0gZGltZXMgKyAxOwogICAgICAgICAgICAgICAgcHJpY2UgPSBwcmljZSAtIDEwOwogICAgICAgICAgICB9CiAgICAgIAogICAgICAgICAgICAvLyBMb29wIGRpdmlkZSB1bnRpbCBubyBtb3JlIG5pY2tlbHMgYWJsZSB0byBiZSBkaXZpZGVkCiAgICAgICAgICAgIHdoaWxlIChwcmljZSAvIDUgPiAwKSB7CiAgICAgICAgICAgICAgICBuaWNrZWxzID0gbmlja2VscyArIDE7CiAgICAgICAgICAgICAgICBwcmljZSA9IHByaWNlIC0gNTsKICAgICAgICAgICAgfQogICAgICAKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJZb3VyIGNoYW5nZToiKTsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJRdWFydGVyczogIiAgKyBxdWFydGVycyk7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiRGltZXM6ICIgKyBkaW1lcyk7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiTmlja2VsczogIiArIG5pY2tlbHMpOwogICAgICAgIH0gCiAgICB9Cn0=