Hey all! How would you write write this code?
Write a C++ program using variables and loops in order to implement the Hi-Low strategy of card counting and keep a running count. The Hi-Low strategy of card counting assigns one of three values to a card, based on its face value. The table below breaks down these values. FACE VALUE ASSIGNEDVALUE 2, 3, 4, 5, 6 +1 7, 8, 9 0 10, J, Q, K, A -1 In a typical game of Blackjack, a card counter will start with a fresh deck and a count of 0. Each time a card is played, its assigned value is added (or subtracted) from what is known as the running count. The running count rolls over from hand to hand. For instance, if the first 7 cards of a game were: Queen, Jack, 4, 6, 7, Jack, 9, then the running count would be (0) -1 -1 + 1 + 1 + 0 –1 + 0 =-1
The program is an illustration of loops.
Loops are used to perform repetitive actions.
The program in C++ where comments are used to explain each line, is as follows:
#include <string>
#include <iostream>
using namespace std;
int main(){
//This declares all variables
int n, count = 0; string k;
//This gets input for the number of cards
cin>>n;
//The following is repeated n-times
for(int i = 0;i <n;i++){
//This gets input for the current card value
cin>>k;
//If the card is a digit
if(isdigit(k[0])){
//This checks if the card number is between 2 and 6 (inclusive)
if(stoi(k) >= 2 && stoi(k) <= 6){
//If yes the face value is increased by 1
count+=1;
}
//This checks if the card number is 10
else if(stoi(k) == 10){
//If yes the face value is decreased by 1
count-=1;
}
}
//This checks if the card number is J, Q, K or A
else if (k == "J" || k == "Q" || k == "K" || k == "A") {
//If yes the face value is decreased by 1
count-=1;
}
}
//This prints the face value
cout<<count;
return 0;
}
At the end of the program, the face value is printed.
Read more about similar programs at:
https://brainly.com/question/24578223
Identify the following verb by number and person by checking on the appropriate boxes.
SHE WANTS!!
second person
singular
plural
same form for both singular and plural
third person
first person PLEASE HELP!!!!!! LAUNGUAGE ARTS
Answer:
Singular and third person
Explanation:
Second person: this answer is not correct as second person refers to pronouns such as “you, yourself” like in a recipe.
Singular: this is correct as a singular verb is when there is only one subject. You can also tell it’s a singular verb as the present tense ends with a “s”.
Plural: this is not plural because there is only one subject. Plus the present tense of the verb ends with an s so it’s not a plural verb. Plural verb’s present tense never ends with an s.
Third person: this is correct because the subject of the sentence is someone else. Third person pronouns include: “her, she, he, him, they, then” basically, third person is when you talk about someone else.
First person: this answer is not correct because first person refers to one’s self. So first person pronouns are: “I, me, myself”
What is the purpose of a computer network needs assessment? to evaluate how to move from the current status to the desired goal to determine what steps employees can take to increase company revenue to analyze which workers need more training to improve their performance to compare worker productivity
Answer:
to evaluate how to move from the current status to the desired goal
A field name can be up to 64 characters long
Answer:
Explanation:
cool ..........................,...............................
Write a program that can add, Subtract, multiply and divide entered numbers.
In Python:
def add(x, y):
return x + y
def subtract(x, y):
return x - y
def multiply(x, y):
return x * y
def divide(x, y):
return x / y
ctivity 2: irections: Convert the given value to unit asked. 1. 1 tb 2. 500 mb 3. 200 kb 4. 1,000,000 bytes 5. 500 gb mb gb byte gb mb
help please
Answer:elab
Explanation:
SOME PLEASEE HELP!!
(has to be 4 paragraphs)
Answer:
Ahhh i wanna help so bad hold on
Explanation:
Question
What protocol is used to discover the hardware address of a node with a certain IP address?
Answer:
ARP is a simple query–response packet protocol used to match workstations hardware addresses to IP addresses. In other words, ARP is the protocol used to identify nodes in a LAN. ARP is described in RFC 826
Which of the following expressions in Java is equal to 4?
3% 7
7 % 3
17 % 7
11 % 7
28 % 7
Answer:
3% 7
Explanation:
because 7 because seven ate nine and three was lonely so seven decided to also eat three and became a lesser number somehow because three apparently was not as big as the number 9 so maybe eating three caused him to go down to 4
The expression "11 % 7" in Java is equal to 4.
The "%" operator calculates the remainder of a division operation.
In Java, the "%" operator is used to calculate the remainder of a division operation.
So, let's evaluate each expression and see which ones equal 4:
3 % 7 = 3 (remainder of dividing 3 by 7)
7 % 3 = 1 (remainder of dividing 7 by 3)
17 % 7 = 3 (remainder of dividing 17 by 7)
11 % 7 = 4 (remainder of dividing 11 by 7)
28 % 7 = 0 (remainder of dividing 28 by 7)
Based on these evaluations, the expression "11 % 7" is equal to 4.
To learn more about programming visit:
https://brainly.com/question/14368396
#SPJ3
Give short introduction of profession and make a list of its types.
Which of the following factors is most likely to result in low shipping and handling costs? A higher than average hourly pay rate for material handlers A rare but high-in-demand packaging material A promotion for free shipping on orders over a predetermined order total All of the above
Answer: A higher than average hourly pay rate for material handlers
Explanation:
Shipping and handling cost describes costs related to the total cost of an ordered item which are included in the fees used to deliver the item to the buyer. Hence, the correct option is C
Shipping and handling cost usually depend on the size of the item, the buyer's location and fragility of the item purchased.
From the options given, handling and shipping fee may be reduced as a result of free promotional shipping on orders.
Handler and drivers who are paid above average will result in increased shipping fee and rare in-demand items won't come cheap either.
Hence, low shipping fee will most likely be as a result of promotion for free shipping on orders over a predetermined order total.
Learn more : https://brainly.com/question/20533392
What kind of loop repeats until something else (determined by the program) happens?
iterative number loop
condition-controlled loop
count-controlled loop
forever loop
Answer:
The Condition-controlled loop
Explanation: Because its called a Condition and it does not stop untill something happens thats why its called "condition".
Answer: It's Condition-controlled loop
Explanation: The meaning of condition-controlled loop is Blocks will keep repeating until a condition is satisfed, Also beacuse I already did the quiz.
Freeze panes so the first row containing column headings (Row 5) on the support calls worksheet will remain static when scrolling. Ensure that Rows 1-4 are visible.
Please help me its excel
IF YOU DON'T KNOW THE ANSWER DONT ANSWER JUST LEAVE. NO LINKS OR I WILL CALL THE POLICE.
Answer:
on Freeze Panes so the first row containing column headings (Row 5) on the SupportCalls worksheet wil remain static when scrolling. Ensure that Rows 1-4 are visible. Convert the data to a table, name the table SupportCalls, and apply the Gold, Table Style Medium 12 Remove duplicate records Add a new column to the table named Duration Create a formula using unqualified structured references to calculate the days required to resolve the incident (Date Resolved - Date Created) Add a total row to display the Average days required to resolve an issue. o ñ Sort the table by Agent Name in alphabetical order, add a second level to sort by Description, and create a custom sort order as follows: Won't power on, Virus, Printing issues, Software Update, Forgotten Password. Add a third level to sort by Duration smallest to largest. (Mac users, to create the custom list, from the Excel menu, click Preferences. In the dialog box, click Custom Lists.) Filter the table to only display closed incidents as indicated in the status column. Use Quick Analysis to apply the default Data Bars conditional formatting (Solid Blue Fill) to the Duration column (range 16:185) Mac users on the Home tab, click Conditional Formatting, point to Data Bars, and under Solid Fill, click Blue Data Bar. Create a new conditional format that applies Red fill and bold font to incident (range A6 A85) that required 30 or more days to resolve Change page breaks so page 2 begins with the Computer ID column (column EX Set the print scale to 85% Add a custom footer with your name on the left side, the sheet name code in the center, and the file name code on the right side Save and close the workbook Submit the workbook as directed
Widte Automatic HeightAutomatic- Escale Gridlines Headings View Print Margins Onentation Sure Print reaks Background Print Titles 100% Bring Send Forward - Backward Selection Pane Arrange 747-57548 DE Technical Support Calls 3 Threshold days 1992 2971 1850 9018 6404 Cox COX Incident Number - Date created - Last Name - Agent Name 747-57548 3/24/2021 Murray Broadnax 254-3993: 2/4/2021 Stone Broadnax 831-91089 4/4/2021 Herrera Broadnax 15207-19047 2/4/2021 Cook Broadnax 16 284-56116 2/17/2021 Ramos Broadnax 19 295-57913 5/5/2021 Nguyen Cox 23 619-44822 2/10/2021 Silva 24 605-47583 3/9/2021 Garner 29 424-30728 4/26/2021 Walker Dodson 31 875-36070 5/2/2021 Delgado Dodson 32 727-78890 2/15/2021 Watts Dodson 33 247-70541 3/24/2021 Rodgers Dodson 34 868-40830 5/5/2021 Griffin Dodson 35 878-43585 3/13/2021 Hale Dodson 37 859 12568 3/18/2021 Soto Hays 38 2019-20285 2/20/2021 Coleman Hays 41 179-51542 3/29/2021 Gray 42 657-68422 1/16/2021 Washington Hays 45 751-81316 3/3/2021 Ramirez 49 614-70314 2/20/2021 Gutierrez 52683-70001 3/22/2021 Newman 54 422-24141 2/18/2021 Carpenter Leggett 3/1/2021 SupportCalls 8930 9589 9955 3488 4468 2340 7125 2853 8586 3198 1577 6405 9751 3801 6580 4978 16 Won't power on Won't power on Won't power on Virus Virus Won't power on Software Update Forgotten Password Won't power on Won't power on Printing issues Software Update Forgotten Password Virus Won't power on Won't power on Software Update Software Update Virus Software Update Forgotten Password Forgotten Password Went Weron Status Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed 7 Date Resolved Duration 3/25/2021 2/20/2021 4/30/2021 2/12/2021 2/28/2021 5/13/2021 | 2/12/2021 3/14/2021 5/2/2021 5/28/2021 2/28/2021 4/11/2021 5/7/2021 3/21/2021 4/5/2021 3/20/2021 4/9/2021 2/9/2021 3/24/2021 3/3/2021 3/26/2021 2/26/2021 6/12/2021 -
On Freeze Panes, the SupportCalls worksheet's first row of column headings (Row 5) will stay static even when scrolling. Make sure Rows 1-4 are discernible.
What is Static scrolling?Create a table using the data, rename it Support Calls, and apply the Gold, Style Medium Table 12 Get rid of duplicate records Create a column in the table with the name Duration.
To determine the number of days necessary to settle the event, create a formula utilizing unqualified structured references.
To show the average number of days needed to fix a problem, add a total row. The data in alphabetical order by Agent Name, add a second level of sorting by Description, and generate a unique sort order like in the example below.
Therefore, On Freeze Panes, the Support Calls worksheet's first row of column headings (Row 5) will stay static even when scrolling. Make sure Rows 1-4 are discernible.
To learn more about Column headings, refer to the link:
https://brainly.com/question/13163317
#SPJ2
what are the components of computer system??
Answer:
1. A motherboard.
2. A Central Processing Unit (CPU)
3. A Graphics Processing Unit (GPU), also known as a video card.
4. Random Access Memory (RAM), also known as volatile memory.
5. Storage: Solid State Drive (SSD) or Hard Disk Drive (HDD)
(Please give me brainliest)
You should move around and take a rest for 30 minutes every 5 minutes.
True Or False
Answer:
obviously true.........
A double-ended queue, or deque, is a data structure consisting of a list of items on which the operations are defined.
a. True
b. False
Answer:
true
Explanation:
How many 60 KB jpeg files can be stored on a 2 MB folder in your hard drive?
Answer:
2 MB = 2048 kb
2048 / 60 = 34.1
Explanation:
Where do you place the logical test argument in an IF function formula?
O before the IF function
O the first argument listed after IF
the second argument listed after IF
O the third argument listed after IF
Intro
Don
Answer:
the first argument listed after IF
yw
I just need question 2 answered. Someone please help I’m on a test!
Answer:
Principal photography
Explanation:
Which is an example of a demand account
Answer: savings account investment account credit account checking account Checking account is an example of a demand account.
CPU is also called RAM.
True or false.
Answer:
False
Explanation:
RAM works in conjunction with the central processing unit (CPU). If RAM is the temporary memory, you can think of the CPU as the brain of the computer. The CPU chip retrieves data from the RAM
FALSE ...
BECAUSE RAM IS A MEMORY AND CPU IS A UNIT OF COMPUTER THAT'S WHY IT IS FALSE
phân tích cạnh tranh của cocacola và pepsi
which is used for making documentation file from microsoft office package
Answer:
the word is use for making docs
Answer:
Explanation:
To create a document, open Word, select a blank document or template, and start typing. Discover professionally designed templates for Microsoft Word.
Please answer the following question in Verilog.
To test our functions we will generate a 3-bit vector that counts up by one every cycle which we will use as the inputs to the decoder. The decoder output will then be fed into the inputs of the encoder to produce an inverted version of the original 3-bit test vector. For every input vector you should toggle the enable signal to both the encoder and decoder function which can be easily done by using the clock waveform used to determine when to increment the input vector as the enable signal as well.
Answer:
345678909 my number
Explanation:
ACTIVITY NI MATCHING TYPE Directions: Match Column A with Column B. Write the letter of the correct answer on the space provided before the number a. Trion your nails b. visits the dentist c. scrub your hands with soap and water d. wear deodorant taking a bath 18111411 hely wear suitable clothes at work g. avoidis open wounds while working with food h. Regularly out your hair. 1. Use a seperate towel or cloth wiping hands. . keep sanitizer. 10.
Answer:
Mark me a brainless plss i need that i am blink plss
Advantages of communications
Answer:
promotes team building
creates better relationship
Answer:
➨It is quick in obtaining feedback once delivered. ➨It provides complete understanding of communication delivered and there is chance to make it more clear in case of doubts in interpretation of words or ideas. ➨It is more reliable method of communication. ➨It is flexible and effective for all.
List the steps you would take to create folders/directories in different operating system environments.
In Linux we use the terminal to create files and folders.
To create a folder:
1. Open a terminal
2. Go to a directory where you want to create the folder
3. Use the change directory command to go to the directory.
4. Use the mkdir command to make a folder
To create a file:
1. Open a terminal
2. Go to a directory where you want to create a file.
3. use the touch command followed by the filename.
Example to create a directory:
mkdir foldername
Example to create a file:
touch file.txt
Answer:
Various operating systems have different ways of creating folders or directories. Here are steps to create folders or directories in some of the most common operating systems.
Windows
You can create a new folder in Windows by following the two different ways stated below.
These are the steps for creating a new folder through using the File menu.
Open the location where you want to create the new folder.
Then, select the File menu and click New.
Finally, select the Folder option.
These are the steps to create a folder using the right-click method.
Open any location where you want to save your new folder.
Right-click on any blank area of the screen.
This opens a menu. Select New from the menu.
Lastly, from the menu that opens after you select New, and click Folder.
MS-DOS
These are the steps to create directories in MS-DOS.
Click the Start menu.
Click All Programs and then select on Accessories.
Then, select Command Prompt.
Navigate to the location you want to save your new folder. For example, if you want to open the C drive, the command will be: C:
To create a new directory, type mkdir followed by the folder name of your choice. For example, if I want a folder named projects, I will enter the command, “mkdir projects”.
To create multiple new directories in the newly created directed directory, you can use the md MS-DOS command. For example, if you want to make sub-directories named project1, project2, and project three, your command will be md project1 project2 project3.
Mac OS X
There are three ways to create a new folder in the MAC OS X
These are the steps for creating a new folder through using the File menu.
Open any location where you want to save your new folder.
Afterwards, select the File menu and click New Folder
These are the steps to create a folder using the right-click method.
Open any location where you want to save your new folder.
Right-click on any blank area of the screen.
This option opens the folder menu. Select New Folder from the menu.
These are the steps to create directories in Terminal.
Open the Utilities folder. Start the Terminal program.
Navigate to the location where you want to save your new folder.
To create a new directory, type mkdir followed by the folder name of your choice. For example, if I want a folder named projects, I will enter the command, “mkdir projects”.
To create multiple new directories in the newly created directed directory, you can use the -p Terminal command. For example, if you want to make sub-directories named project1, project2, and project three, your command will be -p project1/project2/project3.
Linux
There two ways of creating a new folder in Linux.
These are the steps for creating a new folder using the right-click method.
First, open the file manager.
Then, proceed to the location where you want to save your new folder.
Next, right-click on a blank spot.
Finally, select Create New Folder from the drop down menu.
These are the steps for creating a new folder using Terminal.
Open Terminal by using the Ctrl+Alt+T combination of keys.
To create a new directory, type mkdir followed by the folder name of your choice. For example, if I want a folder named projects, I will enter the command, “mkdir projects”.
To create multiple new directories in the newly created directed directory, you can use the -p Terminal command. For example, if you want to make sub-directories named project1, project2, and project three, your command will be -p project1/project2/project3.
Explanation:
for plato
1. The jargon for navigating on the Internet is called: A. surfing B. selecting C. clicking D. analyzing
Answer:
A. surfing
Explanation:
Browsing the internet is known as surfing the internet.
In order to get the maximum functionality out of a device that is plugged in, a user should download the specific ___ for that device.
explain how communication in fuses management efficiency
Explanation:
Effective communication is pivotal in increasing productivity because it directly influences the behavior of the staff and the way they perform. ... That is why it is essential that you practice communicating with your staff. It will improve understanding and, in the result, will elevate productivity and efficiency.