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

Highway Project Project The Department of Highways in South Carolina was exploring ways to reduce the...

Highway Project Project

The Department of Highways in South Carolina was exploring ways to reduce the road construction costs and developed new contracting processes to allow the road builders to bring new ideas for cutting costs. On one project, the contractor proposed cost-cutting ideas throughout the life of the project. At each phase, the client accepted many of the ideas and then revised the budget. The client promoted the revised cost target of the project as an example of the success of the new process. By the end of the project, the final cost was less than 1 percent over the newest target. Although the total cost of the project was almost 10 percent less than the original cost projections and contract obligations, the success of the project was connected to the new expectations that developed during the life of the project. Even though this project performance exceeded the original goal, the client was disappointed.

Biotech Project

A biotechnology company developed a new drug that proved to have a large market demand, and the team that developed the drug was assigned to build a new manufacturing facility to produce the drug. The project manager for the construction company that was awarded the contract to build the manufacturing facility managed the project effectively. Every request for a change in scope was approved, and the result was a 20 percent increase
to the total cost of the project. On most projects, a 20 percent increase in the project cost would be considered poor performance. For the client’s project team, who were accustomed to complex projects with a large number of unknown issues that increase the final cost of the project, a 20 percent overrun in cost was not unusual. Even though the project was 20 percent over budget, the client was happy. Client satisfaction is often tied to expectations about project performance. Identifying and managing those expectations is a primary responsibility of the project manager.

Discussion

What are the differences between the two projects? Identify the single most important difference between the two projects that affected client satisfaction. Suggest an approach to managing client expectations in the highway project that might have resulted in meeting or exceeding expectations rather than disappointment.

In: Computer Science

I am coding with NetBeans LDE Java. Write a program that reads a positive integer n...

I am coding with NetBeans LDE Java.

Write a program that reads a positive integer n , prints all sums from 1 to any integer m 1≤mn . For example, if n=100, the output of your program should be

The sum of positive integers from 1 to 1 is 1;

      The sum of positive integers from 1 to 2 is 3;

      The sum of positive integers from 1 to 3 is 6;

      The sum of positive integers from 1 to 4 is 10;

      The sum of positive integers from 1 to 5 is 15;

*

*

*

*

      The sum of positive integers from 1 to 100 is 5050.

(The program should include a main method, and no tester class is needed)

In: Computer Science

Convert the following hexadecimal representations of 16-bit 2’s complement binary numbers to decimal. a.FCAD b.DEAD c.1111...

Convert the following hexadecimal representations of 16-bit 2’s complement binary numbers to decimal.

a.FCAD

b.DEAD

c.1111

d.8000

e.FACE

In: Computer Science

write a program in C language Create a function to perform the insertion sort. Now the...

write a program in C language

Create a function to perform the insertion sort. Now the program will perform the following steps:

  1. Prompt the user to enter the number of array elements (say, N).
  2. Read the number of elements (N).
  3. Use dynamic memory allocation to allocate an array of N single precision floating-point elements (C type float).
  4. Read the N single precision floating-points elements to the allocated array.
  5. Invoke a function to sort the array using insertion sort (the insertion sort function should take the array reference and number of elements as the arguments and sort the array in-place). The insertion sort function should have the return type as void, i.e., it does not return anything.
  6. Print the sorted array.

Code snippet:

1. Function Declaration

void displayArray(float *arr, int size); 
void sortArray(float *arr, int size); 

2. Function definition

void displayArray(float *arr, int size){ 
    printf("["); 
    for (int i=0; i<size-1; i++) { 
            printf("%f, ",arr[i]); 
    } 
    printf("%f]\n", arr[size-1]);      
} 

3. Function call/invocation

displayArray(arr, N); 
sortArray(arr, N); 

4. Dynamic memory allocation for array

float *arr = (float*) malloc(N * sizeof(float)); 

In: Computer Science

You will write a PHP program to calculate the payment receipt for renting a number of...

You will write a PHP program to calculate the payment receipt for renting a number of movies, using a conditional structure.

Suppose that the rental rate depends on the number of movies rented by a customer at a time. There is a limit of renting a maximum of 20 movies at a time.

Conditions: For the first 2 movies rented, the rate is $5.50/movie. For the next 2 movies rented, the rate is $4.25/movie. For the next 3 movies rented, the rate is $3.00/movie. For any more movies rented (no more than 20), the rate is $2.00/movie.

Hence, if a customer rents 5 movies, two of those will be rented at $5.50, two for $4.25 and one for $3.00, for a total of (2*$5.50) + (2*$4.25) + $3.00 = $22.50.

1) Create a form that asks the customer for his/her name and the number of movies he/she would like to rent. On submit, display the total amount due (shown to 2 decimal places) on the same page. (15 points) 2) Save the customer’s submitted name in a flat file called “visitor.txt”. You should overwrite this name every time someone submits a name to the form. (10 points)

Give appropriate error or warning messages for both 1) and 2).

In: Computer Science

Problem 1: You have two sorted lists of integers, L1 and L2. You know the lengths...

Problem 1:

You have two sorted lists of integers, L1 and L2. You know the lengths of each list, L1 has length N1 and L2 has length N2.

Design a linear running time complexity algorithm (ONLY PSEUDOCODE) to output a sorted list L1 ∧ L2 (the intersection of L1 and L2).

Important Notes:

For this problem, you don’t need to submit any implementation in Java. Only the pseudocode of your algorithm is required.

Pseudocode is a simple way of writing programming code in English. It uses short phrases to write code for programs before you actually create it in a specific language.

• Example of pseudocode:

Set total to zero
Set grade counter to one
While grade counter is less than or equal to ten

