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
Your desktop computer monitor is not displaying a picture. What would you do to troubleshoot the problem?
vichka [17]
I would have to say B but if you don't fell like thats the answer then A I'm not 100% sure
4 0
3 years ago
Read 2 more answers
How are web design &amp; web development different from each other?
Margarita [4]

Answer:

Developers are people who build a website's core structure using coding languages, while designers are more visually creative and user-focused. Developers use their programming knowledge to breathe life into the designer’s creative vision.

You could think of developers as construction workers, and web designers as architects – both necessary, but different, skill sets.

I hope this helped :D

Explanation:

3 0
3 years ago
Charlie makes pizza at a restaurant. The customers always compliment how great the pizza tastes. But Charlie takes a long time t
Oksi-84 [34.3K]
To get this u must do 8372928+(2728279298)=382627-6382638)()()(7372637 I did it right I’m the test
8 0
3 years ago
Read 2 more answers
The ____ dialog box in windows vista appears each time a user attempts to perform an action that can be done only with administr
Ganezh [65]
The User Account Control <span>dialog box in windows vista appears each time a user attempts to perform an action that can be done only with administrative privileges.</span>
7 0
3 years ago
Jim is in the market for a car that will last for the next 10 years and has saved up some money for the purpose of a car. What’s
ANTONII [103]
<span>Honda CR-V. Brainiest Please!</span>
6 0
3 years ago
Other questions:
  • The function below takes a single parameters: a list of numbers called num_list. Return a new list containing just the three lar
    5·1 answer
  • The growing network of physical objects that will have sensors connected to the Internet is referred to as the ________.
    13·1 answer
  • What steps might a company or organization need take in order to keep its digital data secure online?
    8·1 answer
  • Ann wants to save her presentation so she can work on it later. Which device on her computer can store this data long term?
    15·2 answers
  • Assume that you want two C# or C++ programs to share some data. You can write the first program so that it writes it's output to
    5·1 answer
  • Write a SELECT statement that returns three columns: VendorName from Vendors table, DefaultAccount No from Vendors table, Accoun
    10·2 answers
  • Which is the following should be selected in the paragraph dialogue box to prevent page break from occurring within a paragraph
    12·1 answer
  • A thesaurus is an example of a(n)
    5·2 answers
  • 30 POINTS FOR THE CORRECT ANSWERS
    12·1 answer
  • Suppose your team is finishing a project and the supervisor stresses ensuring the material cannot be erased. To what memory leve
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!