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
Gnom [1K]
3 years ago
8

Index addressing is for traversing arrays. True False

Computers and Technology
1 answer:
valina [46]3 years ago
8 0

Answer:

False.

Explanation:

Index addressing is not for only traversing the arrays but to also access the element,manipulate them.Though indexing is also used in traversing but it is not solely for that.Indexing in an array starts from 0 to size-1.

for example:-

We have an array a of size 10.So to access the element at position 6.We have to write.

a[5];

Manipulating it

a[5]=6;

You might be interested in
Modify class Time2 of fig 8.5, (which is split into four pictures) to include a tick method that increments the time stored in a
ArbitrLikvidat [17]

Explanation:

Complete Program:

NOTE:   The newly added statements are highlighted in bold.

// File: Time2.java

public class Time2

{

private int hour; // 0 - 23

private int minute; // 0 - 59

private int second; // 0 - 59

public Time2()

{

 this(0, 0, 0);

}

public Time2(int hour)

{

 this(hour, 0, 0);

}

public Time2(int hour, int minute)

{

 this(hour, minute, 0);

}

public Time2(int hour, int minute, int second)

{

 if(hour < 0 || hour >= 24)

  throw new IllegalArgumentException("hour must be 0-23");

 if(minute < 0 || minute >= 60)

  throw new IllegalArgumentException("minute must be 0-59");

 if(second < 0 || second >= 60)

  throw new IllegalArgumentException("second must be 0-59");

 this.hour = hour;

 this.minute = minute;

 this.second = second;

}

public Time2(Time2 time)

{

 this(time.getHour(), time.getMinute(), time.getSecond());

}

public void setTime(int hour, int minute, int second)

{

 if(hour < 0 || hour >= 24)

  throw new IllegalArgumentException("hour must be 0-23");

 if(minute < 0 || minute >= 60)

  throw new IllegalArgumentException("minute must be 0-59");

 if(second < 0 || second >= 60)

  throw new IllegalArgumentException("second must be 0-59");

 this.hour = hour;

 this.minute = minute;

 this.second = second;

}

public void setHour(int hour)

{

 if(hour < 0 || hour >= 24)

  throw new IllegalArgumentException("hour must be 0-23");

 

 this.hour = hour;

}

public void setMinute(int minute)

{

 if(minute < 0 || minute >= 60)

  throw new IllegalArgumentException("minute must be 0-59");

 

 this.minute = minute;

}

public void setSecond(int second)

{

 if(second < 0 || second >= 60)

  throw new IllegalArgumentException("second must be 0-59");

 

 this.second = second;

}

public int getHour()

{

 return hour;

}

public int getMinute()

{

 return minute;

}

public int getSecond()

{

 return second;

}

public String toUniversalString()

{

 return String.format("%02d:%02d:%02d", getHour(), getMinute(),

   getSecond());

}

public String toString()

{

 return String.format("%d:%02d:%02d %s",

   ((getHour() == 0 || getHour() == 12) ? 12 : getHour() % 12),

   getMinute(), getSecond(), (getHour() < 12 ? "AM" : "PM"));

}

// increment second

public void tick()

{

 if(second < 23)

 {

  second++;

 }

 else if(minute < 59)

 {

  second = 0;

  minute++;

 }

 else if(hour < 23)

 {

  second = 0;

  minute = 0;

  hour++;

 }

 else

 {

  second = 0;

  minute = 0;

  hour = 0;

 }    

}

// increment minute

public void incrementMinute()

{

 if(minute < 59)

 {

  minute++;

 }

 else if(hour < 23)

 {

  minute = 0;

  hour++;

 }

 else

 {

  minute = 0;

  hour = 0;

 }    

}

public void incrementHour()

{

 if(hour < 23)

 {

  hour++;

 }

 else

 {

  hour = 0;

 }    

}

}

------------------------------------------------------------------------------------------------------------

// File: Time2Test.java

public class Time2Test

{

  public static void main( String args[] )

  {      

     Time2 t = new Time2(22, 58, 59);

     System.out.println("Starting time: ");

     System.out.println("Time in 24 hours format: " + t.toUniversalString());

     System.out.println("Time in 12 hours format: " + t);

     System.out.println();

     

     t.incrementMinute();

     System.out.println("After incrementing one minute: ");

     System.out.println("Time in 24 hours format: " + t.toUniversalString());

     System.out.println("Time in 12 hours format: " + t);

     System.out.println();

     

     t.incrementHour();

     System.out.println("After incrementing one hour: ");

     System.out.println("Time in 24 hours format: " + t.toUniversalString());

     System.out.println("Time in 12 hours format: " + t);

     System.out.println();

     

     t.tick();

     System.out.println("After incrementing one second: ");

     System.out.println("Time in 24 hours format: " + t.toUniversalString());

     System.out.println("Time in 12 hours format: " + t);    

     System.out.println();

  }

}

4 0
3 years ago
Is a network where connected devices are located within the same building.
Nesterboy [21]

Answer:

Answer A

Explanation:

Answer A, because, metropolitan area network is a network within a city or town and wide area network usually connects many cities. So, both C & D are spread on a wide area.

8 0
2 years ago
Read 2 more answers
Write a program that accepts two integers from the user and perform one of the four arithmetic operations based on user’s choice
madam [21]

Answer:

am i to late or do you still need the answer?

Explanation:

3 0
2 years ago
Please answer quick:))))
Anika [276]
I think B and the second one C
8 0
2 years ago
Rohan is creating a presentation with at least 50 slides. He wants the slides to use a consistent layout and formatting. Which o
erma4kov [3.2K]

The parts of the presentation that he should design first is Slide master

Slide master is a slide that enables you  to do the following:

•Modify your presentation to suit your taste

•It enables you to make  a partial or minor change  on the slide layout of your presentation

•Slide master  help you to  create a perfect and special  presentation.

•With Slide master  you can easily modify your slide text color.

Inconclusion The parts of the presentation that he should design first is Slide master.

Learn more about Slide master here:

brainly.com/question/12600334

4 0
2 years ago
Other questions:
  • When creating an input/ output table, where do you enter the formula?
    5·1 answer
  • There are two activities on your schedule, which are: 1) install server in lab 2) move server into the data center. however, the
    6·1 answer
  • GAMES Which is better Roblox or BattleCamp Basically Free Points But Please Answer
    7·2 answers
  • The network architecture component that is a special LAN with a group of servers that enables electronic data exchange of betwee
    8·1 answer
  • What do you call the spreadsheet cell that is in effect and has a heavier black border around it?
    7·2 answers
  • 8. A sprite is a simple spider shaped thing with n legs coming out from a center point. The angle
    10·1 answer
  • The Curiosity Rover has recently landed on Mars and likes to send Twitter updates on its progress. If a tweet is posted 10 minut
    6·1 answer
  • Assume there are two variables, k and m, each already associated with a positive integer value and further assume that k's value
    13·1 answer
  • Which of the following statements is TRUE of a peer-to-peer network?
    10·1 answer
  • an existing technology that would allow users to transfer images from the camera to the computer without connecting them
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!