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
Provide a brief, high-level description of how the Internet’s connection-oriented service provides reliable transport.
mario62 [17]

Answer:

  Connection-oriented is the method which is implemented in the transport and data link layer. It is basically depend upon the physical connection in the network system.

Transmission control protocol (TCP) is the connection oriented and user datagram protocol (UDP) is the connection less network transport layer. The TCP and UDP both are operate in the internet protocol (IP).

It basically require connection and it can be establish before sending data. This is also known as reliable network connection service. The connection oriented service establish connection between the different connection terminal before sending any data or information. It can easily handle traffic efficiently.

7 0
3 years ago
A computer has two different printers that the computer can print to, what do you need in order
inessss [21]

Answer:

Download and install a third-party printer application.

Explanation:

Three programs that can print to two printers at the same time are "LeadTools ePrint Professional," "INTELLIscribe" and "Print Distributor." Assign the two printers that you want to use at the same time.

7 0
2 years ago
Which statement describes one of the responsibilities of a computer programmer?
galben [10]

Answer:

d i think

Explanation:

6 0
3 years ago
2 The following image shows the number of orders Company A received in 2015-2020. A financial analyst wants to calculate the yea
Marina CMI [18]

In the above case, the thing to do is to Press Ctrl + Shift + Right Arrow to select cells C4 to G4, then press Ctrl + R.

<h3>What are Computer shortcuts?</h3>

A computer shortcuts are known to be a composition of one or a lot of keys that bring about a command in software or operating system.

Hence, In the above case, the thing to do is to Press Ctrl + Shift + Right Arrow to select cells C4 to G4, then press Ctrl + R.

See options below

Select cell C4, then press Ctrl + Shift + R

Press Ctrl + Shift + Right Arrow to select cells C4 to G4, then press Ctrl + R

Select cell C4, then press Ctrl + R

Press Shift + Right Arrow to select cells C4 to G4, then press Ctrl + R

Learn more about Computer shortcuts  from

brainly.com/question/12531147

#SPJ1

5 0
1 year ago
Write a MASM program to calculate Fibonacci numbers:
IceJOKER [234]

Answer:

.data

programmerName          BYTE   "PROGRAMMER NAME", 0

programTitle       BYTE   "PRINT FIBONACCI NUMBERS WITHIN RANGE", 0

prompt_1           BYTE   "WHAT IS YOUR NAME? ", 0

prompt_2           BYTE   "Enter the number of Fibonacci terms you want to display between [1 - 46]", 0

num_fibo               DWORD   ?

previous1               DWORD   ?

previous2               DWORD   ?

spaces               BYTE   " ",0

goodbye               BYTE   "Goodbye, ", 0

first2           BYTE   "1 1 ", 0

first1           BYTE   "1", 0

temp               DWORD   ?

moduloFive           DWORD   5

UPPERLIMIT = 46

LOWERLIMIT = 1

;user's name

buffer               BYTE 21 DUP(0)

byteCount           DWORD   ?

;greet the user

hi                   BYTE   "Hi, ",0

;validate

highError           BYTE   "The number you entered is too high! Please enter number below 46", 0

lowError           BYTE   "The number you entered is too low! Please eneter number above 1", 0

;EC -> Setting Background Color and Text Color

val1 DWORD 11

val2 DWORD 16

.code

main PROC

  ; setting text color to teal

      mov eax, val2

      imul eax, 16

      add eax, val1

      call setTextColor

  ; introduction

      mov       edx, OFFSET programTitle

      call   WriteString

      mov       edx, OFFSET programmerName

      call   WriteString

      call   CrLf

      ; EC Prompt

      mov       edx, OFFSET ec_prompt

      call   WriteString

      call   CrLf

      mov       edx, OFFSET prompt_1

      call   WriteString

      call   CrLf

      ; get user's name

      mov       edx, OFFSET buffer   ;point to the buffer

      mov       ecx, SIZEOF   buffer   ; specify max characters

      call   ReadString

      mov       byteCount, eax

      ; greet the user

      mov       edx, OFFSET hi

      call   WriteString

      mov       edx, OFFSET buffer

      call   WriteString

      call   CrLf

      ;userInstructions

topPrompt:

          mov       edx, OFFSET prompt_2

          call   WriteString

          call   CrLf

  ;getUserData

      call   ReadInt

      mov       num_fibo, eax

  ; Validate user data

      cmp       eax, UPPERLIMIT

      jg       TooHigh

      cmp       eax, LOWERLIMIT

      jl       TooLow

      je       JustOne

      cmp       eax, 2

      je       JustTwo

  ; displayFibs

      mov       ecx, num_fibo

      sub       ecx, 3           ; we start at iteration 3, the first two are taken care of by JustOne and JustTwo

      mov       eax, 1

      call   WriteDec

      mov       edx, OFFSET spaces

      call   WriteString

      call   WriteDec

      mov       edx, OFFSET spaces

      call   WriteString

      mov       previous2, eax

      mov       eax, 2

      call   WriteDec

      mov       edx, OFFSET spaces

      call   WriteString

      mov       previous1, eax

      fib:

          add       eax, previous2

          call   WriteDec

          mov       edx, OFFSET spaces

          call   WriteString

          mov       temp, eax

          mov       eax, previous1

          mov       previous2, eax

          mov       eax, temp

          mov       previous1, eax

          mov       edx, ecx

          cdq

          div       moduloFive

          cmp       edx, 0

          jne       skip

          call   CrLf

      skip:

              mov       eax, temp

              loop   fib

              jmp       TheEnd

TooHigh:

          mov       edx, OFFSET highError

          call   WriteString

          jmp       TopPrompt

TooLow:

          mov       edx, OFFSET lowError

          call   WriteString

          jmp       TopPrompt

JustOne:

          mov       edx, OFFSET first1

          call   WriteString

          jmp       TheEnd

JustTwo:

          mov       edx, OFFSET first2

          call   WriteString

          jmp       TheEnd

;farewell

TheEnd:

          call   CrLf

          mov       edx, OFFSET goodbye

          call   WriteString

          mov       edx, OFFSET buffer

          call   WriteString

          call   CrLf

  exit   ; exit to operating system

main ENDP

END main

3 0
2 years ago
Other questions:
  • Aubrey is on a Windows machine. She wants to back up her Halloween pictures on an external hard drive. Which of the following ta
    12·1 answer
  • Determine the number of bytes necessary to store an uncompressed binary image of size 4000 × 3000 pixels
    11·1 answer
  • Matlab In this assignment you will write a function that will calculate parallel resistance for up to 10 parallel resistors. Cal
    15·1 answer
  • Write code using the range function to add up the series 99, 98, 97,...
    11·1 answer
  • Which component of an email gives the recipient an idea of the email’s purpose and urgency?
    7·1 answer
  • Kenny FRIEND ME. Ps that is my brother
    9·2 answers
  • Why is computer science hardware needed to solve problems with computers?
    9·1 answer
  • Which is NOT a valid compute shape option within the Oracle Cloud Infrastructure (OCI) compute service
    9·1 answer
  • Which statements describe the advantages of using XML
    5·1 answer
  • Which of the following is an example of an inline element? A. B. C. D.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!