answer.
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]
1 year 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:
eduard1 year 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
If a car's is malfunctioning, people in the car will become ill when driving long distances, especially if the windows are close
galben [10]
The Carbon Monoxide will build up in the inside of the car by venting through, causing the passengers to breathe it. It will first make them ill, then kill them. They cannot detect this gas
5 0
2 years ago
Read 2 more answers
When your tire blows out in the middle of a drive, you should _____. A. let go of the steering wheel B. pump the brakes immediat
notsponge [240]
The answer is D. Because you are in the middle of the road so put your caution lights on and steer to the side of the road
3 0
2 years ago
Read 2 more answers
An attacker distributes hostile content on Internet-accessible Web sites that exploit unpatched and improperly secured client so
julia-pushkina [17]

Answer:

Since the attack impacts the client SANS Critical Security Controls. This act affects the Inventory of authorized and unauthorized software running on the victim's machine.

5 0
1 year ago
Read 2 more answers
Row array gameScores contains all player scores. Construct a row array highScores than contains all player scores greater than m
Sever21 [200]

Answer:

The solution is written using Python as it has a simple syntax.

  1. def getHighScores(gameScores, minScore):
  2.    meetsThreshold = []
  3.    for score in gameScores:
  4.        if(score > minScore):
  5.            meetsThreshold.append(score)
  6.    return meetsThreshold
  7. gameScores = [2, 5, 7, 6, 1, 9, 1]
  8. minScore = 5
  9. highScores = getHighScores(gameScores, minScore)
  10. print(highScores)

Explanation:

Line 1-8

  • Create a function and name it as <em>getHighScores</em> which accepts two values, <em>gameScores</em> and <em>minScore</em>. (Line 1)
  • Create an empty list/array and assign it to variable <em>meetsThreshold</em>. (Line 2)
  • Create a for loop to iterate through each of the score in the <em>gameScores</em> (Line 4)
  • Set a condition if the current score is bigger than the <em>minScore</em>, add the score into the <em>meetsThreshold</em> list (Line 5-6)
  • Return <em>meetsThreshold</em> list as the output

Line 11-12

  • create a random list of <em>gameScores</em> (Line 11)
  • Set the minimum score to 5 (Line 12)

Line 13-14

  • Call the function <em>getHighScores()</em> and pass the<em> gameScores</em> and <em>minScore </em>as the arguments. The codes within the function <em>getHighScores()</em>  will run and return the <em>meetsThreshold </em>list and assign it to <em>highScores.</em> (Line 13)
  • Display <em>highScores</em> using built-in function print().
8 0
1 year ago
If the object instance is created in a user program, then the object instance can access both the public and private members of
rewona [7]

Answer:

False

Explanation:

The private member of a class is not accessible by using the Dot notation ,however the private member are those which are not accessible inside the class they are accessible outside the class  .The public member are accessible inside the class so they are accessible by using the dot operator .

<u>Following are the example is given below in C++ Language </u>

#include<iostream>   // header file

using namespace std;  

class Rectangle

{    

   private:  

       double r; // private member  

   public:      

       double  area()  

       {     return 3.14*r*r;  

       }        

};  

int main()  

{    

  Rectangle r1;// creating the object  

   r1.r = 3.5;  

 double t= r1.area(); // calling

cout<<" Area is:"<<t;  

   return 0;  

}  

Output:

compile time error is generated

<u>The correct program to access the private member of class is given below </u>

#include<iostream>   // header file

using namespace std;  

class Rectangle

{    

   private:  

       double r; // private member  

   public:      

       double  area()  

       {    

r1=r;

double t2=3.14*r2*r2;

return(t2); // return the value  

       }        

};  

int main()  

{    

  Rectangle r1;// creating the object  

   r1.r = 1.5;  

 double t= r1.area(); // calling

cout<<" Area is:"<<t;  

   return 0;  

}  

Therefore the given statement is False

5 0
2 years ago
Other questions:
  • Sharon reads two different articles about avocados. The first article, in a weight loss magazine, claims that avocados are unhea
    10·2 answers
  • Carrie works on a help desk and is assigned a ticket that was automatically generated by a server because of an error. The error
    5·1 answer
  • Assume the input data is structured as follows: first there is a non-negative integer specifying the number of employee timeshee
    9·1 answer
  • Design a program that asks the user for a series of names (in no particular order). After the final person’s name has been enter
    5·1 answer
  • You are modeling a small part of an online flight reservation system, according to the following description. A flight is a sing
    11·1 answer
  • Suppose that we have a set of activities to schedule among a large number of lecture halls, where any activity can take place in
    8·1 answer
  • Chris accidentally steps on another student’s foot in the hallway. He apologizes, but the other student does not want to hear it
    13·2 answers
  • 1.the following code example would print the data type of x, what data type would that be?
    12·1 answer
  • What answer best explains why improper netiquette is considered dangerous? Individuals who violate user policies are often charg
    14·2 answers
  • When considering server consolidation, plan on running ___________ vCPUs per core.a. 1 to 2b. 3 to 4c. 4 to 6d. 6 to 8
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!