This problem is solved by providing the code in VBA excel it is not complicated and it is well in reach of any computer science or engineering major. Please read the entire problem. Problem: You are going to tell the user’s fortune! Ask the user to think of a number between 1 and 9. Then use a series of message boxes to give the user the following instructions: Multiply their number by three. Add three to the result. Multiply the whole thing by three. Add the digits of their final number together. You will read their minds as they look at their fortune on the spreadsheet and highlight the message corresponding to their final number even though you do not know what number they originally picked! Here are some specific instructions about how I want you to do the above problem. Read all these instructions carefully. Do not waste time doing things that I am not asking you to do. Put your code in a module. (VBA EXCEL) Use four variables to hold the four instruction bullets above (one variable per instruction.) Use five message boxes. One to give the user the original instruction about thinking of a number, and one using each of the four message variables. Note, you do not need to ask the user for the number they are choosing or do any calculations. Only do the things you are being asked to do in these instructions. If you ask them for their number, you are not reading their mind!

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

This problem is solved by providing the code in VBA excel it is not complicated and it is well in reach of any computer science or engineering major. Please read the entire problem.

Problem:

You are going to tell the user’s fortune! Ask the user to think of a number between 1 and 9. Then use a series of message boxes to give the user the following instructions:

  • Multiply their number by three.
  • Add three to the result.
  • Multiply the whole thing by three.
  • Add the digits of their final number together.

You will read their minds as they look at their fortune on the spreadsheet and highlight the message corresponding to their final number even though you do not know what number they originally picked! Here are some specific instructions about how I want you to do the above problem. Read all these instructions carefully. Do not waste time doing things that I am not asking you to do.

  1. Put your code in a module. (VBA EXCEL)
  2. Use four variables to hold the four instruction bullets above (one variable per instruction.)
  3. Use five message boxes. One to give the user the original instruction about thinking of a number, and one using each of the four message variables.
  4. Note, you do not need to ask the user for the number they are choosing or do any calculations. Only do the things you are being asked to do in these instructions. If you ask them for their number, you are not reading their mind!
Expert Solution
Step 1

The VBA EXCEL code for above problem is 

 

Private Sub Start_Click()
   
    Dim message1, mesage2, message3, message4 As String
    MsgBox "Think of a number between 1 and 9", Title:="Read Mind"
    message1 = "Multiply number by 3"
    message2 = "Add 3 to result"
    message3 = "Multiply result by 3"
    message4 = "Add the digits"
    MsgBox message1, Title:="Read Mind"
    MsgBox message2, Title:="Read Mind"
    MsgBox message3, Title:="Read Mind"
    MsgBox message4, Title:="Read Mind"
    Dim K As Integer
    K = CInt(1 + Rnd * 9)
    MsgBox "Is this number you thought" & vbNewLine & K, Title:="Read Mind", Buttons:=vbYesNo
End Sub

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 7 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education