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
In a pinhole camera, the image seen in the camera will be inverted<br><br> true<br> false
Sati [7]
Hey there,

Based on my research, I believe that your correct answer may be "True".<span>the image seen in the camera will be inverted because it is a pinhole camera.

~Jurgen</span>
6 0
3 years ago
Read 2 more answers
I want to do is speed test to do i go to for my computer
laiz [17]

I just go to the speed test on my browser

7 0
3 years ago
You work as the IT security administrator for a small corporate network. You have designed the physical security of the offices
ladessa [460]

The security IT administrator he or she is planning to install smart card communications over the network which is can be access through TCP IP address.

Smart card key reader to be placed or installed where is required  such as an opening door  or entrance of office or organization extra.

Key card readers should be contactless and record more volume of data and it should synchized with the system at regular intervals.

By Installing smart card and it readers unauthorized  person entry to lab or network server can be avoided. Since smart card reader connected to the network, IT SECURITY administrator can generate log reports.

5 0
3 years ago
Buying a house is most likely a long-term goal for a person of which of these
vekshin1

Answer:

B  i think

Explanation:

5 0
4 years ago
Which of the three is not a popular cloud suite or online office suite?
SIZIF [17.4K]
C. Thinksmart - thinksmart only sells products and softwares of their own. Thinksmart is a online selling company that sells moslty softwares on their domain. Think smart is not a popular cloud suite or an online office suite. So the answer to your question is C.
3 0
4 years ago
Other questions:
  • Write a program that takes as input an arithmetic expression followed by a semicolon ";". The program outputs whether the expres
    11·1 answer
  • Inkjet printers and laser printers are examples of ________ printers. (1 point)
    13·1 answer
  • If the point (9, 5) is translated 6 units left and 5 units up, then find the
    10·1 answer
  • A license plate consists of 2 letters followed by 1 digit. How many license plates are possible if the first letter can be any l
    13·1 answer
  • Wow, in this century, technology have been the most valuable. What is the worst of using the hi-tech phones
    13·2 answers
  • If you forget your privacy password what will you do if the ask this question what is the name of one of your teacher?​
    12·1 answer
  • Complete the getOdds method so it returns a new ArrayList of Integers containing all odd Integers from the parameter ArrayList v
    13·1 answer
  • PLEASE ANSWER AND HURRY I'LL MARK YOU BRAINLIEST!!<br><br><br>​
    9·1 answer
  • Javier downloads an illustration from an online Image library and modifies it for his purposes. The illustration he downloads is
    12·1 answer
  • !!! 20 points !!!!!
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!