Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please create a number game in Excel with the following requirements and rules so that your program always wins the game against me. There are

image text in transcribed
image text in transcribed
Please create a number game in Excel with the following requirements and rules so that your program always wins the game against me. There are 2 players: your code vs me and the target is to have the highest sum at the end of the game. There should be 2 buttons on Excel sheet. First one is the START button. When I click on this button, there will appear 40 numbers (all are random integers between 1 and 100) in the first row. 40 numbers should be generated randomly which means that each time I start the game, the data set will be different For instance when I click on start button number generation can be like this: AM We will not use the start button again unless we want to restart the game. There will be a second button on the sheet which is called PLAY button. After generating the data set, you will start to play the game. To see your move I will click on play button and one of the numbers from either most right or most left side will disappear from the screen. Let's assume that your code deleted most left number which was 41. You will earn 41 points by this move and the sheet will be like this: 16 Then I will pick a number from most right or most left by selecting that cell, deleting it and adding that number to my sum manually. Let's assume that! select 43, deleted it and added this to my sum (B4). The updated screen will be like this: Now it's your turn. I will click on play button again and as previously your code did, a number would be picked from most right or most left and that number will be added to your sum (B3). Then I will make my move and I will click again on the Play button for your move. I will repeat the same steps until there is no number left in the screen. At the end of the game, the one who has a greater sum will win the game. If1 click on Start at anytime during the game, the game should restart. Please write a code with VBA which never loses the game against me. Please create a number game in Excel with the following requirements and rules so that your program always wins the game against me. There are 2 players: your code vs me and the target is to have the highest sum at the end of the game. There should be 2 buttons on Excel sheet. First one is the START button. When I click on this button, there will appear 40 numbers (all are random integers between 1 and 100) in the first row. 40 numbers should be generated randomly which means that each time I start the game, the data set will be different. For instance when I click on start button number generation can be like this: B. We will not use the start button again unless we want to restart the game. There will be a second button on the sheet which is called PLAY button. After generating the data set, you will start to play the game. To see your move I will click on play button and one of the numbers from either most right or most left side will disappear from the screen. Let's assume that your code deleted most left number which was 41. You will earn 41 points by this move and the sheet will be like this: HEM Then I will pick a number from most right or most left by selecting that cell, deleting it and adding that number to my sum manually. Let's assume that I select 43, deleted it and added this to my sum (B4). The updated screen will be like this: Now it's your turn. I will click on play button again and as previously your code did, a number would be picked from most right or most left and that number will be added to your sum (B3). Then I will make my move and I will click again on the Play button for your move. I will repeat the same steps until there is no number left in the screen. At the end of the game, the one who has a greater sum will win the game. If I click on Start at anytime during the game, the game should restart. Please write a code with VBA which never loses the game against me. Please create a number game in Excel with the following requirements and rules so that your program always wins the game against me. There are 2 players: your code vs me and the target is to have the highest sum at the end of the game. There should be 2 buttons on Excel sheet. First one is the START button. When I click on this button, there will appear 40 numbers (all are random integers between 1 and 100) in the first row. 40 numbers should be generated randomly which means that each time I start the game, the data set will be different For instance when I click on start button number generation can be like this: AM We will not use the start button again unless we want to restart the game. There will be a second button on the sheet which is called PLAY button. After generating the data set, you will start to play the game. To see your move I will click on play button and one of the numbers from either most right or most left side will disappear from the screen. Let's assume that your code deleted most left number which was 41. You will earn 41 points by this move and the sheet will be like this: 16 Then I will pick a number from most right or most left by selecting that cell, deleting it and adding that number to my sum manually. Let's assume that! select 43, deleted it and added this to my sum (B4). The updated screen will be like this: Now it's your turn. I will click on play button again and as previously your code did, a number would be picked from most right or most left and that number will be added to your sum (B3). Then I will make my move and I will click again on the Play button for your move. I will repeat the same steps until there is no number left in the screen. At the end of the game, the one who has a greater sum will win the game. If1 click on Start at anytime during the game, the game should restart. Please write a code with VBA which never loses the game against me. Please create a number game in Excel with the following requirements and rules so that your program always wins the game against me. There are 2 players: your code vs me and the target is to have the highest sum at the end of the game. There should be 2 buttons on Excel sheet. First one is the START button. When I click on this button, there will appear 40 numbers (all are random integers between 1 and 100) in the first row. 40 numbers should be generated randomly which means that each time I start the game, the data set will be different. For instance when I click on start button number generation can be like this: B. We will not use the start button again unless we want to restart the game. There will be a second button on the sheet which is called PLAY button. After generating the data set, you will start to play the game. To see your move I will click on play button and one of the numbers from either most right or most left side will disappear from the screen. Let's assume that your code deleted most left number which was 41. You will earn 41 points by this move and the sheet will be like this: HEM Then I will pick a number from most right or most left by selecting that cell, deleting it and adding that number to my sum manually. Let's assume that I select 43, deleted it and added this to my sum (B4). The updated screen will be like this: Now it's your turn. I will click on play button again and as previously your code did, a number would be picked from most right or most left and that number will be added to your sum (B3). Then I will make my move and I will click again on the Play button for your move. I will repeat the same steps until there is no number left in the screen. At the end of the game, the one who has a greater sum will win the game. If I click on Start at anytime during the game, the game should restart. Please write a code with VBA which never loses the game against me

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

Students also viewed these Databases questions