43 | Website Generator |
Programming languages can create files and folders too.
Create a program that generates a website skeleton with the following specifications:
-
Prompt for the name of the site.
-
Prompt for the author of the site.
-
Ask if the user wants a folder for JavaScript files.
-
Ask if the user wants a folder for CSS files.
-
Generate an index.html file that contains the name of the site inside the <title> tag and the author in a <meta> tag.
Example Output
| Site name: awesomeco |
| Author: Max Power |
| Do you want a folder for JavaScript? y |
| Do you want a folder for CSS? y |
| Created ./awesomeco |
| Created ./awesomeco/index.html |
| Created ./awesomeco/js/ |
| Created ./awesomeco/css/ |
Challenges
-
Implement this in a scripting language on Windows, OSX, and Linux. ...
Get Exercises for Programmers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.