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
Dmitriy789 [7]
3 years ago
12

Recursive definitions for subsets of binary strings. About Give a recursive definition for each subset of the binary strings. A

string x should be in the recursively defined set if and only if x has the property described.
(a) The set S consists of all strings with an even number of 1's.
(b) The set S is the set of all binary strings that are palindromes. A string is a palindrome if it is equal to its reverse. For example, 0110 and 11011 are both palindromes.
Computers and Technology
1 answer:
Masteriza [31]3 years ago
8 0

Answer:

this program was written in JAVA

Explanation:

import java.util.Scanner;

public class RecursivePalindromeJava

{

public static boolean checkPalindrome(String str)

{

if(str.length() == 0 || str.length() == 1)

return true;

if(str.charAt(0) == str.charAt(str.length() - 1))

return checkPalindrome(str.substring(1, str.length() - 1));

return false;

}

public static void main(String[]args)

{

Scanner sc = new Scanner(System.in);

System.out.println("Please enter a string : ");

String strInput = sc.nextLine();

if(checkPalindrome(strInput))

{

System.out.println(strInput + " is palindrome");

}

else

{

System.out.println(strInput + " not a palindrome");

}

sc.close();

)

)

You might be interested in
Why is my computer fans making weird noises?
sattari [20]

Answer:

The biggest culprit for excess noise in computers Computer internal devices all generate "heat."  Most computers manufacturer add temperature controller fans on important internal devise or locations.  These will spin faster when "hot" temperatures are detected.  With the fans, there are usually "ventilation holes" needed to push this hot "air" out.  Unfortunately, these holes let in dust and "other debris' into the fans, thus making them "spin" harder and faster. This is normal. You might want to take your computer to your school's office and ask them about your. computer. I think I have a solution below but I am not sure it will work.

Check to make sure that your computer is set to use all of your speakers. Navigate to the Control Panel, and double-click Sounds And Audio Devices. If you change this setting, click Apply, OK, and then OK again to exit the Sounds And Audio Devices Properties dialog box.

Hope this answer helped you have a good day.  :)

3 0
2 years ago
Read 2 more answers
Write a CashRegister class that can be used with the RetailItem class that you wrote in Chapter 6's Programming Challenge 4. The
lys-0071 [83]

Answer:

Following are the code to this question:

import java.util.*; //import package for user input

class RetailItem//defining class RetailItem  

{

private String desc;//defining String variable

private int unit;//defining integer variable

private double prices;//defining double variable

RetailItem()//defining default Constructor

{

   //Constructor body

}

Output:

The Sub Total value: 199.75

The Sales Tax value: 11.985

The Total value: $211.735

Explanation:

In the above code three class "RetailItem, CashRegister, and Main" is defined, in the class "RetailItem", it defines three variable that is "desc, unit, and prices", inside the class "get and set" method and the constructor is defined, that calculates its value.

In the next step,  class "CashRegister" is defined, and inside the class parameterized constructor is defined, which uses the get and set method to return its value.  

In the next step, the main class is declared, in the main method two-class object is created and calls its method that are "getSubtotal, getTax, and getTotal".  

There is some technical error that's why full code can't be added so, please find the attached file of code.  

7 0
3 years ago
before donating a computer you should use a program to wipe the hardest to remove all of his data true or false
Katarina [22]
True or they could get into your stuff. 
6 0
4 years ago
while investigating the settings on your SOHO router, you find two IP address reported on the devices's routing table, which is
DochEvi [55]

Answer:

From the two IP addresses, 192.168.2.1 can be listed as the default gateway in local network devices.

The reason is that we are allocated with the ranges that are reserved for the local networks by RFC 1918.

These ranges are given as follows:

  • For (10/8 prefix)  

                            10.0.0.0 - 10.255.255.255

  • (172.16/12 prefix)

                            172.16.0.0 - 172.31.255.255

  • (192.168/16 prefix)

                            192.168.0.0 - 192.168.255.255

Moreover the default gateway for a device can also be known by the commands ipconfig or  ipconfig/all on the command prompt.

<h3>I hope it will help you!</h3>
7 0
3 years ago
What is meant by algorithm?​
ExtremeBDS [4]

Answer:

a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.

Explanation:

7 0
3 years ago
Other questions:
  • ________ computers are specially designed computer chips that reside inside other devices, such as a car. Select one: A. Tablet
    11·2 answers
  • Explain why testing can only detect the presence of errors, not their absence.
    14·1 answer
  • Convert the following pseudi code to C++ code. BE sure to define the apprpriat evariables.
    9·1 answer
  • What part of the code is a signal for the function to execute and pass back a value?
    11·2 answers
  • Why is it important to study in a quiet well lit area
    5·2 answers
  • You will be creating a quiz grading program. You will compare the student's answers with the correct answers, and determine if t
    15·1 answer
  • Which statistical measurement tools should be
    8·1 answer
  • How to deactivate the brainly account?​
    13·1 answer
  • If an if-else statement is true, it will include which kinds of results?
    13·1 answer
  • What are some of the characteristics found in an editorial photograph?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!