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
DIA [1.3K]
3 years ago
7

Someone help me

Computers and Technology
1 answer:
valkas [14]3 years ago
5 0

The program is an illustration of loops.

Loops are used to perform repetitive and iterative operations.

The program in C++ where comments are used to explain each line is as follows:

#include <iostream>

using namespace std;

int main(){

   //This declares and initializes all variables

   string star = "*", blank = " ", temp;

   //The following iteration is repeated 8 times

   for (int i = 1; i <= 8; i++) {

       //The following iteration is repeated 8 times

       for (int j = 1; j <= 8; j++) {

           //This prints stars

           if (j % 2 != 0) {

               cout << star;

           }

           //This prints blanks

           else if (j % 2 == 0) {

               cout << blank;

           }

       }

       //This swaps the stars and the blanks

       temp = star;

       star = blank;

       blank = temp;

       //This prints a new line

       cout << endl;

   }

}

Read more about similar programs at:

brainly.com/question/16240864

You might be interested in
For the purposes of laying out content, the total height of a box is calculated by adding which of the following?
nordsb [41]

content height and the top and bottom margins, borders, and padding

7 0
3 years ago
This is the term popularly used to describe fixing errors in a computer program.
Setler79 [48]
C) Debugging. Debugging is when you fix the errors in your code
5 0
3 years ago
Read 2 more answers
A check of dorms revealed that 38% had refrigerators, 52% had TV’s and 21% had both a TV and a refrigerator. What’s the probabil
stira [4]

Answer:

a) 31%  b) 48% c) 31%

Explanation:

We have the probabilities:

P(had TV) = 0.52

P(had refrigerator)=0.38

P(had both a TV and a refrigerator)=0.21

<em>a) a TV but no refrigerator </em>

P(a TV but no refrigerator) =P(TV)- P(both a TV and a refrigerator) = 0.52 - 0.21 = 0.31

<em>(b) a TV or refrigerator but not both </em>

P(a TV or refrigerator but not both) = P(TV) + P(had refrigerator) - 2×P(had both a TV and a refrigerator) = 0.52+ 0.38 - (2×0.21) = 0.48

<em>(c) neither a TV nor a refrigerator</em>

P(neither a TV nor a refrigerator) = 1 - ( P(TV) + P(had refrigerator) - P(had both a TV and a refrigerator) ) = 1- (0.52 + 0.38 - 0.21) = 0.31

<em></em>

8 0
4 years ago
A file named numbers.txt contains an unknown number of lines, each consisting of a single positive integer. Write some code that
prisoha [69]

In Python, assume that a file containing a series of integers is named numbers.txt and exist on the computer's disk. Write a program that reads the entire numbers store in the file and calculates their total.

Here is what I have written but it does not run:  

def. main():

   out file=open('numbers.txt','r')

   temp=outfile.readline()

   total=0

   while temp!='':

       t=int(temp)

       total=total+i

       temp=outfile.readline()

       outfile.close()

       print('Total sum is:',total)

main()

Text file is a file named numbers.txt with the numbers 1-50 in it

Learn more:

  • The sum of three consecutive integers is 186. what are the integers

        brainly.com/question/1768254

Keywords: python, integers, computer, numbers, program

6 0
3 years ago
Read 2 more answers
Pls Help A table is a_______of rows and columns that provides a structure for presenting data​
WARRIOR [948]

Answer:

Graph or chart???

Explanation:

5 0
3 years ago
Other questions:
  • To change the caption for a field in a query, click the field in the design grid, click the ____ button on the Design tab, click
    14·1 answer
  • You can add envelopes to existing documents. <br> a. True <br> b. False
    10·1 answer
  • Modify the definition of the throttle class on page 35, to create a new throttle ADT, which allows the user of the ADT to specif
    6·1 answer
  • There are only three active stations in a slotted aloha network: a, b, andc. each station generates a frame in a time slot with
    15·1 answer
  • What is the range of the set of ordered points defined below?
    5·2 answers
  • Which user characteristic may not be used to change keyword bids in adwords?:?
    11·1 answer
  • PLSSS HELPP IM DESPERATE!!!
    11·1 answer
  • Full form of computer
    12·1 answer
  • What are ways to create a study schedule? Check all that apply.
    5·2 answers
  • Electrical data suitable for transmission is called a(n)
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!