Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

WIkipedia pages have a specific webpage address. Any address starts with https://en.wikipedia.org/wiki/ and then continues with the topic for that page e.g. Computer_science , Java_(programming_language)

WIkipedia pages have a specific webpage address. Any address starts with https://en.wikipedia.org/wiki/ and then continues with the topic for that page e.g. Computer_science, Java_(programming_language). See examples below:

https://en.wikipedia.org/wiki/Computer_science

https://en.wikipedia.org/wiki/Java_(programming_language)

https://en.wikipedia.org/wiki/Imagine_Dragons

Write a program that reads a string from the user. If it is a valid wikipedia webpage, it extracts and prints the topic for that page. If it is not a valid address it prints the message Not a valid wikipedia webpage address. Hint: How can the fact that all valid addresses start with the same text before the topic name help you extract the topic name? You do NOT need to handle the case where the webpage address is correct, but it is written in uppercase letters. You can assume it is all lowercase.

the text is all in lowercase and

if the address is valid, then it will have at least one more character for the topic. That is, you do not need to handle an input like: https://en.wikipedia.org/wiki/.

---- Sample run 1

This program will extract the topic from a valid Wikipedia webpage address.

Enter a web address: https://en.wikipedia.org/wiki/Computer_science

Topic: Computer_science

Bye.

---- Sample run 2

This program will extract the topic from a valid Wikipedia webpage address.

Enter a web address: http://vlm1.uta.edu/~alex/courses/1310/homework/hw02.html

Not a valid wikipedia webpage address.

Bye.

---- Sample run 3

This program will extract the topic from a valid Wikipedia webpage address.

Enter a web address: https://en.wikipedia.org/wiki/

Topic:

Bye.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

Write short notes on Interviews.

Answered: 1 week ago

Question

Define induction and what are its objectives ?

Answered: 1 week ago

Question

Discuss the techniques of job analysis.

Answered: 1 week ago

Question

How do we do subnetting in IPv6?Explain with a suitable example.

Answered: 1 week ago

Question

Explain the guideline for job description.

Answered: 1 week ago