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
kondor19780726 [428]
3 years ago
14

To open a file with a user supplied name, you would need to store the name in a variable. If the file name was to have no more t

han 20 characters in it, which would be an appropriate declaration of the file name variable?
a. char filename;
b. char filename(20);
c. char filename[20];
d. char filename[21];
Computers and Technology
1 answer:
Maurinko [17]3 years ago
7 0

Answer: C: char filename[20];

Explanation:

In c++ the squre brackets or simply brackets "[]" is used to denote memory allocation, memory access and so on,

You might be interested in
Consider the following class:
Pachacha [2.7K]

Answer:

c.return Integer.compare(value, otherTemp.value)

Explanation:

The compare() method as the name implies compares two integer values. If they are equal it returns 0, if the first number is smaller it returns -1, and if the first number is greater it returns 1.

It is an Integer class method that is why you need to type Integer.compare() to call the function.

For this example, the parameters that will be compared are <em>value</em>, and <em>otherTemp.value. </em>The type of compareTo method is an integer, we need to return the result.

3 0
3 years ago
Unit 6: Lesson 2 - Coding Activity 1 AP Computer science
sladkih [1.3K]

The complete program is to define a boolean method that returns true if all elements of an array are negative, or return false, if otherwise

The method in java, where comments are used to explain each line is as follows:

//This defines the method

public static boolean chkNegative (double[] myArr) {

   //This initializes a boolean variable

   boolean isNeg = true;

   //This iterates through the array

   for (int i = 0; i < myArr.length; i++) {

     //If the array element is 0 or positive

     if (myArr[i] >= 0) {

         //Then the boolean variable is set to false

       isNeg = false;

       //And the loop is exited

       break;

     }

   }

   //This returns true or false

   return isNeg;

 }

Read more about boolean methods at:

brainly.com/question/18318709

8 0
3 years ago
Okay im spamming but help me again please
Alika [10]

Answer: for 5 its b and for 6 i may be wrong but i think its also b

Explanation:

3 0
3 years ago
How to build aeroplain pls tell me I want to go to amereeca
damaskus [11]

Answer:

lol i think it would be cheaper to but a ticket or drive there

8 0
3 years ago
When a user runs an application, what transfers from a storage device to memory?
jolli1 [7]
It is:
b. instructions


6 0
3 years ago
Other questions:
  • A user is claiming a host can be reached via the IP address but not through the name. What should a technician do first to resol
    13·1 answer
  • People who work the total hours for which they get paid have
    7·2 answers
  • 1. Mobile devices have a _________ viewport that displays a web page content that fits within a mobile screen.
    11·1 answer
  • Write a function M-file that takes as input two matrices A and B, and as output produces
    8·1 answer
  • Why would you set up a workbook to be shared if you are the only one using the workbook?
    7·1 answer
  • Dustin runs a command at the command line trying to find out what kernel version the system is running. However, it doesn't give
    12·1 answer
  • Write the definition of a function named quadratic that receives three double parameters a, b, c. If the value of a is 0 then th
    12·1 answer
  • 1.Terry turned on his computer one day to find that all of the storage on his computer was filled up. Furthermore, there were ma
    6·1 answer
  • Which types of files can be used to define Kubernetes manifest files? yaml, json, yaml and text files
    5·1 answer
  • Write a program that will ask the user for a set of ten numbers. After all ten numbers have been entered, the program will displ
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!