1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
joja [24]
3 years ago
15

Write code that sets the value of a variable named delicious to True if jellybeans is greater than 20, or licorice is greater th

an 30, or their sum is greater than 40. Otherwise, set it to False. Do NOT use an if statement in your solution. Assume jellybeans and licorice already have values.
Computers and Technology
1 answer:
Sati [7]3 years ago
3 0

Answer:

jellybeans = 10

licorice = 35

delicious = (jellybeans > 20) or (licorice > 30) or ((jellybeans + licorice) > 40)

print(delicious)

Explanation:

*The code is in Python.

Set the jellybeans and licorice to any values you like

In order to have the value of True or False without using the if statement, we need to set delicious as boolean variable. As you may know, boolean variables are the variables that have a value of either True or False

Check if jellybeans is greater than 20 or not → (jellybeans > 20)

Check if licorice is greater than 30 or not → (licorice > 30)

Check if their sum is greater than 40 or not → ((jellybeans + licorice) > 40)

All of the above expressions are boolean expressions. They return True if the statement is correct. Otherwise, they return False

Also, note that we combined all the expressions with or

For these values → jellybeans = 10, licorice = 35:

The first statement returns False

The second statement returns True

The third statement returns True

delicious = False or True or True → True

Note that if the expressions are combined with or, the result will be True if one of the expression is True.

You might be interested in
_________________________ are people, places, and materials, either printed or non-printed, that can provide answers to inquirie
GalinKa [24]

Answer:

Information/knowledge resources

Explanation:

The process of looking for answers to questions that will lead to improved knowledge about a subject is known as an inquiry. The theories of enquiry includes abduction, induction, and deduction

An inquiry can provide the reasoning behind observation by making use of the theories of inquiry and sources that provide answers (information) about the (interrelated) events of the inquiry

Therefore, information and knowledge resources are the people, materials, and places, which can be in the printed, verbal, appearance form that have the capacity to proffer answers to inquiries

6 0
3 years ago
CHALLENGE ACTIVITY 4.2.2: Basic while loop with user input. Write an expression that executes the loop while the user enters a n
tino4ka555 [31]

Answer:

#include<iostream>

using namespace std;

int main()

{

int userNum;

userNum=9;

while(userNum>=0)

{

  cout<<"Body"<<endl;

  cin>>userNum;

}

cout<<"Done"<<endl;

return 0;

}

Explanation:

  • Use the userNum >= 0 expression that executes the loop while the user enters a number greater than or equal to 0.
  • Print the userNum inside the while loop.
3 0
3 years ago
All of the following are aspects of the search process except?
Alinara [238K]
<span>d. select information is sent to the search engines database to be indexed. </span>
8 0
4 years ago
Read 2 more answers
The following outline is used to plan a program. What is the name for this type of plan?
vladimir1956 [14]
Pseudocode is the answer
7 0
3 years ago
Read 2 more answers
4.8% complete this is a single choice question; skip ahead to question content a b c d confirm difficulty level: moderate an int
PilotLPTM [1.2K]

Answer:

A replay attack

4 0
2 years ago
Other questions:
  • What is the purpose of lookup tables in spreadsheet software
    13·2 answers
  • *FREE POINTS* If you comment and follow me this will give up lot of points :p seriously I will follow u back if u do it :p​
    11·2 answers
  • You are given n sorted sequences each one containing n keys. You may assume n is a power of two. We want to merge them into one
    15·1 answer
  • A(n) _____ allows a user to choose specific files to back up, regardless of whether or not the files have been changed.
    9·1 answer
  • If you create and invoke a recursive function without accounting for a base case, what can go wrong?
    15·1 answer
  • Write a regular expression that selects lines containing any of the following words: linux windows solaris macos. For this exerc
    13·1 answer
  • Run the browser checker to see that the computer you are using now is set up for WileyPLUS. Which of the following browser funct
    15·1 answer
  • Write a function called has_duplicates that takes a string parameter and returns True if the string has any repeated characters.
    7·1 answer
  • Impaired drivers are one of the many risks drivers face on the Highway Transportation System. List 3 signs that a driver could b
    10·2 answers
  • Give an essay on a way I can be a better person. If not correct I will refund. Best answer gets brainiest. Detailed, 5 sentience
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!