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
A print server uses a print ________ as a software holding area for jobs waiting to be printed.
vichka [17]

Answer:

spooler

Explanation:

A print server uses a print spooler as a software holding area for jobs waiting to be printed.

8 0
2 years ago
Read 2 more answers
The processing of data in a computer involves the interplay between its various hardware components.
Ronch [10]

True.

Data processing involves the conversion of raw data and the flow of data through the Central Processing Unit and Memory to output devices. Each CPU in a computer contains two primary elements: the Arithmetic Logic Unit (ALU) and the control unit. The Arithmetic Logic Unit performs complex mathematical calculations and logical comparisons. On the other hand, the control unit accesses computer instructions, decodes them, and controls the flow of data in and out of the Memory, ALU, primary and secondary storage, and various other output devices.  


8 0
3 years ago
How are you doing this fine morning <br><br> hi
notka56 [123]
It's evening................∆
6 0
4 years ago
Read 2 more answers
Which of the following can technology NOT do?
Gnesinka [82]

make our life problem free

because technology has its negative effects on humanity like Social media and screen time can be bad for mental health

And technology is leading us to sedentary lifestyles

Technology is addictive

Insomnia can be another side effect of digital devices

Instant access to information makes us less self-sufficient

Young people are losing the ability to interact face-to-face

Social media and screen time can be bad for mental health

Young people are losing the ability to interact face-to-face

Relationships can be harmed by too much tech use

4 0
3 years ago
It's safe to download files from the internet if u perform regular Windows security updates, that is all u need to protect your
Vlad1618 [11]

Answer

TRUE

Explanation

A computer virus is a self-replicating program which are malicious and are designed to infect and gain control over a computer without the owner's knowledge.

To protect your computer from viruses especially when downloading files from the internet, it is advisable for one to perform regular windows security updates. This is because because windows have malware definitions to its windows defender and security essential utilities.

7 0
4 years ago
Read 2 more answers
Other questions:
  • What is the difference, if any, between secure HTTP and firewalls?
    13·1 answer
  • A nonpipelined system takes 300ns to process a task. The same task can be processed in a 5-segment pipeline with a clock cycle o
    10·1 answer
  • Priscilla is providing the junior analysts in her firm with some real-world illustrations to explain some of the recommendations
    12·1 answer
  • 2.4 Code Practice: Question 1
    10·1 answer
  • Are storage devices input devices
    8·1 answer
  • What type of activities are performed with the help of the software used in hospitals?
    7·2 answers
  • Website designers work on the code and programming of a website, not the style or layout of the site.
    9·1 answer
  • Which panel is used to make a website​
    8·1 answer
  • How do i change the default setting in word to no open in dark mode
    8·1 answer
  • Which Windows registry hive stores information about object linking and embedding (OLE) registrations
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!