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]
2 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:
eduard2 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
Janis needs to select all the text in a single bullet point. Which action describes the easiest method to perform this task?
olganol [36]

Answer:

Triple-click the text in the bullet item is the easiest  way to select all text

Explanation:

5 0
2 years ago
Given two integers as user inputs that represent the number of drinks to buy and the number of bottles to restock, create a Vend
ivann1987 [24]

Answer:

In C++:

#include <iostream>

using namespace std;

class VendingMachine {

 public:

   int initial = 20;};

int main() {

 VendingMachine myMachine;

   int purchase, restock;

   cout<<"Purchase: ";  cin>>purchase;

   cout<<"Restock: ";  cin>>restock;

   myMachine.initial-=(purchase-restock);

   cout << "Inventory: "<<myMachine.initial<<" bottles";  

   return 0;}

Explanation:

This question is incomplete, as the original source file is not given; so, I write another from scratch.

This creates the VendingMachine class

class VendingMachine {

This represents the access specifier

 public:

This initializes the inventory to 20

   int initial = 20;};

The main begins here

int main() {

This creates the object of the VendingMachine class

 VendingMachine myMachine;

This declares the purchase and the restock

   int purchase, restock;

This gets input for purchase

   cout<<"Purchase: ";  cin>>purchase;

This gets input for restock

   cout<<"Restock: ";  cin>>restock;

This calculates the new inventory

   myMachine.initial-=(purchase-restock);

This prints the new inventory

   cout << "Inventory: "<<myMachine.initial<<" bottles";  

   return 0;}

8 0
2 years ago
Write code which takes a user input of a String and an integer. The code should print each letter of the String the number of ti
il63 [147K]

import java.util.*;

public class myClass {

public static void main(String args[]) {

Scanner scan = new Scanner(System.in);

System.out.print("Input a String: ");

String str = scan.nextLine();

System.out.print("Input an integer: ");

int num = scan.nextInt();

for(int i=str.length()-1; i>=0; i--) {

for(int j=0; j<num; j++) {

System.out.print(str.charAt(i));

}

}

}

}

8 0
2 years ago
Web client software, such as Chrome, Firefox, Internet Explorer, Safari, and Opera, that are used to view Web pages are known as
evablogger [386]

Answer: Web Browsers

Explanation: The application software that works on the World Wide Web(www) is known as the web browser. Web browsers are the application must be installed on the user's system so that the accessing of the web server can be done.

There are different types of web browsers, out of which the most popular is Chrome and other examples are Internet Explorer, Opera, Firefox etc.

8 0
2 years ago
Read 2 more answers
The processing speed of a microprocessor is typically represented by its _______.
Fiesta28 [93]
<span>Correct Answer:
A. FireWire</span>
8 0
2 years ago
Other questions:
  • Suppose you define a java class as follows: public class test { } in order to compile this program, the source code should be st
    14·1 answer
  • Read this excerpt from The Outsiders. Or I could have gotten one of the gang to come along, one of the four boys Darry and Soda
    6·2 answers
  • Distinguish multiple inheritance and selective inheritance in oo concepts.
    14·1 answer
  • Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if
    13·1 answer
  • Modern operating systems decouple a process address space from the machine’s physical memory. List two advantages of this design
    15·1 answer
  • Alyosha was explaining to a friend the importance of protecting a cryptographic key from cryptoanalysis. He said that the key sh
    10·1 answer
  • Which XP practice prescribes that "the code [always be] written by two programmers at one machine"?.
    13·1 answer
  • A colleague sent you an awesome article about using proper ergonomics while sitting at the computer. You don't have time to read
    11·1 answer
  • _____________ data is what is translated to digital format so it can be stored in a computer.
    10·1 answer
  • It is also called teleconferencing or web conferencing,which is an online meeting wherein two or more people can see,hear,and ta
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!