3.4 lesson practice quiz edhesive
:
Write a program to check if user inputs "yellow"
Answer:
In Python:
col = input("Enter Color: ")
if col == "yellow":
print("True")
else:
print("False")
Explanation:
This prompts the user for color
col = input("Enter Color: ")
This checks if color is yellow
if col == "yellow":
If true, this prints true
print("True")
If otherwise, this prints false
else:
print("False")
Answer:
The answer to this question is given below in the explanation section.
Explanation:
This program is written in C++.
#include <iostream>
using namespace std;
int main()
{
string word;// variable for taking user input
int cond;// to set condition true if user preses the stop and exit from loop
cout<<"Enter word: \n";
cin>>word;
do// start while loop
{
if(word=="stop" || word =="STOP" || word == "Stop")// if user enter word stop, then program exit
{
cond=0;
}
else//otherwise loop continue
{
cout<<" You Entered "+ word +"\n";
cout<<"Enter word: \n";
cin>>word;
cond=1;
}
}
while(cond == 1);// if user don't enter word "stop" loop run continuesly.
cout<<"Program exit";
return 0;
}
The question above has multiple choices as
follows;
a. Internet
<span>
b. Intranet
<span>
c. Extranet
<span>
d. World Wide Web
Correct answer is
C. Extranet
<span>You are able to use an Extranet to securely
share part of a business’s operation with vendors, suppliers, customers, partners
or any other business organization. We
can also view an extranet as an intranet extended to users outside the company.</span>
</span></span></span>
Using the knowledge of computational language in python it is possible to write a code that write (define) a public static method named countup, that takes one int argument and returns no value.
<h3>Writting the code:</h3>
<em>public class </em><em>Main</em>
<em>{</em>
<em>public static void main(</em><em>String</em><em>[] args) {</em>
<em>// testing the method </em><em>countDown </em><em>with values 5, 6, 1</em>
<em>countDown(5);</em>
<em>System.out.println();</em>
<em>countDown(6);</em>
<em>System.out.println();</em>
<em>countDown(2);</em>
<em>System.out.println();</em>
<em>}</em>
<em />
<em>public static void </em><em>countDown</em><em>(int num)</em>
<em>{</em>
<em>for (int i=1 ; i<=num ; i++) // for </em><em>loop </em><em>iterates from 1 to num</em>
<em>{</em>
<em>System.out.print(i+","); // prints num followed by comma ,</em>
<em>}</em>
<em>}</em>
<em>}</em>
See more about JAVA at brainly.com/question/12975450
#SPJ1