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
kirill115 [55]
3 years ago
13

Write a few statements that open a file called "greeting", write the message "hey!" to the file -- and then close it. declare an

y variables needed.
Computers and Technology
2 answers:
pshichka [43]3 years ago
6 0
C++:

int main () {

std::ofstream output {"greeting.txt"};
output << "hey!";
output.close();

return 0;
}
Shtirlitz [24]3 years ago
5 0

Answer:

The answer to this question can be given as:

Statement:

FILE *data1;     //create file pointer type variable

data1 = fopen("greeting","w");    //open file use fopen function

fprintf(data1,"hey!");    //print message.

fclose(data1);  //close file.

Explanation:

The description of the statement can be given as:

  • In this statement firstly we define a file pointer type variable that is "data1".This variable holds the file.  
  • Then we use the fopen() function that is used to open a file. In this function, we pass the file name and the mode to open the file.
  • Then we use the fprintf() function this function prints the value of the file.
  • In the last, we close the file, for close file we use fclose() function.
You might be interested in
Carlie was asked to review a software project for her company to determine specific deadlines. Which part of project management
Elis [28]

Answer:

Resources

Explanation:

Carlie certainly requires to review the resources. It is important to find out how many software engineers, testers, etc. are available. And only then Carlie can find out the exact deadlines as required here. And hence, she must have look at the resources while determining the specific deadlines. Hence, resources are the correct option.

3 0
3 years ago
Read 2 more answers
What type of hacker is primarily motivated by an ideology, epitomizing "the ends justify the means" mentality?.
Hunter-Best [27]

The type of hacker that is primarily moved by an ideology, epitomizing "the ends justify the means" mentality is Hacktivism.

<h3>What type of hackers are motivated by social or political issues?</h3>

Hacktivism is known to be an act of the wrong use a computer system or network for a socially or politically motivated  aim or reason.

The type of hacker that is primarily moved by an ideology, epitomizing "the ends justify the means" mentality is Hacktivism and they are called hacktivist.

Learn more about Hacktivism from

brainly.com/question/5483494

#SPJ1

5 0
2 years ago
In Microsoft word you can access the ______ command from "mini toolbar"
Mashcka [7]
Redo command, i think.
8 0
2 years ago
Read 2 more answers
The return value is a one-dimensional array that contains two elements. These two elements indicate the rows and column indices
erma4kov [3.2K]

Answer:

In Java:

import java.util.Scanner;  

import java.util.Arrays;  

public class Main  {  

public static void main(String args[])  {  

Scanner input = new Scanner(System.in);

int row, col;  

System.out.print("Rows: ");    row = input.nextInt();

System.out.print("Cols: ");     col = input.nextInt();  

int[][] Array2D = new int[row][col];

System.out.print("Enter array elements: ");

for(int i =0;i<row;i++){    

    for(int j =0;j<col;j++){

        Array2D[i][j] = input.nextInt();  

    }     }

 

int[] maxarray = findmax(Array2D,row,col);

System.out.println("Row: "+(maxarray[0]+1));

System.out.println("Column: "+(maxarray[1]+1));

}  

public static int[] findmax(int[][] Array2D,int row, int col)   {  

int max = Array2D[0][0];

int []maxitem = new int [2];

for(int i =0;i<row;i++){

    for(int j =0;j<col;j++){

        if(Array2D[i][j] > max){  

            maxitem[0] = i;

            maxitem[1] = j; } }    }

 

return maxitem;  

}  

}

Explanation:

The next two lines import the scanner and array libraries

<em>import java.util.Scanner;   </em>

<em>import java.util.Arrays;   </em>

The class of the program

<em>public class Main  {  </em>

The main method begins here

<em>public static void main(String args[])  {  </em>

The scanner function is called in the program

<em>Scanner input = new Scanner(System.in);</em>

This declares the array row and column

int row, col;

This next instructions prompt the user for rows and get the row input  

System.out.print("Rows: ");    row = input.nextInt();

This next instructions prompt the user for columns and get the column input  

System.out.print("Cols: ");     col = input.nextInt();  

This declares the 2D array

int[][] Array2D = new int[row][col];

This prompts the user for array elements

System.out.print("Enter array elements: ");

The following iteration populates the 2D array

<em> for(int i =0;i<row;i++){    </em>

<em>     for(int j =0;j<col;j++){ </em>

<em>         Array2D[i][j] = input.nextInt();   </em>

<em>     }     } </em>

This calls the findmax function. The returned array of the function is saved in maxarray  

int[] maxarray = findmax(Array2D,row,col);

This prints the row position

System.out.println("Row: "+(maxarray[0]+1));

This prints the column position

System.out.println("Column: "+(maxarray[1]+1));

The main method ends here

}  

The findmax function begins here

public static int[] findmax(int[][] Array2D,int row, int col)   {  

This initializes the maximum to the first element of the array

int max = Array2D[0][0];

This declares maxitem. The array gets the position of the maximum element

int []maxitem = new int [2];

The following iteration gets the position of the maximum element

<em>for(int i =0;i<row;i++){ </em>

<em>     for(int j =0;j<col;j++){ </em>

<em>         if(Array2D[i][j] > max){  </em>

<em>             maxitem[0] = i; </em><em>-- The row position is saved in index 0</em><em> </em>

<em>             maxitem[1] = j;  </em><em>-- The column position is saved in index 1</em><em>} }    } </em>

This returns the 1 d array

return maxitem;  

}  

7 0
3 years ago
Drag each tile to the correct box.
Arte-miy333 [17]

Answer:

Explanation:

web server= stores text, images, and other media that make up a website

email server= stores and exchanges messages

Proxy server= filters content and stores data for faster access

FTP server= stores and provides files for download

7 0
2 years ago
Read 2 more answers
Other questions:
  • To move to the most extreme right cell containing data in your worksheet, what basic key combination can you use?
    7·1 answer
  • You are configuring two switches of different vendors such that they connect to each other via a single link that will carry mul
    13·1 answer
  • Your school computer library has a network that connects computers and devices within a few small rooms. what type of network do
    7·1 answer
  • Use the image above to determine which toolbars will be displayed in the program you are using. SELECT ALL THAT APPLY
    11·2 answers
  • This is in government
    15·1 answer
  • What can happen if you do not follow the directions when cooking or baking? (Give 4 examples in a sentence each)
    8·1 answer
  • Listed here are a few camera angles and their images.
    10·1 answer
  • Finish the program by choosing the correct terms.
    7·2 answers
  • HELP ASAP, AND YES I KNOW, WRONG CATEGORY. SORRY!
    10·2 answers
  • If you hard working right now go to this EASY question
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!