Concept explainers
Lab #5 - The Psychic
One stormy night, as Dionne worked diligently on her Computer
Objective - To write a program that will predict the future Method - 1. Use the main procedure to
a. Prompt the user for his/her lucky number. Use this number as input to the srand function found in cstdlib
b. Prompt the user for which life topic he wishes his predictions based. Based on the user's response call one of three functions. Suggestions are love, finance, and school, but you may use three of your own choosing. Use a nested if-else statement to control which function is called.
2. Each function will
c. Call the rand function
d. Use value generated by the rand function and modulo division as the selector expression in a switch statement.
e. Theswitchstatementwillprintoutthepredictions.
f. Allow for five different predictions per function.
3. Prompt the user to see if they want another prediction. Keep executing the program until the user tells you to quit. Make sure that you code for all possible user inputs, including wrong ones.
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images
- Use the Java coding language to code a chess game.arrow_forwardWrite a small Django app that tracks a "to-do or task list." Each item in your list should have a name, status, date created, date completed, description, category, and anything else you can imagine. BUT keep it simple. You must have an admin panel.arrow_forwardDiscussion Topic: what does it mean to grow up. Questions. 1.What elements of short stories stand out the most? How do elements like setting, symbolism, or characterization help us understand a story's meaning? 2. What popular movies or TV shows address the topic of coming of age? Choose one and discuss how it answers the question "What does it mean to grow up?" 3. What did you read or learn in this Module that was surprising or unexpected? What surprised you? 4.How did the literary works illustrate the ideas of this Module?arrow_forward
- How are handler interfaces being designed to be more energy-efficient, especially in battery-operated devices?arrow_forwardWrite a VB.net program that will ask the user to input your favorite color, and display it as Your favorite color (inputted color)arrow_forwardBob uses the RSA cryptosystem to allow people to send him encrypted messages. He selects the parameters: p=3,q=17,e=3,d=11arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education