Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java Code Program: Fortune teller You will make a program that tells a person's fortune in various categories. Before beginning, ask the user

Write a Java Code

Program: Fortune teller

You will make a program that tells a person's fortune in various categories.

Before beginning, ask the user to enter some information based on the following questions

What is your first name?

what is your last name?

what year were you born (enter 4 digits for the year)?

what month were you born (enter 1-12)

what day of the month were you born (enter 1-31)

after getting all of the user information present a menu with the following options and allow them to enter their choice by inputting the corresponding number

1. lucky number

2. magic number

3. horoscope

menu option 1: if the user chooses to view their lucky number

generate a random number from 1 to 8 (both inclusive.)

if the number is more than 3, but less than 8 display [name], you a very lucky person

if the number is 8 or 2 then display "[name], you are extremely lucky

if the number is 1 or 3 display "[name], you are just barely lucky

note: make sure to include the user,s name at the beginning of each statement this be done using the information they inputted at the beginning of the program

Menu option 2if the user chooses to view their "Magic number

you will use specific equation to decide the user's lucky number first make a constant variable called "Magic_Range with a value of 110. next, use the following formula to calculate out the lucky number: magicNumber = userYear * usermonth) % Magic_range

where userYear is the user's birth year at the beginning

Display the user magicNumber - underlined

Menu Option 3. if the user chooses to view horoscope

Based on the month and day entered above, determine the user's zodiac sign. after displaying the users zodiac print, out their daily horoscope (note: you can make this up).

Example : "Aries, you will have a good day today."

// there should be a unique horoscope for each sign the months and days for each zodiac sign is show below

// aries -

// taurus

//gemini

//cancer

//leo

//virgo

// libra

// scori

//sag

//cap

//aqua

//pisces

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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions