Create a program that will ask for a person’s name and out its magic number. (Refer to the table below)
The person’s magic number will be based on the person’s name. Each letter of the name corresponds to a number (refer to ascii value) Add the corresponding value and get the modulus division or 10.
Note: Use modulus division. Use Select Case Statement.
0 - you enjoy socializing and take on challenges just for fun. you are fickle-minded but are always ready to help someone in need.
1 - you are sure of yourself, make friends easily, and like to keep busy.
2 - you are quiet rather shy, and work easily with others.
3 - you are clever and artistic, and like to be with people.
4 - you are hardworking and dependable. you do not change your mind easily.
5 - you are smart, like to be active, and love adventure. but loose your temper easily.
6 - you are fair, unselfish, and careful of other people's feelings. you like to keep thing neat and organized.
7 - you like to be yourself and don't like to do what everyone else is doing. you think things out carefully.
8 - you like to plan things out and be sure you are right. you are kind hearted, and people know that they can trust you.
9 - you like people and you believe strongly in freedom. you are a clever thinker.
...Please help me with this. I'm using Bloodshed Dev-C++.
Access each character in the persons name with a range based for loop for( char c : name ) { /* .... */ }
or with the subscript operator for( std::size_t i = 0 ; i < name.size() ; ++i ) { char c = name[i] ; /* .... */ }