Create a simple horoscope app that does the following: Reads in from a .txt file the horoscope for the sign and outputs to the screen. Writes the user's horoscope to a file as a .txt file and saves it...


Create a simple horoscope app that does the following:



  • Reads in from a .txt file the horoscope for the sign and outputs to the screen.

  • Writes the user's horoscope to a file as a .txt file and saves it for the user.


For instance:


You might keep a 'horoscopes.txt' file where the horoscopes are pre-written in this format (you create this file, make up your own horoscope messages - have fun with it =):


Aries


You will find money this week.
Taurus


You will find love this week.
Gemini


You will find a job this week.
Cancer


Your future is looking bright


.....[etc.]



Then your program will greet the user and ask the user for their sign. The user types in their sign. Your program will then read in the right horoscope from the 'horoscopes.txt' file and output the correct horoscope back to the user. The user is then prompted on whether they want their horoscope saved out to a file, if the user says yes, you will save the horoscope of the user out to a file called 'MySavedHoroscopes.txt'.





Example Running of Program (user input is depicted with >):


Welcome to the Horoscope App!


Would you like to know your horoscope? y/n:


>y


What is your sign?


>Sagittarius


Your horoscope: "Beware, don't trust everyone you speak to today"


Would you like to save this horoscope? y/n:


>y


Horoscope saved out to MySavedHoroscopes.txt!


Welcome to the Horoscope App!


Would you like to know your horoscope? y/n:


>n


Thank you for using this app!



Your program must have:



  • Obviously at least one loop structure

  • Obviously at least one selection structure

  • Obviously file input/output

  • At leasttwofunctions

Oct 14, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here