Questions
Implement in C++ a game called “Your Lucky Number”. The lucky number is calculated based on...

Implement in C++ a game called “Your Lucky Number”. The lucky number is calculated based on an individual’s birth month, day, and year. The algorithm assigns any person a number between 1 and 9. Many people believe that a group of people with the same lucky number share common features. The lucky number is calculated as the sum of digits of the birth month, day, and year numbers. If this sum is not a single digit then you need to keep adding up its digits. Use the C++ functions when you implement the game. Test your program for corrections. To start the game you should enter your full birthdate in the format: month day year, e.g. 9 21 1985. The month is represented by its corresponding integer: January is 1, February is 2, ..., and December is 12. Be sure that your program will verify the input format and print an error message when the format is incorrect (use exceptions), and will ask to re-enter the birthdate again.

The algorithm for calculating the lucky number

(a) Enter the month as an integer from 1 to 12.

(b) Reduce the month, day and year numbers down to a one-digit number by adding all digits in month, day and year numbers, see the example below.

(c) Map the number to the category listed below and display the message on the screen with at least four features for a person in each category. I provided only one feature (as an adjective) for each category and you should complete the list.

(d) Test your program using at least 10 your friends’ or relatives’ birthdays.

(e) Provide statistics in the README file about the results of your testing by giving the percentage of people that confirm that they belong to the category calculated by your program. Write in the README file about what you have learned by writing this assignment. Write also about your (possible) problems, errors or mistakes.

Categories:

1. The Leader: original thinker (add 3 more features)

2. The Mediator: diplomatic (add 3 more features)

3. The Communicator: expressive (add 3 more features)

4. The Teacher: trustworthy (add 3 more features)

5. The Freedom Seeker: adventurous (add 3 more features)

6. The Nurturer: family-oriented (add 3 more features)

7. The Seeker: analytic (add 3 more features)

8. The Power House: authoritative (add 3 more features)

9. The Humanitarian: charitable (add 3 more features)

In: Computer Science

Topic 2 TRUE OR FALSE Q’s 31.          A natural number is the number 0 or any...

Topic 2 TRUE OR FALSE Q’s

31.          A natural number is the number 0 or any number obtained by adding 1 to a natural number.

32.          The category of numbers called integers includes negative numbers.

33.          A rational number is any number that can be expressed without a fractional part.

34.          The base of a number system determines the number of digits used in the system.

35.          The digits used in any base are 1 through the base number.

36.          The base of the hexadecimal number system is 15.

37.          A number in any base can be expressed using a positional notation.

38.          The letter C is used to represent the number 11 in hexadecimal.

39.          The number 10 represents the base value in every number system.

40.          Representing a number in base 5 sometimes requires more digits than representing that same number in base 10.

41.          The value of each position in a number system is determined by subtracting the base from the position number.

42.          A byte is made up of eight binary digits.

43.          Two hexadecimal digits can be stored in one byte.

44.          Starting from the right, every group of four binary digits can be read as one hexadecimal digit.

45.          To find the decimal equivalent in a new base you just divide the decimal value by the new base.

In: Computer Science

Number assigned is #5 The classmate I chose have the number #10 The answers should be...

Number assigned is #5

The classmate I chose have the number #10

The answers should be written as this one below:

*Just fill the table

A

B   

Cin

I1   

I0

Output

Cout   

Function Performed

Assignment directions:

Part 1.

The Arithmetic/Logic Unit (figure 2.11 of your handout as posted in Blackboard) [in your course note] we discussed in Section I E of the Module 2 a simple ALU capable of performing only four functions namely:

1) A AND B;
2) A OR B;
3) NOT B;
4) A plus B plus the Carry-in

Now, show your understanding of that simple ALU by giving the following for a set of inputs based on the 6 bit binary representation of your # in Class Members (see table below with your names in it). Note: For this exercise, you will be using the 5 least significant bits (LSB) based on your number!

1) the OUTPUT and CARRY OUT outputs


2) the type of calculation (AND, OR, NOT, or plus)


