Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

💬 Motivational Quote Generator

A simple Java program that displays a random motivational quote each time it runs.


Features

  • Shows a random quote from a local file (quotes.txt)
  • Option to fetch a quote from the internet using the Quotable API (https://api.quotable.io)
  • Beginner-friendly Java example using:
    • Random
    • File I/O
    • HttpURLConnection

🏗️ How to Run

  1. Clone this repository or download the files.
  2. Make sure quotes.txt is in the same directory as MotivationalQuote.java.
  3. Compile and run: javac MotivationalQuote.java java MotivationalQuote
  4. Choose an option:
    • 1 → Show a random local quote
    • 2 → Fetch from API

Example Output

Choose an option:

  1. Show random local quote
  2. Fetch quote from API

Enter choice: 1

💬 Random Quote: Dream big. Start small. Act now.


📚 Tech Used

• Java
• File I/O
• Random class
• Basic API handling (HttpURLConnection)