Input the next grade

Add the grade into the total
Set the class average to the total divided by ten

Print the class average.

Please make sure answer is given in pseudocode

In: Computer Science

Here is an interaction in a tic-tac-toe game, with user input in bold: >> gm =...

Here is an interaction in a tic-tac-toe game, with user input in bold:

>> gm = Game.new('andy', 'mike')
=> #<Game:0x2e91d78 @players=[Andy, Mike]>

>> gm.play_game('mike') Mike, enter your next O O--
---

---
Andy, enter your next X
O-X
---
---
Mike, enter your next O
O-X
-O-
---
Andy, enter your next X move
Bad move dude! You go again.
O-X
-O-
---
Andy, enter your next X move
O-X
-OX
---
Mike, enter your next O move
O-X
-OX
--O
Mike, you won!
=> nil
>> gm.play_game('karen')
I don't know that player. Please try again. => nil

>> gm.play_game('andy')
Andy, enter your next O move (1-9): 5 ---
-O-
---

When a new game is created, two players register with it by name (the arguments to Game.new). The play_game message is called with one of the player’s names and starts a new game where that player plays first using the O marker. (A game can be sent repeated play_game messages so the same pair of players can play multiple games). In each iteration, the current player is prompted for the position of her move and then she enters the move number, where the nine squares are numbered in row-major order from 1 through 9. If a move is illegal (i.e., already occupied), the current player is scolded and prompted again for a move. After each move, the board is redrawn. A game ends when either one of the players forms a horizontal, vertical, or diagonal row of her three markers (in the usual way), or the board is full indicating a tie.

The assignment is not to implement this game in Ruby. Rather, the assignment is to develop sequence diagrams to discover the objects, their responsibilities, and the messages they respond to. Specifically, focus on these two scenarios:

  1. Where the current game is not over, the current player is prompted for a legal move which she supplies and then the move is made and the updated game board is displayed.

  2. A new game is started and then play iterates between the two players until one of the players wins.

Note that the first scenario is lower level than and fits into the second scenario.

In: Computer Science

LINUX/UNIX Create a script named favcolor.sh. Take 2 parameters, 1. Username, 2. Favorite color. Print any...

LINUX/UNIX

Create a script named favcolor.sh.

Take 2 parameters, 1. Username, 2. Favorite color.

Print any sentence on console using these 2 parameters.

In: Computer Science

write a c++ program . Ask the user to enter a number less than 100. Test...

write a c++ program

. Ask the user to enter a number less than 100. Test the input to make sure it is correct, and use a while loop to continuously ask the user for correct input value if they don't follow the input rule. After receiving the correct input, test the number to see if it is even or odd. If it is odd, use a while loop to do the following: Output to the monitor all odd numbers from 1 to your input value. If the number is even, use a while loop to output to the monitor all the even numbers from 0 to your input value.

In: Computer Science

If you can run “traceroute/tracert” between machines in your organization. List three concrete applications to use...

  1. If you can run “traceroute/tracert” between machines in your organization. List three concrete applications to use trace route for cybersecurity?
  1. How to use ”netstate/netstat” to discover malicious activities in your machine?
  1. Install and use Process Monitor “Procmon” (you can download from https://docs.microsoft.com/en-us/sysinternals/ (Links to an external site.)) and then show how to list all running processes that run “RegCreateKey” operation with unsuccessful results.
  1. Show how to use Nmap to do IP scanning using TCP and ICMP and port scanning using Stealth FIN. Show the command and the output.

In: Computer Science

Create a Binary Search Tree with the following elements in the order mentioned below: 5, 85,...

Create a Binary Search Tree with the following elements in the order mentioned below:

5, 85, 89, 3, 2, 8, 65, 92


Print the Pre-order of this tree

Print the height and the balance factor of the nodes in the order they were inserted (5, 85, 89, 3, 2, 8, 65, 92) in the form of a table with three columns and 9 rows. Use column headers “Node”, “Height”, and “Balance Factor” for the three columns respectively. Use the following table as reference for your output. Don't worry about printing the table borders. Note: You are not balancing the tree. You are just computing the heights and balance factors of a BST.


Typed JAVA Program!
Java language

In: Computer Science

write a MIPS program to ask user to input the number of elements of array

write a MIPS program to ask user to input the number of elements of array

In: Computer Science

A disk drive has 300 cylinders, numbered 0 to 299. The drive is currently serving a...

  • A disk drive has 300 cylinders, numbered 0 to 299. The drive is currently serving a request at cylinder 51, and the previous request was at cylinder 56. The pending requests are received in the following order: 72, 56, 103, 111, 17, 189, 236, 198, and 88.
  • FCFS
  • SSTF
  • SCAN

Compare the algorithms and determine which is the fairest for the next process in the queue. Explain why this algorithm will always be the fairest disk-scheduling algorithm.

Describe an example of circumstances where fairness would be an important goal. Describe a scenario where it would be important that the operating system be unfair. Minimum 250 words.

In: Computer Science

Write a function that tells whether a hailstone sequence contains a number that is greater than...

Write a function that tells whether a hailstone sequence contains a number that is greater than 1000.

Write a contract, then an implementation, of a function that takes exactly one parameter, an integer n, and returns true if the hailstone sequence starting with n contains a number that is greater than 1000, and returns false otherwise. The heading must be as follows.

  bool bigHailstone(int n)

This function must not read or write anything.

Your algorithm for bigHailstone must be a search algorithm. As soon as it sees a number that is greater than 1000, bigHailstone must return true without looking at any more numbers in the hailstone sequence starting with n.

Modify your main function so that it also shows whether there is a number that is greater than 1000.


C++

In: Computer Science