where the 5-bit inputs represent A, B, Carry-in, I1, and I0 respectively.


For example: "#35. Deborah Askew" has a binary value of 100011 but using the 5 least significant bits (colored in red) with A = 0, B = 0, Carry-in (Cin) = 0, I1 = 1, and I0 = 1.

In this example, for Deborah Askew, since I1 = 1, and I0 = 1, then the ALU will be performing ADDITION (SUMMING). It will be performing addition on the data inputs seen on A, B, and Cin: where A = 0, B = 0, and Cin = 0.

Hence, 0 + 0 + 0 implies Output = 0 and Carry-Out = 0

Number

Student Name

X

A

B

Cin

I1

I0

Output

Cout

Function Performed

35

Deborah

Askew

1

0

0

0

1

1

0

0

ADDITION

Here is another example for Ingram James whose number is #40.

Six-digit binary is: 101000

Using the 5 LSB, 01000, we have A = 0, B = 1, Carry-in (Cin) = 0, I1 = 0, and I0 = 0.

Since I1 = 0 and I0 = 0, then the ALU will be performing the AND function on the inputs A and B.

So, A AND B implies Cout = 0 and Output = 0.

Number

Student Name

X

A

B

Cin

I1

I0

Output

Cout

Function Performed

40

Ingram

James

1

0

1

0

0

0

0

0

AND

Now, you will be doing a similar analysis as above two examples for your unique number as given to you in the data table below.

Be sure to include your class number and the 6-bit representation in your response first but again, you must use the five LSB for your interpretation!

_ _ _ _ _ _

Part 2

Now pick another classmate's number randomly in the data table provided below and repeat part 1 steps for the number picked.

______________

Part 3

Now research the Internet and other sources to find other functions that the typical modern day ALU can perform. The ALU we discussed in class can perform only four functions that include AND, OR, NOT B, and ADDITION.

Your response to this part should provide information about the following:

  1. The additional functions identified (Do not include Functions already discussed in class or course notes)!
  2. The computer that the ALU is used on;
  3. The source of your information (citation).

In: Computer Science

Part 3 Write a C++ program that prompts the user for an Account Number(a whole number)....

Part 3

