Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 305 Weeks Ago, 1 Day Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Communications Posted 28 Aug 2017 My Price 15.00

mystical or special relationship

Note: I need this program in C++ language

 

Numerology is the "study of the purported mystical or special relationship between a number and observed or perceived events." It has been used throughout human history as a way to attach meaning to a name, object or event using mathematics. It is considered a "pseudoscience" by modern scientists since it has no basis in observable phenomena. With that said, it's a good example of manipulating characters and strings, so we're going to go with it!

 

One version of numerology ascribes meaning to the following numbers:

 

0 = emptiness, nothingness, blank

 

1 = independence, loneliness, creativity, originality, dominance, leadership, impatience

 

2 = quiet, passive, diplomatic, co-operation, comforting, soothing, intuitive, compromising, patient

 

3 = charming, outgoing, self expressive, extroverted, abundance, active, energetic, proud

 

4 = harmony, truth, justice, order discipline, practicality

 

5 = new directions, excitement, change, adventure

 

6 = love, harmony, perfection, marriage, tolerance, public service

 

7 = spirituality, completeness, isolation, introspection

 

8 = organization, business, commerce, new beginnings

 

9 = romantic, rebellious, determined, passionate, compassionate

 

11 = idealism, visionary, inspirational

 

12 = perfectionist, discriminating

 

22 = builder, leader, humanitarian, practical, honest

 

What you want to do for this project is to ask the user to type in their name. Next, you will need to use a technique called "theosophical reduction" to convert their name into a number. For example, the letter "a" is equal to the number 1. "b" = 2, "c" = 3, etc. Once you.ve gotten all of the letters converted into numbers you can add them up.

 

So for the name "craig" the numerology number would be:

 

c = 3
r = 18
a = 1
i = 9
g = 7

 

3 + 18 + 1 + 9 + 7 = 38

 

However, 38 is not on the "personality trait" lookup table above, so we need to further reduce the number by adding up its individual digits like so:

 

3 + 8 = 11

 

The number 11 is on the personality traits table, so we can print out for the user what the traits for the name they entered are based on this number.

 

Processing Requirements

 

For this assignment, you will write two versions of the numerology program. Name these two program files assign1a.cpp and assign1b.cpp. The first version of the program will use objects of the C++string class to store strings. The second version will use C strings (null-terminated arrays of char) to store strings.

 

The logic for both versions of the program is similar:

 

Prompt the user to enter a name.

 

Read the string the user types. Keep in mind that a name may contain a non-alphabetic character such as a hyphen, apostrophe, or even a space.

 

Loop through the characters of the string, converting them to numbers and adding the numbers to a sum.

 

If the sum is equal to one of the numbers in the "personality trait" table above, you've found the traits for this name. If not, you'll need to further reduce the number as follows:

 

Convert your sum to a new string.

 

Loop through the characters of this new string, converting them to numbers and adding the numbers to a sum.

 

Go back to Step #4.

 

Print the traits for the name.

 

Ask the user whether or not they want to enter another name, and read their response. If the response is "y" or "Y", go back to Step #1.

 

Some useful string-manipulation techniques for this assignment are described below.

 

Reading a string that contains whitespace

 

While the >> operator can be used to read a string of characters into either a C++ string object or an array of char, it will not work correctly if the string entered by the user contains whitespace (a space or tab), because it stops reading characters the moment it hits whitespace.

 

The getline() function in the header file <string> can be used to read a string that contains spaces or tabs into a C++ string object.

 

The getline() method of the istream class in the header file <iostream> can be used to read a string that contains spaces or tabs into an array of char.

 

Converting the characters of a string to numbers

 

Write a function to convert a character to a number. This function should take a char argument and return an int. Here's some possible logic for the function:

 

If the character is a letter, return the corresponding number from 1 to 26 ('A' or 'a' = 1, 'B' or 'b' = 2, 'C' or 'c' = 3, etc.).

 

If the character is a digit, return the corresponding number from 0 to 9 ('0' = 0, '1' = 1, '2' = 2, etc.).

 

Otherwise, return 0 (so that this character has no effect on the sum).

 

Remember that characters in C++ are actually stored as small integers. This means that you can easily convert a letter or digit character to an integer simply by performing some basic math. A big cascadingif or switch statement is not the way to do the conversion!

 

You can use the character functions found in the C standard library header file <cctype> to determine whether a character is a letter or a digit, and to convert all of the letters to the same case.

 

Converting numbers to strings

 

This page has some discussion of converting strings to numbers to strings, including example code for both C++ strings and C strings.

 

Sample Output

 

Both versions of the program should produce the same output. Here's a sample run of the program with several names used as input:

Numerology Program Enter a name: Kurt That name has the traits spirituality, completeness, isolation, introspection Another? (y/n) y Enter a name: Amy That name has the traits perfectionist, discriminating Another? (y/n) Y Enter a name: Joe Bob That name has the traits harmony, truth, justice, order discipline, practicality Another? (y/n) y Enter a name: Xiao-Li That name has the traits spirituality, completeness, isolation, introspection Another? (y/n) y Enter a name: Prasad That name has the traits new directions, excitement, change, adventure Another? (y/n) n

Answers

(5)
Status NEW Posted 28 Aug 2017 01:08 PM My Price 15.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)