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
Harlamova29_29 [7]
3 years ago
13

Assume we are testing a variable is_sunny in a while loop. is_sunny = “n”.

Computers and Technology
1 answer:
zubka84 [21]3 years ago
6 0

Answer:

while(is_sunny=="n")

Explanation:

The loop keeps repeating itself until a certain condition is met.

Here while loop keeps executing until value of is_sunny is not equal to 'n'

When the value of is_sunny is not equal to n then the loop stops.

So lets explain this logic with a chunk of code:

#include <iostream> //to use input output functions

using namespace std; //to identify objects like cin cout

int main() {  //start of main function

  string is_sunny = "n"; //value of is_sunny is set to n

  cout<<"Enter value of is_sunny: "; // prompts user to enter value of is_sunny

  cin>>is_sunny; // reads value of is_sunny from user

  while(is_sunny=="n") // keeps iterating until value of is_sunny is not equal to n

  {   cout<<"keep executing until is_sunny is not equal to n"<<endl;//display this message with each iteration

      cout<<"Enter value of is_sunny: "; //keeps prompting to enter is_sunny

      cin>>is_sunny;   } } //keeps reading value of is_sunny from user

Now if the user keeps entering "n" as value of is_sunny then the loop keeps repeating. When the user enters any string other than n then the loop breaks. The output of the program is attached.

You might be interested in
I WILL GIVE BRAINIEST ANSWER AND THANKS IF YOU ANDWER THIS QUESTION!!!!
sesenic [268]
Access: full electronic participation in society.
Commerce: electronic buying and selling of goods.
Communication: electronic exchange of information.
Literacy: process of teaching and learning about technology and the use of technology.
Etiquette: electronic standards of conduct or procedure.
Law: electronic responsibility for actions and deeds.
Rights & Responsibilities: those freedoms extended to everyone in a digital world.
Health & Wellness: physical and psychological well-being in a digital technology world.
Security (self-protection): electronic precautions to guarantee safety.

IMPORTANT
Etiquette. Students need to understand how their technology use affects others. ...
Literacy. Learning happens everywhere. ...
Rights and responsibilities. Build trust so that if something happens online, students are willing to share their problems or concerns about what has happened.
6 0
3 years ago
Write an algorithm which gets a number A, if it is even, prints even, and if it is odd prints odd.
juin [17]

Answer:

The algorithm to find A is even or odd.

  1. input A.
  2. Check the remainder on diving by 2 by A%2.
  3. If remainder is 1 then A is odd Print(Odd).
  4. If remainder is 0 print(Even).

Explanation:

To check if the number is even or odd we use modulo  operator(%).Which gives the remainder on dividing.So if we do this A%2 it will give the remainder that will come out on dividing the value of A by 2.

So if the remainder comes out is 1 then the number is odd and if the remainder is 0 then the number is odd.

7 0
3 years ago
PLEASE HELP GIVING 25 POINTS Sophia is leading a project to help clean up a local river in her area. She creates an online forum
nignag [31]

Answer:

She holds useful online meetings

Explanation:

5 0
3 years ago
Read 2 more answers
Abrupt changes in road surface or the shape of the road may indicate
Zanzabum

Answer:

D. a potential hazard

Explanation:

Abrupt changes in road surface or the shape of the road may indicate a potential hazard.

5 0
3 years ago
Read 2 more answers
Which of the follow is an example of an integer?<br> "1.091"<br> "number"<br> 15<br> name
UkoKoshka [18]

Answer:

The answer is 15

Explanation:

A integer is a whole number, the only wholenumber present is 15

Hope this helps :)

8 0
2 years ago
Other questions:
  • Ted wants to follow the StartSafe philosophy when working around electricity. Which of the following steps would be consistent w
    15·2 answers
  • Software that instructs the computer how to run applications and controls the display/keyboard is know as the
    8·1 answer
  • A person who has a been exposed to technology at a young age is?
    8·1 answer
  • Basic rule for java languague
    13·2 answers
  • . A possible data for source that could be used when completing a mail merge could be a(n)… : *
    13·2 answers
  • Based on the following passage on construction technology during the Middle Ages, why might a worker not be allowed to join a gu
    15·1 answer
  • Do you guys know if there's a way for me to find a Google doc that I typed but forgot to save if you do it for points i will rep
    10·2 answers
  • The Scientific Method is a/an
    9·2 answers
  • _________ is the most popular high-level Java API in Hadoop Ecosystem. Cascading Scalding Cascalog None of the options
    7·1 answer
  • If you want to remove the autocorrect options button from the screen, you can press the ____ key.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!