1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
krok68 [10]
3 years ago
13

Assume that two parallel arrays have been declared and initialized: healthOption an array of type char that contains letter code

s for different healthcare options and annualCost an array of type int. The i-th element of annualCost indicates the annual cost of the i-th element of healthOption. In addition, there is an char variable, best2.Write the code necessary to assign to best2 the health option with the lower annual cost, considering only the first two healthcare options.
Computers and Technology
1 answer:
eduard3 years ago
6 0

/*

Since we have to check the first two options only as mentioned in last part of question the loop will work 2 times only and will compare the cost of first element and second and assign the healthoption accordingly

*/

for(int i =0;i<=1;i++){

if(annualCost[i]<annualCost[i+1]

best2 = healthOption[i]

else

best2 = healthOption[i+1]

}

You might be interested in
The statement which assigns value to variable is called a........................statement in c++
Helga [31]

Answer:

the statement which assigns value to variable is called <u>Assignment </u>statement in c++

Explanation:

Assignment Statement is the statement in C++ programming that is used to assign a constant value or some expression to the variable. Assignment operator is used to assign the value or expression to the variable.

Single equal (=) symbol is use as assignment operator in C++.

For Example

If we want to assign some value or expression in C++, it will be written as:

Variable = Value;

or

Variable = Expression;

Both of the above mentioned examples shows the Assignment Statements.

6 0
3 years ago
Write a function isRed() that accepts a string parameter and looks for the presence of the word ‘red’ in the string. If it is fo
Ilia_Sergeevich [38]

Answer:

Using the Python Programming Language:

def isRed(myString):

   if "red" in myString:

       return True

   else:

       return False

Explanation:

The function definition is given above. To output the result of calling this function, we declare a string variable and call the function inside a print statement. See the two lines of code below:

myString= "My house is coloured red"

print (isRed(myString))

Notice that we defined the function called isRed to receive a string as a parameter, Then using the in keyword with an if statement, we check for the presence of the word 'red' in the string that is passed as argument to the function, the function will then return True if the word 'red' is present or False if it is not.

7 0
3 years ago
Read 2 more answers
When you use file explorer or windows explorer to delete a file from the hard drive, where does windows put the file?
Dvinal [7]
Trash bin

Reasons:

When you remove a file from the hard drive it is still written in binary code. So, windows places files in the *trash bin* if you did not want to delete it.
Unless USB or Removable flash drive, when you delete that it does not place any files in the trash bin.

6 0
3 years ago
How does Isabel respond to having to stay home and not work while every one else works? Esperanza Rising
koban [17]
Isabel feels pretty happy that she is free of work for the day. However she also feels sad that other people have to work when she is not. I read this book three times i would recommend it, It is interesting  and amazing!
5 0
3 years ago
Whats difference between DCE AND DTE serial interface
harina [27]

DCE stands for data circuit-terminating, data communications, or data carrier equipment - this is a modem or more generally, a line adapter.

DTE stands for data terminal equipment which generally is a terminal or a computer.

Basically, these two are the different ends of a serial line.

7 0
3 years ago
Other questions:
  • HOW CAN YOU CHANGE YOUR BACKGROUND
    12·1 answer
  • 2. What's the keyboard command that will allow you to "copy" text?
    8·2 answers
  • Which of the following should you do first when planning your career
    11·1 answer
  • As long as users refer to files in the ____ directory, they can access the files without entering the absolute filename.
    10·1 answer
  • Jane, a marketing manager for the Grocery SuperStore retail chain, fired up a computer program that gave her ready access to inf
    6·1 answer
  • Hey does anyone know the name of that movie where like this teenage girl is chilling at her house then there is an outbreak of s
    6·1 answer
  • Notebook is the answer
    9·2 answers
  • Please help ASAP !!!
    15·1 answer
  • Create a relational database table in Microsoft Excel for the grocery store of 20 employers.
    12·1 answer
  • Will Give Brainiest to the first correct answer!!!!
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!