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
Evgen [1.6K]
3 years ago
9

Recall that in C++ there is no check on an array index out of bounds. However, during program execution, an array index out of b

ounds can cause serious problems. Also, in C++ the array index starts at 0.1. Design and implement the class myArray that solves the array index out of bound problem, and also allow the user to begin the array index starting at any integer, positive or negative. Every object of the type myArray is an array of the type int. During execution, when accessing an array component, if the index is out of bounds, the program must terminate with an appropriate error message. Consider the following statements:myArray list (5); // Line 1myArray myList (2,13); // Line 2myArray yourList (-5,9); // Line 3The statement in Line 1 declares list to be an array of 5 components, the component type is int, and the components are: list[0], list[1],
Computers and Technology
1 answer:
aev [14]3 years ago
4 0

Answer:

b b hhhhh sssss this i scool i just want the points and not to help people i just im using this

Explanation:

im joking idk the answer im so sorry to bother you

You might be interested in
The reason why our computers can get faster without getting bigger is because of...
Anni [7]
Almost positive it’s A. Moore’s law
3 0
2 years ago
Which value can be entered to cause the following code segment to display the message "That number is acceptable."? ____.
vaieri [72.5K]

Answer:

C) 99

Explanation:

This code only displays "That number is acceptable" when such number is higher than 10 and less than 100. This is  becasue the conditional sentence <em>if </em>controls which message is going to be displayed based on the abovementioned condition. 0 and 10 are not greater than 10, so they don't pass the condition and 100 is not less than itself, so it does not pass either. The only number among the options greater than 10 and less than 100 is 99.

8 0
2 years ago
When your Windows XP file becomes too large to fit in a single window, which of these components allows you to bring different p
IRISSAK [1]
<span>Scroll bar and scroll arrows allow you to bring different portions into view.</span>
8 0
3 years ago
5.17 (Calculating Sales) An online retailer sells five products whose retail prices are as follows: Product 1, $2.98; product 2,
Dima020 [189]

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

   

    //Initialize the prices as constants

    final double PRODUCT_1_PRICE = 2.98;

    final double PRODUCT_2_PRICE = 4.50;

    final double PRODUCT_3_PRICE = 9.98;

    final double PRODUCT_4_PRICE = 4.49;

    final double PRODUCT_5_PRICE = 6.87;

   

    //Declare the other variables

    int productNumber, quantitySold;

    double total = 0.0;

   

    //Create a Scanner object to get input

    Scanner input = new Scanner(System.in);

   

    //Create a while loop

    while(true){

        //Ask the user to enter the productNumber

     System.out.print("Enter the product number or 999 to quit: ");

     productNumber = input.nextInt();

     

     // Stop the loop, if productNumber is 999(sentinel value, you may choose any value you want)

     if(productNumber == 999)

         break;

     

     //Ask the user to enter the quantitySold

     System.out.print("Enter the quantity sold: ");

     quantitySold = input.nextInt();

     

     //Create a switch statement that works depending on the productNumber entered.

     //For example, if the productNumber is 1, it multiplies the quantitySold by PRODUCT_1_PRICE

     //   and adds the result to the total. If productNumber is 2, it does the same for product 2 ...

     switch(productNumber){

         case 1:

             total += quantitySold * PRODUCT_1_PRICE;

             break;

         case 2:

             total += quantitySold * PRODUCT_2_PRICE;

             break;

         case 3:

             total += quantitySold * PRODUCT_3_PRICE;

             break;

         case 4:

             total += quantitySold * PRODUCT_4_PRICE;

             break;

         case 5:

             total += quantitySold * PRODUCT_5_PRICE;

             break;

     }

    }

 

 //Print the total (when the loop is done)

 System.out.println("The total is $" + total);

}

}

Explanation:

*The code is in Java.

You may see the explanation as comments in the code.

4 0
3 years ago
Which of the following is true for an API?
navik [9.2K]

Answer:

c

Explanation:

4 0
3 years ago
Other questions:
  • You have been contracted by a local school to evaluate their computer labs for security threats. They are most worried about the
    6·1 answer
  • To find temporary windows files begin by typing in the search box
    6·1 answer
  • Pls help me
    5·1 answer
  • True / False<br> An instruction’s opcode generally indicates the number and type of its operands.
    5·1 answer
  • Which shortcut key combination will move the cursor to the beginning of the line?
    13·1 answer
  • In an array-based implementation of a dictionary, if you represent the entries as an array of objects that encapsulate each sear
    12·1 answer
  • How to create a network of relevant prospects?
    5·1 answer
  • You have to cut a wood stick into pieces. The most affordable company, The Analog Cutting Machinery, Inc. (ACM), charges money a
    10·1 answer
  • Which kind of typography focuses on the details of a character?
    10·1 answer
  • Why is it important for the scrum master to help the team focus on daily and iteration goals\
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!