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
Nadusha1986 [10]
4 years ago
5

Write regular expressions for the following languages:

Computers and Technology
1 answer:
Leno4ka [110]4 years ago
6 0

Answer:

a) ^.{9}[0][0-1]*$

b) (?=.*^[0-1]*$)(?=.*^(?!.*00(.*00))).*

Explanation:

You can check the expression with the code in python, please see the image with the expressions evaluated for different cases.

a) First, we check if the position number 10 contains a zero by using the expression .{9}[0] and then we check that the input contains just numbers from zero to one (binary numbers) by using [0-1]

b) To understand this expression we need to know that  ?=.* helps us evaluate two different expression and if one of the two is false the result is false (and gate), the first expression to be evaluated is [0-1] an it checks that the input contains just numbers from zero to one, the second expression 00(.*00) checks that there is not more than one pair of zeros.

You might be interested in
Today's Apple Mac computers run with the same I-Ternal hardware as the Windows based PC true or false
Ksivusya [100]
Kinda of both. The processor, memory, hard drive and displays are all standard components and are provided by a variety computer competent manufacturers (except for the processors which are all supplied by Intel). Yet - while many components are standard - NO, the core, hardware components, like logic boards (motherboard), video cards, and other specialty components (some display connectors and displays, for example) are propriety Apple designs.
5 0
3 years ago
Print person1's kids, call the incNumKids() method, and print again, outputting text as below. End each line with a newline.
Brilliant_brown [7]

Answer:

Explanation:

The following code was written in Java and modifies the code so that for the given input such as 3 it outputs the exact information shown in the sample output.

import java.util.Scanner;

class CallPersonInfo {

   public static void main(String [] args) {

       Scanner scnr = new Scanner(System.in);

       PersonInfo person1 = new PersonInfo();

       int personsKid;

       System.out.println("How many kids do you have:");

       personsKid = scnr.nextInt();

       person1.setNumKids(personsKid);

       /* Your solution goes here */

       System.out.println("Kids: " + person1.getNumKids());

       person1.incNumKids();

       System.out.println("New Baby, kids now: " + person1.getNumKids());

   }

}

class PersonInfo {

   private int numKids;

   public void setNumKids(int setPersonsKids) {

       numKids = setPersonsKids;

   }

   public void incNumKids() {

       numKids = numKids + 1;

   }

   public int getNumKids() {

       return numKids;

   }

}

4 0
3 years ago
Code Example 8-1
damaskus [11]

Answer:

Option A: FileNotFoundError

Explanation:

FileNotFoundError is an exception which is thrown when a program fail to open a specified file. The root causes of this type of error can be:

  1. The directory path to locate a target file is wrongly defined in our code due to a typo on the file name or misuse of relative directory path, such as ../ and ./ which denote two different paths.
  2. For some reasons, a target file is misplaced in a wrong directory.

Any one of the above reasons can lead to the exception to be thrown when the file doesn't exist.

6 0
3 years ago
What should you do if your computer keeps shutting down while working? Make sure your anti-virus software is running and up-to-d
olganol [36]
The answer is either A. or B. <span />
5 0
3 years ago
Read 2 more answers
What is a contact list?
Monica [59]

Answer:

B

Explanation:

A only describes people you've communicated with through email, so they are not necessarily contacts.

C is similar to A

D only shows email addresses, which goes along with A

8 0
3 years ago
Read 2 more answers
Other questions:
  • Damage to which portion of the limbic system results in loss of memory of recent events and difficulty committing anything new t
    13·1 answer
  • Where may an operating system reside in a mobile device?
    5·1 answer
  • Why do primitive types have ranges of values? what determines the range of the data type?
    15·1 answer
  • Enables you to navigate through pieces of information by using links which connect them.
    10·1 answer
  • In the single-site processing, single-site data (SPSD) scenario, all processing must be done on the end user's side of the syste
    10·2 answers
  • 1. Show the 16-bit representation of the decimal number 2437. Show your steps. 2. Convert the 16-bit representation of part (a)
    12·1 answer
  • Which studio produced the film the jazz singer the first of many talkies
    11·1 answer
  • Does anyone know how to connect a nintendo switch to a laptop?
    10·2 answers
  • Filtering data in Excel Online keeps all data on the screen and highlights the content that fits your criteria.
    9·1 answer
  • Which of the statements below are true? Which are false?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!