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
zepelin [54]
3 years ago
10

Let's write a simple markdown parser function that will take in a single line of markdown and be translated into the appropriate

HTML.
Computers and Technology
1 answer:
Klio2033 [76]3 years ago
6 0

Answer:

Here is the answer in Java with appropriate comments for understanding

Explanation:

import java.util.Scanner;

public class Hash {

public static void main(String[] args) {

System.out.print("Enter a string : ");

Scanner scanner = new Scanner(System. in);

String s = scanner. nextLine();   //read string

int k=s.lastIndexOf('#'),count=0;//find last occurence of # then take the next part

  String s2="",s3="";

  for(int i=0;i<s.length();i++)

  {

      if(s.charAt(i)=='#')

          count++;//count the occurence of # of level of heading h1,h2,h3,....

  }

  for(int j=k+1;j<s.length();j++)

  {

      s2+=s.charAt(j);//take the remainging string after #

  }

// System.out.println(k);

 

//System.out.println(count);

if(count<=6)//if it is valid heading

{

  s3="<h"+count+">"+s2+"</h"+count+">";

  System.out.println(s3);  

}

else

  System.out.println("Invalid header");

 

}

}

You might be interested in
URGENT: I need to add a while loop in this program but I don't know-how. I am also having trouble neatening some lines of code.
dangina [55]

Answer:

Answer is in the provided screenshot.

Explanation:

You are making this more confusing for yourself by doing it like this.

I have added variables at the top of your program for game messages that are repeated - and also simplified the given cases for if the player wins, loses or ties.

I invite you to now make a point tracker that, at the start of each game says: You have "x" points.

And you gain a point for winning, lose a point for losing and nothing happens if you tie.

To add a while loop - simply use the "while" keyword, and anything within the loop will repeat while the given condition is true.

8 0
3 years ago
Which of the following is the last step in creating a budget?
sweet [91]
You answer to the question is C
3 0
3 years ago
Big data are used to _____. Select 3 options.
Anon25 [30]

Answer:

Big data are used to _____. Select 3 options.

understand people’s hobbies

analyze people’s interests

make decisions about marketing

Explanation:

100%

8 0
3 years ago
Which of the following would you not see on a windows 10 start menu?
mixas84 [53]
Task view is the option that you would not see on a Windows 10 Start menu, whereas if you click the Windows button, you can see tiles with different applications, all of your apps in the form of tiles you can distribute according to your own taste, and power button where you can choose whether you want to shut down your computer, put it to sleep, or log out.
4 0
3 years ago
TensorFlow and Pytorch are examples of which type of machine learning platform?
densk [106]
Both TensorFlow and PyTorch are examples of a robust machine learning library.

4 0
2 years ago
Other questions:
  • WILL GIVE  BRAINLIEST!! WILL REPORT TOO....
    13·1 answer
  • Sarah's employer purchased a health insurance plan that costs $750 per month. Sarah pays $75 toward the plan each month. What is
    5·2 answers
  • When Twitter is used to gather a large group for a face-to-face meeting it is called a
    10·1 answer
  • 5. How would you describe the relationship between blocks of code and commands?​
    14·2 answers
  • You often travel away from the office. While traveling, you would like to use a modem on your laptop computer to connect directl
    5·1 answer
  • What is difference between reserved and user defined word
    9·1 answer
  • When power is completely removed from your computer
    11·1 answer
  • How do you give brainlest things out?
    14·2 answers
  • What is one of four key principles of Responsible Artificial Intelligence
    5·1 answer
  • Define a function calc_pyramid_volume with parameters base_length, base_width, and pyramid_height, that returns the volume of a
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!