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
julia-pushkina [17]
4 years ago
14

Dеclarе and allocatе mеmory (on thе hеap) for a two-dimеnsional array of strings namеd carMakеs with 20 rows, еach with 6 column

s
Computers and Technology
1 answer:
Lena [83]4 years ago
4 0

Answer:

string ** carMakes=new string*[20];  

   for(int i=0;i<20;i++)

   {

       carMakes[i]=new string[6];

   }

Explanation:

The above written piece of code is in C++ and it will declare and allocate memory on the heap for a 2-D array of strings with the number of rows 20 and number of columns 6 with name of the array carMakes.

To declare a 2-D array in C++ we use new keyword.

You might be interested in
Middleware for cloud database applications is commonly written as ____—short sections of code written in a programming or script
Ostrovityanka [42]
<span>Middleware for cloud database applications is commonly written as scripts—short sections of code written in a programming or scripting language that are executed by another program. A script language is used for server side scripting language that can change a specific data on the server. Examples of these are PHP, JSP, Perl, Python, etc.</span>
5 0
4 years ago
I need help to make this code to make it remove all instances of the specified letter from the original sentence
Agata [3.3K]
Here is my solution. I did the following:

- changed the setRemover into a constructor, since the comment seems to hint that that is expected.
- changed the lookFor type into a String, so that it can work with the string replace overload. That's convenient if you want to replace with an emtpy string. The char type won't let you do that, you can then only replace one char with another.
- Added a static Main routine to use the class.

import java.lang.System.*;

public class LetterRemover 
{
   private String sentence;
   private String lookFor;

   public LetterRemover() {}
   
   // Constructor
   
   public LetterRemover(String s, char rem)
   {
       sentence = s;
       lookFor = String.valueOf(rem);
   }
   
   public String removeLetters()
   {       
       String cleaned = sentence.replace(lookFor, "");       
       return cleaned;
   }
   
   public String toString()
   {
       return sentence + " - letter to remove " + lookFor;
   }

   public static void main(String[] args) 
   {
        LetterRemover lr = new LetterRemover("This is the tester line.", 'e');
        System.out.println(lr.toString());
        String result = lr.removeLetters();        
        System.out.println("Resulting string: "+result);
   }
}

5 0
3 years ago
What is the purpose of the operating system's processor management function?
Sloan [31]
The purpose of the operating system's processor management function is that it allows you to run multiple programs on your computer simultaneously. 
5 0
3 years ago
What is Logic and Emotion?
m_a_m_a [10]
Logic is Strict principles of validity (reasoning)

Emotion is the natrual instinctive feeling from reasoning or knowledge.

Hope this helps! ^0^ <span />
8 0
3 years ago
Read 2 more answers
Tests, fixes, and maintains network systems:
Alex777 [14]
Its the last one to be exact
8 0
3 years ago
Other questions:
  • A critical piece of equipment that provides power to systems even during a black out is called a(n) _______________.
    14·1 answer
  • Quien invento el primer vehiculo con motor?
    15·2 answers
  • Can you put iPhone voice memos on repeat?
    6·2 answers
  • How is a computer and a iphone different
    9·1 answer
  • The section of the browser window highlighted in yellow is the _____.
    11·1 answer
  • If you're looking to install Gigabit Ethernet, what cabling system would you use?
    9·1 answer
  • PLEASE HELP ILL GIVE BRAINLIEST IMMEDIATLEY TO THE CORRECT ;-;
    10·1 answer
  • In a swap you need a variable so that one of the values is not lost ? Need help
    7·2 answers
  • It is where your cpu (processor) is installed
    10·2 answers
  • Please help me with this!
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!