Answer:
#include <iostream>
using namespace std;
void PrintPopcornTime (int bagOunces){
if (bagOunces < 2){
cout << "Too small"<<endl;
}
else if (bagOunces > 10){
cout << "Too large"<<endl;
}
else{
cout << bagOunces*6 <<" seconds"<<endl;
}
}
int main(){
PrintPopcornTime(7);
return 0;
}
Explanation:
Create a function called PrintPopcornTime that takes one parameter, bagOunces
Check the bagOunces using if-else structure. If it is smaller than 2, print "Too small". If it is greater than 10, print "Too large". Otherwise, calculate and print 6*bagOunces followed by " seconds".
Call the function in the main function with parameter 7. Since 7 is not smaller than 2 or not greater than 10, "42 seconds" will be printed.
Answer:
- def getData(a_dict, key_list):
- result = []
-
- for key in key_list:
- result.append(a_dict[key])
-
- return result
-
- result = getData( {"puffin": 5, "corgi": 2, "three": 3} , ["three", "corgi"])
- print(result)
Explanation:
Let's define a function <em>getData() </em>with two parameters,<em> a_dict </em>and <em>key_list</em> as required by the question (Line 1).
Since the function is to return a list of associated values of dictionaries, a new list,<em> result</em>, is declared and initialized with empty values (Line 2).
Next, use for-loop to traverse through every string in the input <em>key_list </em>(Line 4) and use the traversed key to address the value in the<em> a_dict </em>and add it to the <em>result</em> list (Line 5)
At last, return the <em>result </em>list as output (Line 7)
We can test the function using the test case from the question and we shall see the output as follows:
[3, 2]
The system software consists of the programs that control or maintain the operations of the computer and its devices.
Answer:
Active Attack
• It is an active attack 1, because someone is actively attacking your system. It is also an active attack because it is affecting the way your system works negatively, and visibly.
• 2, because they have been caught for actively committing a crime.
• lastly, because a brute-force is classified as an active attack, regardless. It is an illegal way to attempt to damage, steal or change a root password.
•<em> Fun fact </em>
<em>A DDoS(distributed denial-of-service) is also classified as an active attack.</em>
The thing that Sniff and Scurry find while Hem and Haw were still hesitating was a big supply of a New Cheese.
The thing that Haw write on the wall and how does this apply to us in everyday life is “If a person Do Not Change, they can be able to go Extinct.”
<h3>What is the thing about Sniff and Scurry?</h3>
Sniff and Scurry were well on their way while Hem and Haw were still deciding what to do. They focused exclusively on locating New Cheese. They discovered a huge amount of New Cheese, which is what they were seeking for.
Note that Haw began to scribble words of encouragement on the walls as he made his way through the Maze, both for himself and to inspire Hem should he decide to change his mind and leave.
Learn more about Change from
brainly.com/question/25594630
#SPJ1