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]
2 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]2 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
The area of a rectangle is the rectangle's length times its width.
aliya0001 [1]

Answer:

Following are program to this question:

#include <iostream> //defining header file  

using namespace std;  

int main() //defining main method

{

   double len1,len2,wid1,wid2,area1,area2; //defining double variable

   cout << "Enter first rectangle length: "; //print message

   cin >> len1;//input first rectangle length value

   cout << "Enter first rectangle width: ";//print message

   cin >> wid1; //input first rectangle width value

   area1 = len1*wid1; //calculate area and holds its value  

   cout << "Enter second rectangle length: ";//print message

   cin >> len2; //input second rectangle length value

   cout << "Enter second rectangle width: ";//print message

   cin >> wid2; //input second rectangle width value

   area2 = len2*wid2; //calculate area and holds its value  

   if(area1 > area2) //check condition area1 value is greater then area2

   {

    cout << "First rectangle area value is greater";//print message

   }

   else if(area2 > area1)//check condition area2 value is greater then area1

   {

       cout << "Second rectangle area value is greater";//print message

   }

   else //else block

   {

       cout << "both rectangle area is same";//print message

   }

   return 0;

}

Output:

Enter first rectangle length: 3

Enter first rectangle width: 5

Enter second rectangle length: 5

Enter second rectangle width: 3

both rectangle area is same

Explanation:

The description of the above program can be described as follows:

  • In the given code, the double variable is declared, which is "len1, len2, wid1, wid2, area1, and area2". In the next line, a message is a print, that accepts "len1 and wid1" value in the next line, the area variable is used that calculates area1.
  • In the next step, the "len2 and wid2"  variable is used, that accepts values and calculates its area, and in the next line, the conditional statement is used that checks its value.
  • In the if the block it uses both area1 and area2 value, that checks area1 is greater then area2, it is will print first rectangle area is greater.  
  • Otherwise, it will go to else if block, that checks area2 is greater then area1, it is will print second rectangle area is greater.  In the else section, it will print both equal areas.

4 0
3 years ago
A. True
vitfil [10]
The answer would be True.
8 0
2 years ago
You want to copy data from one cell or range to an adjacent cell or range in your spreadsheet, without using a shortcut key. Whi
astraxan [27]

How can you insert a new row into your data without disturbing an adjacent set of data on the same sheet? Highlight only the data where you'd like to insert a row. Right-click > Insert > Shift cells down.

3 0
2 years ago
When computer network are joined together they form a bigger network called the​
Airida [17]

Answer:

A WAN can be one large network or can consist of two or more lans connected together. The Internet is the world's largest wan.

Explanation:

8 0
2 years ago
What is RAM? explain it
Zina [86]
RAM is memory in the computer
3 0
3 years ago
Read 2 more answers
Other questions:
  • Unix has experimented with several security programs. a user can attach a watchdog program to a file that grants or denies acces
    13·1 answer
  • ________ is a software that interprets java bytecode.
    12·1 answer
  • This type of software works with end users, application software, and computer hardware to handle the majority of technical deta
    12·1 answer
  • Primary technology skills are skills that are necessary for success in online education
    9·2 answers
  • Which line of code will eliminate the element “calculator” from an array of supplies?
    13·1 answer
  • Write an algorithm that accepts two numbers,
    7·1 answer
  • What is data? why is it important to collect data ? explain the points.​
    10·1 answer
  • What are the physical aspect of a presentation​
    7·1 answer
  • Classify the various scenarios in a web development team that is creating a website for a client according to the priority level
    9·1 answer
  • The area that we can see just after windows is started is subject​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!