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
vlada-n [284]
3 years ago
10

Consider the series of alternating 1s and 0s 1 0 1 0 1 0 1 0 1 0 ...... The user will enter a number n . And you have to output

the first n numbers of this sequence (separated by spaces) You may assume the user will enter n > 0 and an integer using two if statements

Computers and Technology
1 answer:
Vika [28.1K]3 years ago
8 0

Answer:

# user is prompted to enter the value of n

n = int(input("Enter your number: "))

# if statement to check if n > 0

if (n > 0):

   # for-loop to loop through the value of n

   for digit in range(1, (n+1)):

       # if digit is odd, print 1

       if((digit % 2) == 1):

           print("1", end=" ")

       # else if digit is even print 0

       else:

           print("0", end=" ")

Explanation:

The code is written in Python and is well commented.

A sample output of the code execution is attached.

You might be interested in
Ima go to sleep but I ask a favor can u guys go on eBay Amazon and find the cheapest pre bilt that is actually good
katrin2010 [14]

Explanation:

what do specifically want to buy??

8 0
3 years ago
Read 2 more answers
How do I mark someone brainiest
svet-max [94.6K]

Answer:

when someone answers your questio correctly, you will see a red crown. Click on that and mark them the most brainiest

Explanation:

3 0
2 years ago
Read 2 more answers
In a multiple-column record of a data file, ______ represent different variables and _______ represent different cases
Nookie1986 [14]

Answer:

columns, rows

Explanation:

In Computer programming, a atabase schema refers to the logical design of the database while the database instance refers to a snapshot of the data found in a database at a given instant in time.

Basically, in database management, the term "schema" is used to denote a representation of data while the term "instance" is used to denote an instance of time.

A database schema is a structure which is typically used to represent the logical design of the database and as such represents how data are stored or organized and the relationships existing in a database management system. There are two (2) main categories of a database schema; physical database schema and logical database schema.

Also, a database instance is a snapshot of the data in the database at a given instant in time and as such represents an operational database by following the conditions, validation and constraints set for a database management system.

These data can be stored or organized in a database management system through the use of multiple-column record formats.

In a multiple-column record of a data file, columns represent different variables and rows represent different cases (respondents) such as experimental data, independent observations etc.

4 0
2 years ago
What are the benefits of using presentations to organize and deliver information?
bearhunter [10]
Hello.

The benefits of using presentations to organize and deliver information are: it keeps things in order, keeps peoples attention longer, and it looks more professional.
4 0
3 years ago
Write a function PrintShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, pr
Finger [1]

Answer:

public static void PrintShampooInstructions(int numberOfCycles){

       if (numberOfCycles<1){

           System.out.println("Too Few");

       }

       else if(numberOfCycles>4){

           System.out.println("Too many");

       }

       else

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

               System.out.println(i +": Lather and rinse");

           }

       System.out.println("Done");

   }

Explanation:

I have used Java Programming language to solve this

Use if...elseif and else statement to determine and print "Too Few" or "Too Many".

If within range use a for loop to print the number of times

8 0
3 years ago
Read 2 more answers
Other questions:
  • What is the simplest way to convert a decimal number in a binar one in c++?
    8·1 answer
  • List and describe four communication tools that are currently popular.
    9·1 answer
  • Please tell me what is basic HTML tags and its function please ​
    8·1 answer
  • Which of the following is true about driving on "bald" tires?
    5·1 answer
  • How can you tell that a spreadsheet was saved as a 2007 Excel file?
    7·1 answer
  • Does clicking ads and pop ups like the one shown in this image could expose your computer to malware?
    15·1 answer
  • A network administrator is reviewing a network design that uses a fixed configuration enterprise router that supports both LAN a
    8·1 answer
  • The name of a .java file should ______________________________. Always match the name of the Class inside Should always start wi
    9·1 answer
  • You have a technical interview for a new position in digital media. One of the questions you are asked is this: “A client asks y
    13·1 answer
  • reagan's firm has not had to make large investments in computer or networking hardware or in personnel to maintain the hardware
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!