Write a C++ program that prompts the user for an Account Number(a whole number). It will then prompt the user for the initial account balance (a double). The user will then enter either w, d, or z to indicate the desire to withdraw an amount from the bank, deposit an amount or end the transactions for that account((accept either uppercase or lowercase). You must use a nested if statements instead of a Switch construct.

Test Run:

Enter the account number: 1

Enter the initial balance: 5000

SAVINGS ACCOUNT TRANSACTION

(W)ithdrawal

(D)eposit

(Z) to end account transaction

Enter first letter of transaction type (W, D or Z): w

Amount: $1000

Balance for this account is now: $4000.00

SAVINGS ACCOUNT TRANSACTION

(W)ithdrawal

(D)eposit

(Z) to end account transaction

Enter first letter of transaction type (W, D or Z): d

Amount: $500

Balance for this account is now: $4500.00

SAVINGS ACCOUNT TRANSACTION

(W)ithdrawal

(D)eposit

(Z) to end account transaction

Enter first letter of transaction type (W, D or Z): z

No more changes.

Balance for this account is now: $4500.00

Press any key to continue . . .

In: Computer Science

Part 2 Write a C++ program that prompts the user for an Account Number(a whole number)....

Part 2

Write a C++ program that prompts the user for an Account Number(a whole number). It will then prompt the user for the initial account balance (a double). The user will then enter either w, d, or z to indicate the desire to withdraw an amount from the bank, deposit an amount or end the transactions for that account((accept either uppercase or lowercase). You must use a switch construct to determine the account transaction and a do…while loop to continue processing.  

Test Run:

Enter the account number: 1

Enter the initial balance: 5000

SAVINGS ACCOUNT TRANSACTION

(W)ithdrawal

(D)eposit

(Z) to end account transaction

Enter first letter of transaction type (W, D or Z): w

Amount: $1000

Balance for this account is now: $4000.00

SAVINGS ACCOUNT TRANSACTION

(W)ithdrawal

(D)eposit

(Z) to end account transaction

Enter first letter of transaction type (W, D or Z): d

Amount: $500

Balance for this account is now: $4500.00

SAVINGS ACCOUNT TRANSACTION

(W)ithdrawal

(D)eposit

(Z) to end account transaction

Enter first letter of transaction type (W, D or Z): z

No more changes.

Balance for this account is now: $4500.00

Press any key to continue . . .

In: Computer Science

6. A. An isotope with atomic number 84 and mass number 212 emits an alpha particle....

6. A. An isotope with atomic number 84 and mass number 212 emits an alpha particle. what are the atomic number and mass number of the resultant atom?

B. An atom of atomic number 48 with a mass number of 113 emits A beta particle. What are the new atomic and mass numbers ?

7. Why does the pH change when CO2 dissolves in water ?

            
8. The 32 isotope of phosphorus has a half life of 14.3 days. How long will It take for a sample of 100g to decay to 12.5g of phosphorus?

9. The maximum legal limit of arsenic in water is 0.0500ppm (parts per million) for drinking water. Is water with 8.00x10-6 moles of As per liter suitable for drinking ? Show how you arrive at your answer.

10. How many grams of NaOH are in 2.00 liters of a 0.255molar solution ?

In: Chemistry

>>>>>C#<<<<< A.     Number Frequency-Arrays Write a program to count the number of 10’s in the given...

>>>>>C#<<<<<

A.     Number Frequency-Arrays

  1. Write a program to count the number of 10’s in the given list of 15 numbers. The output should look like:                                                                                                        [01]
  2. Extend your program to work with a list of n numbers.                                         [01]

                                                                                  

          Random Numbers-Methods

  1. Write a program to generate a 10 Random Numbers:                                           [01]
  2. Extend your program to generate n Random numbers.                                         [01]

B.    Word Count -String Processing

  1. Write a program to count the occurrence of word “an” in the string.               [01]
  2. Extend your program to count the occurrence of string being input in the string.

               [01]

C.      Recursion

          By using recursion, write a program to:

  1. Print digits in a number.                                                                                                                [01]
  2. Find sum of digits of a number.                                                                                                  [01]

D.        Matrix Manipulation

Write a C# program to Perform Matrix Multiplication.                                                                      [02]

Note:-

The matrix multiplication can be performed only if:

  • The number of columns of the first matrix is equal to
  • The number of rows of the second matrix

Ok sorry for that , i need only (A) section.

In: Computer Science

DISCUSSION QUESTION 5-1 MB670 Project Management Lesson 5: Risk Mitigation Discussion Question 1 (50 points) Describe...

DISCUSSION QUESTION 5-1

MB670 Project Management

Lesson 5: Risk Mitigation

Discussion Question 1 (50 points)

Describe what needs to be done to manage risk on a project. When should this be done? How can a risk assessment matrix help in this process? What risks for a project have the highest priority? Does the priority for a risk change as the project progresses? (50 points)  (A 2-page response is required.)

In: Nursing

With every presidential debate the big question is, “Who won?” Imagine you’re an independent pollster (not...

With every presidential debate the big question is, “Who won?” Imagine you’re an independent pollster (not tied to either party) and you’re tasked with determining who won the last debate. Describe (don’t list) two ways you would go about determining who won the debate with the highest degree of accuracy, tell me the pitfalls with both methods – and detail how you would be able to tell if your method is right.

In: Economics

Suppose the stock now sells at $100, and the price will either increase by 20% or...

Suppose the stock now sells at $100, and the price will either increase by 20% or decrease by 20% by the end of the year. The risk-free rate from now to year-end is 5%. Which of the following options that expires at year end must have the highest price?

a) A call option with strike price of $120.

b) A put option with strike price of $90.

c) A put option with strike price of $80.

d) Not enough information

In: Finance