Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hey, I am stuck on the below problem. Thanks! In Numerology, every name has a number between 1 and 9 related to it. Given a

Hey, I am stuck on the below problem. Thanks!

image text in transcribedimage text in transcribed

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

In Numerology, every name has a number between 1 and 9 related to it. Given a name, we can calculate the person's name number. Once we know the name number we can predict things about the person. Program Details We start by assigning every letter a value between 1 and 9 . A table containing the number related to each letter is given below (Cheiro 48 53). \begin{tabular}{|l|l|} \hline Letter & Number \\ \hline A & 1 \\ \hline B & 2 \\ \hline C & 3 \\ \hline D & 4 \\ \hline E & 5 \\ \hlineF & 8 \\ \hline G & 3 \\ \hline H & 5 \\ \hline I & 1 \\ \hline J & 1 \\ \hlineK & 2 \\ \hline L & 3 \\ \hline N & 4 \\ \hline & 7 \\ \hline S & \\ \hline \end{tabular} \begin{tabular}{|l|l|} \hlineP & 8 \\ \hlineQ & 1 \\ \hlineR & 2 \\ \hline S & 3 \\ \hlineT & 4 \\ \hlineU & 6 \\ \hlineV & 6 \\ \hlineW & 6 \\ \hlineX & 5 \\ \hlineY & 1 \\ \hlineZ & 7 \\ \hline \end{tabular} To compute a name number we need a name as an example. We will use "Louis" as our example name. First, we figure out the number related to each letter of the name. L=3,O=7,U=6,I=1,S=3 Next, we add all the numbers together. 3+7+6+1+3=20 Originally, we noted that every name number is between 1 and 9 . We just computed 20 ! If the value computed is larger than 9 , we add the digits together. Depending on how big the number is, you may need to add the digits multiple times before it is between 1 and 9. 2+0=2 We have determined that the name number for "Louis" is 2. Next, we need to see what this predicts about Louis. We match the number up with the following chart (Cheiro 48-53). \begin{tabular}{|l|l|} \hline Name Number & \multicolumn{1}{|c|}{ Meaning } \\ \hline 1 & A person who is successful in personal ambitions. \\ \hline 2 & A gentle and artistic person. \\ \hline 3 & A success in their professional career. \\ \hline 4 & An unlucky person who much put in extra work for success. \\ \hline 5 & A lucky person who leads an unconventional life. \\ \hline 6 & A person who commands the respect of others. \\ \hline 7 & A person who has a strong inner spirit. \\ \hline 8 & A person who is misunderstood by others and is not respected for their success. \\ \hline 9 & A person who is more successful in matters of the material than spiritual. \\ \hline \end{tabular} You will write a program that asks the user for their name and produces their name number. If given any characters not on the list (spaces, hyphens, etc) count them as 0 . They do not contribute to the name number. Required Functions You will solve this problem by writing three functions. - def sumpigits ( number) takes a number a repeatedly sums the digits until the number is smaller than 10. You may assume the number give is always positive. - def nameNumber (name) takes a string containing a name as input. It returns the name number and integer between 1 and 9 . The function will return 0 on bad input, for example an empty string. - def prediction (number) takes an integer between 1 and 9. It returns the meaning of the number. If a number outside the range is given return "Invalid Input" as the result string. You must use a dictionary to organize the predictions. Here are some examples of how the program will work. Welcome to Name Number Generator Enter Your Name: Louis Your Name Number is 2 We predict you are: A gentle and artistic person. Welcome to Name Number Generator Enter Your Name: Abc12\%s Your Name Number is 6 We predict you are: A person who commands the respect of others. Welcome to Name Number Generator Enter Your Name: Hubert Blaine Wolfeschlegelsteinhausenbergerdorff sr Your Name Number is 7 We predict you are: A person who has a strong inner spirit. Notes: - The purpose of this problem is to practice using loops. - Please make sure to submit a well-written program. Good identifier names, useful comments, and spacing will be some of the criteria that will be used when grading this assignment. - This assignment can be and must be solved using only the materials that have been discussed in class. Do not look for or use alternative methods that have not been covered as part of this course. - The website DiffChecker can be useful for debugging output. How your program will be graded: - correctness: it performs as specified and produces correct results: 50% - complies with requirements (it properly uses loops): 40% - code style: good variable names, comments, proper indentation and spacing : 10%

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

Algorithmic Trading Navigating The Digital Frontier

Authors: Alex Thompson

1st Edition

B0CHXR6CXX, 979-8223284987

More Books

Students also viewed these Databases questions

Question

Do you think that project evaluations cost-justify themselves?

Answered: 1 week ago

Question

Evaluate employees readiness for training. page 275

Answered: 1 week ago