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
miskamm [114]
3 years ago
7

Suppose you have the following declaration.char[] nameList = new char[100];Which of the following range is valid for the index o

f the array nameList.(i) 1 through 100(ii) 0 through 1001. Both are invalid2. Only (i)3. None of these4. Only (ii)
Computers and Technology
1 answer:
VMariaS [17]3 years ago
4 0

4. Only (ii)

<u>Explanation:</u>

The declaration of the array can be of two types:

1. int a[100];

2. int[] a = new int[100];

The general thing about an array is that whenever we want to undergo traversal in an array, we always have to start from the 0th position as the size of the array may be a whole number (let us say 10). So, to undergo traversal in an array, we start from 0 to n-1 (in this case 9) such that it covers the size of the array.

The size of an array can be finite or infinite. The general rule is it starts from 0 to n-1 where n is the size of the array. In the above example, the range of the index of the array will be 0 through 100 and not 1 through 100.

You might be interested in
Suppose we can buy a chocolate bar from the vending machine for $1 each. Inside every chocolate bar is a coupon. We can redeem s
Tanya [424]

Answer and Explanation:

Using JavaScript:

/* program should take N input which represents the dollar amount and output how many chocolate bars and how many coupons we have*/

function chocolatebar(dollars){

var dollaramt= dollars;

var i;

for(i=0; i <= dollaramt; i++){

i=i+6

?

Alert ("you have 1 extra chocolate bar");

:

Alert ("keep buying chocolate bars to get more coupons for a bonus chocolate bar")

}

}

*

7 0
3 years ago
1. Bones do not change position when the muscles contract and release.
DochEvi [55]
TrueBones do not change position
6 0
3 years ago
Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output tho
cupoosta [38]

Answer:

Following are the program in java language:

import java.util.*; // import package

public class Main

{

public static void main(String[] args) // main method

{

 int num; // integer variable declaration

 double r; //double varaible declaration

 char ch; // char variable declaration

Scanner scnr=new Scanner(System.in); // creating the instance of scanner

 System.out.println("Enter the string:");

 String str=scnr.nextLine(); // reda string by user

System.out.println("Enter the integer value:");

 num=scnr.nextInt(); // Read integer value by the user

 System.out.println("Enter the Double value:");

 r=scnr.nextDouble(); // read double value by user

 System.out.println("Enter the character value:");

 ch= scnr.next().charAt(0); // read character by user

 System.out.print(num + " ,"); // display them in a single line

 System.out.print( " " +r +" ,");//dislpay in a single line  

  System.out.print( " " +ch +",");//dislpay in a single line

 System.out.print(" " +str);//dislpay in a single line

}

}

Output:

Enter the string:

ram

Enter the integer value:

34

Enter the Double value:

45.789

Enter the character value:

r

34 , 45.789 , r, ram

Explanation:

Following are the description of program

  • Read the integer ,string,char,double value by the user by using scanner class in "num","str","ch" and "r" variable respectively
  • Print that value in a single line separated by comma by System.out.println statement.

7 0
3 years ago
What is the full form of GUI​
77julia77 [94]

Answer:

(GUI) stands for Graphical User Interface

3 0
2 years ago
Read 2 more answers
Frequently used data is identified and read from the hard disk into memory, or _____, and is easily accessible when needed.
frutty [35]

Answer:

The answer would be disk cache.

7 0
3 years ago
Other questions:
  • Why is it important for element IDs to have meaningful names?
    7·1 answer
  • What is the term used to describe data sets are so large and complex that they become difficult to process using traditional dat
    12·1 answer
  • A program requires that you change your screen size from 1024 X 728 to 800 X 600. In which of the following locations should you
    7·2 answers
  • Given: The following if statement uses an overloaded &gt; operator to determine whether the price of a Car object is more than $
    5·1 answer
  • I have tried installing "windows media player" on my computer but at a point, something disrupts its instalment or I am asked to
    7·1 answer
  • c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive
    5·1 answer
  • Question 3 of 10
    7·1 answer
  • Ano ang bunga ng pagsunod sa tamang konsiyensiya?
    12·2 answers
  • In Subtractive empathy, the counselor responses gives back less (or distorts) than what the client has said. slightly add someth
    14·1 answer
  • 4. In computers, an integer can be represented by more than 8-bit, what is the largest positive integer that
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!