L ={x^a y^b z^c | c=a+b}
a) Prove that L is not regular.
b)Prove by giving a context-free grammar that the L is context free.
c)Give a regular expression of the complement L'.
In: Computer Science
C++
Create a class called Musicians to contain three functions string ( ), wind ( ) and perc ( ).
Each of these functions should initialize a string array to
contain the following instruments:
- veena, guitar, sitar, sarod and mandolin under
string ( )
- flute, clarinet saxophone, nadhaswaram and
piccolo under wind ( )
- tabla, mridangam, bangos, drums and tambour
under perc ( )
It should also display the contents of the arrays that are initialized.
Create a derived class called TypeIns to contain a function called get ( ) and show ( ). The get ( ) function must display instruments as follows:
Type of instruments to be displayed
a. String instruments
b. wind instruments
c. Percussion instruments
The show ( ) function should display the relevant detail according to our choice. The base class variables must be accessible only to its derived classes.
In: Computer Science
Hello There!
I have a question to answer please, I don't understand it, it is about data communication and networking "Wireshark"
Capture ICMP packets with “Wireshark” and analyze the results.
Capturing Basics and Filters
1_ Create a filter to show only HTTP traffic with destination port 80.
2_ Create a filter to exclude ARP and ICMP traffic from visualization.
3_ Create a filter to show DNS queries to a specific domain. TIP: Use the keyword contains to search a specific value in the payload.
I want to see screenshots please and outcomes,
Thanks!
In: Computer Science
Thus, an expression can contain a sequence of delimiters such as
{ [ ( ) ( ) ] ( ) }
but not
[ ( ] )
For convenience, we will say that a balanced expression contains delimiters that are paired correctly, or are balanced.
In: Computer Science
Create a java program for Student profile with the following requirements.
To test the program, create a class StudentTest with the main method.
In the main method:
Answer:
In: Computer Science
Create a C++ program based on the following criteria:
In: Computer Science
For this portion of the lab, you will reuse the Python program
you wrote before.
That means you will open the lab you wrote in the previous
assignment and change it. You should NOT start from scratch. Also,
all the requirements/prohibitions from the previous lab MUST also
be included /omitted from this lab.
Redesign the solution so that some portions of the code are
repeated. In lab 4 you validated input to ensure that the user
entered inputs within certain values. If the user entered an
invalid value, the program terminated. Now you will add a loop such
that the user gets three chances to enter a valid value. If the
user enters an invalid value more than three times in a row, the
program should issue an error message and terminate.
The program I wrote before is shown below.
How can I apply the new requirements to reuse this program?
#Get a value from user.
Miles = float(input('How many miles would you like to convert into
kilometers: '))
#Condition
if Miles >= 0:
#Convert miles to kilomters
Kilometers = Miles * 1.6
#Display result
print(Miles,"miles is equal to", Kilometers,"kilometers.")
#Get a value from user.
Gallons = float(input('How many gallons would you like to convert
into liters: '))
#Condition
if Gallons >= 0:
#Convert gallons to liters
Liters = Gallons * 3.9
#Display result
print(Gallons,"gallons is equal to", Liters,"liters.")
#Get a value from user.
Pounds = float(input('How many pounds would you like to convert
into kilograms: '))
#Condition
if Pounds >= 0:
#Convert pounds to kilograms
Kilograms = Pounds * 0.45
#Display result
print(Pounds,"pounds is equal to", Kilograms,"kilograms.")
#Get a value from user.
Inches = float(input('How many inches would you like to convert
into centimeters: '))
#Condition
if Inches > 0:
#Convert inches to centimeters
Centimeters = Inches * 2.54
#Display result
print(Inches,"inches is equal to",Centimeters,"centimeters.")
#Get a value from user.
Fahrenheit = float(input('How many fahrenheit would you like to
convert into celsius: '))
#Condition
if Fahrenheit < 1000:
#Convert fahrenheits to celsius
Celsius =(Fahrenheit - 32) * 5/9
#Display result
print(Fahrenheit,"fahrenheits is equal
to",Celsius,"celsius.")
else:
#Display error message
print('Invalid value!')
else:
#Display error message
print('Invalid value!')
else:
#Display error message
else:
#Display error message
print('Invalid value!')
else:
#Display error message
print('Invalid value!')
In: Computer Science
In: Computer Science
how to run child process and parent process in parallel/at the same time in python using os
In: Computer Science
In: Computer Science
Staff members are reporting an unusual number of device thefts associated with time out of the office. Thefts increased soon after the company deployed a new social networking app.
Which of the following should the Chief Information Security Officer (CISO) recommend implementing? SELECT ONE
A. Automatic location check-ins
B. Geolocated presence privacy
C. Integrity controls
D. NAC checks to quarantine devices
PLEASE ALSO STATE THE CORRECT ANSWER AS WELL AS WHY THE OTHER ANSWERS ARE WRONG, THANKS
In: Computer Science
what are stream manipulators in C++? write a detail note.
In: Computer Science
Hello guys.
Below is a test im struggling with I have to do it in Java and use
OOP concepts.
Create.
A House class with instance variables erfNumber, location,
noOfRooms,
etc.
Mandatory properties: status(is the asset owned or sold), number
of
years owned, selling price, and buying price.
At least two overloaded constructors that can be used to
instatiate
House objects.
Getter and setter methods for all properties you have
created.
A method checkProfitOrLoss() that returns the profit or loss that
can be
made if the property is sold (sellingPrice-buyingPrice).
A custom toString() method to print out all the properties of a
House
object.
A static counter to keep track of the number of each object
created.
At least 5 more property or vehicle classes such as Farm, Flat,
Bakkie,
RentalCar, etc.
A driver class named AssetManager.
An array of five House objects. The same applies to other classes
created
in Section B.
Methods to add (remember to keep the sizes of the arrays in mind),
sell
assets (sets the status of an asset at a given index of an array to
sold), and
print the contents of each of the objects for each array. Each
method to
have proper Javadoc comments.
Code to enter from input five of each of the assets into respective
arrays
using the add methods just created.
Printing out the contents of all the arrays using the print methods
you have
created to provide an initial asset report.
Change the current value of at least 10 objects from the arrays
using the
getter and setter methods.
Print out the contents of the assets that can be sold at a profit
using the
checkProfitOrLoss method and the methods you have provided an
asset
sales report.
In: Computer Science
what are stream manipulators in C++? Write at least 3 short example programs of stream manipulators.
In: Computer Science
In Java, design and implement a class called Cat. Each Cat class will contain three private variables - an integer representing its speed, a double representing its meowing loudness, and a String representing its name. Using the Random class, the constructor should set the speed to a random integer from 0 to 9, the meowing loudness to a random double, and the name to anything you want; the constructor should take no parameters. Write “get” and “set” methods for each variable, and one that prints all the variables. Finally, write a main method to test the methods in the class. The three variables must be private.
Then design and implement a class called CatOwner. Each CatOwner will have three private variables: a String representing the owner name, an integer representing how much cat food is left, and a cat; each cat should be an instance of the Cat class. The constructor can name the CatOwner anything you want, and the supply of food should be a random number greater than or equal to 10 and less than 50. Each cat’s name should be set to “Tinkles.” The constructor for CatOwner should take no parameters. Write “get” and “set” methods for the owner’s name, the food supply, and all the properties of the cat; also write a feedCat method that decreases the food supply by 1 and prints that the cat was fed. Next, write a method to print all class variables. Finally, write a main method to test your methods.
Design a driver class which instantiates two CatOwner objects. Next, perform the following five steps:
1. Change the name of the first cat owner to “John Doe” and his
dog’s name to “Whiskers.” Change the name of the second cat owner
to “George Washington.”
2. Increase the meowing loudness of the first cat owner’s cat by
.1, and set the speed of the second cat owner’s cat to 5.
3. Double the food supply of the first cat owner, and set the food
supply of the second to 25.
4. Have the first cat owner feed his cat three times, and have the
second cat owner feed his cat twice.
5. Print out all the information for both cat owners.
In: Computer Science